showAlertDialog1 method

dynamic showAlertDialog1(
  1. BuildContext context,
  2. String title,
  3. String subTitle
)

Implementation

showAlertDialog1(BuildContext context, String title, String subTitle) {
  // set up the button
  Widget okButton = TextButton(
    child: Text("OK"),
    onPressed: () {
      Navigator.of(context).pop();
    },
  );

  // set up the AlertDialog
  AlertDialog alert = AlertDialog(
    title: Text(title),
    content: Text(subTitle),
    actions: [okButton],
  );

  // show the dialog
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return alert;
    },
  );
}