Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can we create a container with a text as a child of showDialog and appear the text in a proper way

I used to make a text (‘Loading’) to be centered in the show dialog but what happened is the text is appearing in a bad way as when we make a screen without scaffold, it is appearing here the same, I used to put scaffold above the center widget but it didn’t work also.

      showDialog(
      context: context,
      barrierColor: Colors.blueGrey.shade50.withOpacity(0.5),
      barrierDismissible: true,
      builder: (ctx) {
        return WillPopScope(
          onWillPop: () async => false,
          child: Center(
            child: Container(
              child: const Text('Loading'),
            ),
          ),
        );
      });

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

It is missing Material, You can wrap with any material widget.

barrierDismissible: true,
builder: (ctx) {
  return Material( //here
    child: WillPopScope(
      onWillPop: () async => false,
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading