showConfirmDialog static method
Shows an alert dialog asking the user for a confirmation
This alert contains an optional title
, message
. positiveButtonText
and negativeButtonText
will be shown on the corresponding buttons. When
the user clicks on positiveButtonText
this will return true. When the
user clicks on negativeButtonText
this will return false. destructive
can be set to true to show the user this is a destructive operation (only on iOS).
Implementation
static Future<bool?> showConfirmDialog({
String? title,
String? message,
String positiveButtonText = defaultPositiveButtonText,
String negativeButtonText = defaultNegativeButtonText,
bool destructive = false,
}) async {
return await _channel.invokeMethod(
'dialog.confirm',
{
"title": title,
"message": message,
"positiveButtonText": positiveButtonText,
"negativeButtonText": negativeButtonText,
"destructive": destructive,
},
);
}