showErrorDialog function

Future<Null> showErrorDialog (
  1. BuildContext context,
  2. String message,
  3. {String title}
)

Implementation

Future<Null> showErrorDialog(BuildContext context, String message,
    {String title}) {
  return showDialog<Null>(
    context: context,
    barrierDismissible: false, // user must tap button!
    builder: (BuildContext context) => new AlertDialog(
          title: title != null ? new Text(title) : null,
          content: new SingleChildScrollView(
            child: new ListBody(
              children: <Widget>[
                new Text(message ?? FFULocalizations.of(context).errorOccurred),
              ],
            ),
          ),
          actions: <Widget>[
            new FlatButton(
              child: new Row(
                children: <Widget>[
                  new Text(FFULocalizations.of(context).cancelButtonLabel),
                ],
              ),
              onPressed: () {
                Navigator.of(context).pop();
              },
            ),
          ],
        ),
  );
}