Answers for "flutter alertdialog wrap content"

7

flutter alertdialog padding

titlePadding: const EdgeInsets.only(top: 24.0, left: 24.0, right: 24.0),
contentPadding: const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),
actionsPadding: const EdgeInsets.all(0.0), // Padding around the set of actions at the bottom of the dialog.
buttonPadding: const EdgeInsets.all(8.0), // The padding that surrounds each button in actions.
insetPadding: const EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0),
Posted by: Guest on August-22-2021
2

alertdialog flutter

showAlertDialog(BuildContext context) {

  // set up the button
  Widget okButton = FlatButton(
    child: Text("OK"),
    onPressed: () { },
  );

  // set up the AlertDialog
  AlertDialog alert = AlertDialog(
    title: Text("My title"),
    content: Text("This is my message."),
    actions: [
      okButton,
    ],
  );

  // show the dialog
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return alert;
    },
  );
}
Posted by: Guest on September-03-2020

Code answers related to "Dart"

Browse Popular Code Answers by Language