showAlertDialog static method

Future<bool?> showAlertDialog({
  1. String? title,
  2. String? message,
  3. String? positiveButtonText,
})

Shows an alert dialog to the user

An alert contains an optional title, message. The positiveButtonText will appear under the dialog and allows users to close it. When closed, a bool will be returned to the user. This value will always be true.

Implementation

static Future<bool?> showAlertDialog({
  String? title,
  String? message,
  String? positiveButtonText,
}) async {
  return await _channel.invokeMethod(
    'dialog.alert',
    {
      "title": title,
      "message": message,
      "positiveButtonText":
          positiveButtonText ?? defaultPositiveButtonText,
    },
  );
}