1

I'm trying to clip or limit the size of the showDialog barrier so it can be contained in another widget.

I tried using LayoutBuilder inside the showDialog to get the constraints, but it isnt working.

I'm on flutter 2.2 WEB

I also tried setting a globalkey on the widget thats has the size I don't want to overflow and getting the RenderBox size but the size returnet is the final size of my browser.

enter image description here enter image description here

Damien Morattel
  • 183
  • 1
  • 8

1 Answers1

0

try adding a column inside the content in the dialog and set the mainAxisSize to min

showDialog(
        context: context,
        builder: (BuildContext context) {
          return AlertDialog(
            title: new Text("Smaller Dialog"),
            content: Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                   //your code here
                ]
                ),
              );
            });
flutter_bee
  • 150
  • 9