child property

  1. @override
Widget? get child
override

The widget below this widget in the tree.

This widget can only have one child. To lay out multiple children, let this widget's child be a widget such as Row, Column, or Stack, which have a children property, and then provide the children to that widget.

Implementation

@override
Widget? get child {
  final mediaQuerySize = MediaQuery.of(context).size;
  return Container(
    padding: const EdgeInsets.symmetric(vertical: 20),
    width: mediaQuerySize.width * 0.8,
    child: Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        const SizedBox(height: 30),
        SvgPicture.asset(dialogIcon),
        const SizedBox(height: 20),
        Text(
          dialogTitle,
          style: const TextStyle(
            color: blackColor,
            fontSize: 18,
            fontWeight: FontWeight.bold,
          ),
        ),
        const SizedBox(height: 40),
        Text(
          dialogMsg,
          style: const TextStyle(color: lightGreyColor, fontSize: 16),
        ),
        const SizedBox(height: 32),
        SizedBox(
          width: mediaQuerySize.width * .7,
          height: 55,
          child: ElevatedButton(
            style: ElevatedButton.styleFrom(backgroundColor: primaryColor),
            onPressed: onclick,
            child: Text(
              buttonText.translate(context),
              style: const TextStyle(
                color: whiteColor,
                fontWeight: FontWeight.bold,
                fontSize: 16,
              ),
            ),
          ),
        ),
      ],
    ),
  );
}