showAlertDialog static method

void showAlertDialog({
  1. required BuildContext context,
  2. List<Widget>? titleRowWidgets,
  3. Widget? content,
  4. List<Widget>? actions,
  5. dynamic onDismiss,
})

Show alert dialog with various components

Implementation

static void showAlertDialog(
    {required BuildContext context,
    List<Widget>? titleRowWidgets,
    Widget? content,
    List<Widget>? actions,
    onDismiss}) {
  if (titleRowWidgets == null) titleRowWidgets = [];
  showDialog(
      context: context,
      builder: (context) => new AlertDialog(
            title: Row(children: titleRowWidgets!),
            content: content,
            actions: actions,
          )).then((value) => {
        if (onDismiss != null)
          onDismiss()
        else
          Navigator.of(context).pop(false)
      });
}