Sunil
Sunil

Reputation: 3504

How can move content bottom of AlertDialog in Flutter

I want to display some option in the bottom of Flutter AlertDialog. As you can see

enter image description here

Upvotes: 0

Views: 1727

Answers (2)

BIS Tech
BIS Tech

Reputation: 19514

Simple way: you can use padding

showDialog<String>(
        context: context,
        barrierDismissible: true,
        builder: (BuildContext context) {
          return Padding(
            padding: const EdgeInsets.only(top:300.0),
            child: //AlertDiloag / CupertinoAlertDialog
          );
        },
      );

Upvotes: 0

Bostrot
Bostrot

Reputation: 6033

If I understand correctly you can use the showDialog component which lays behind the AlertDialog with a nested Column. For a greyed out background ou can use Opacity with a Container:

showDialog(
    context: context,
    builder: (context) {
       return Opacity(
          opacity: 0.8, // some opacity
          child: Container(
              // container to set color
              color: Colors.grey,
              child: Column(
                  mainAxisSize: MainAxisSize.max,
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: [
                    RaisedButton(
                      onPressed: null,
                    ), // replace with your buttons
                    RaisedButton(
                      onPressed: null,
                    ),
                  ]
               )
            )
        );
    }
);

Upvotes: 2

Related Questions