show method

void show({
  1. dynamic title = "Aviso!",
  2. required String message,
  3. required BuildContext context,
})

Implementation

void show(
    {title = "Aviso!",
    required String message,
    required BuildContext context}) {
  if (!this._isDialogShowing) {
    this._isDialogShowing = true;
    showDialog(
      context: context,
      builder: (BuildContext context) {
        return AlertDialog(
          title: new Text(
            title,
            style: TextStyle(fontWeight: FontWeight.bold),
          ),
          content: new Text(message),
          actions: <Widget>[
            new TextButton(
              child: new Text(
                "OK",
                style: TextStyle(fontWeight: FontWeight.bold),
              ),
              onPressed: () {
                this._isDialogShowing = false;
                Navigator.of(context).pop();
              },
            ),
          ],
        );
      },
    );
  }
}