showAlertDialog method

dynamic showAlertDialog(
  1. BuildContext context,
  2. dynamic title,
  3. dynamic msg,
  4. dynamic requestFirst,
)

Implementation

showAlertDialog(BuildContext context, title, msg, requestFirst) {
  myLogAll('showAlertDialog');
  int backcolor = Colors.white.value;
  int frontcolor = Colors.black.value;
  // set up the buttons
  Widget cancelButton = ElevatedButton(
    child: MyLabel(const {gLabel: gCancel}, frontcolor),
    onPressed: () {
      Navigator.of(context).pop();
    },
  );
  Widget continueButton = ElevatedButton(
    child: MyLabel(const {gLabel: gContinue}, frontcolor),
    onPressed: () {
      localAction(requestFirst, context);
      Navigator.of(context).pop();
    },
  );
  // set up the AlertDialog
  AlertDialog alert = AlertDialog(
    title: MyLabel({gLabel: title}, backcolor),
    content: MyLabel({gLabel: msg}, backcolor),
    actions: [
      cancelButton,
      continueButton,
    ],
  );
  // show the dialog
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return alert;
    },
  );
}