showAlertDialog static method

void showAlertDialog(
  1. {bool dismissible = true,
  2. Widget title,
  3. Widget content,
  4. Color backgroundColor = Colors.white,
  5. String okString,
  6. Function onOkPressed}
)

Implementation

static void showAlertDialog({
  bool dismissible = true,
  Widget title,
  Widget content,
  Color backgroundColor = Colors.white,
  String okString,
  Function onOkPressed,
}) {
  showDialog(
    barrierDismissible: dismissible,
    context: _globalProvider.globalContext,
    builder: (context) {
      return AlertDialog(
        backgroundColor: backgroundColor,
        title: title,
        content: content,
        actions: <Widget>[
          FlatButton(
            child: Text(okString),
            onPressed: () {
              Navigator.pop(_globalProvider.globalContext);
              onOkPressed();
            },
          ),
        ],
      );
    },
  );
}