1

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'),
            ),
          ),
        );
      });
Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
Flutter Dev
  • 488
  • 3
  • 18

1 Answers1

1

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

barrierDismissible: true,
builder: (ctx) {
  return Material( //here
    child: WillPopScope(
      onWillPop: () async => false,
Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
  • 1
    oh thank you solved, can you please also check out this error I think there's no solution for it https://stackoverflow.com/questions/74301664/error-builder-in-the-imagenetwork-does-not-handle-an-error-if-the-user-enters-th?noredirect=1#comment131176785_74301664 – Flutter Dev Nov 05 '22 at 13:41