showDialog method
Shows a dialog to the user
It will show a platform specific dialog by default. This can be changed by setting dialogPlatform
Implementation
Future<DialogResponse?> showDialog({
String? title,
String? description,
String? cancelTitle,
Color? cancelTitleColor,
String buttonTitle = 'Ok',
Color? buttonTitleColor,
bool barrierDismissible = false,
/// Indicates which [DialogPlatform] to show.
///
/// When not set a Platform specific dialog will be shown
DialogPlatform? dialogPlatform,
}) {
if (dialogPlatform != null) {
return _showDialog(
title: title,
description: description,
cancelTitle: cancelTitle,
cancelTitleColor: cancelTitleColor,
buttonTitle: buttonTitle,
buttonTitleColor: buttonTitleColor,
dialogPlatform: dialogPlatform,
barrierDismissible: barrierDismissible,
);
} else {
var _dialogType = GetPlatform.isAndroid
? DialogPlatform.Material
: DialogPlatform.Cupertino;
return _showDialog(
title: title,
description: description,
cancelTitle: cancelTitle,
cancelTitleColor: cancelTitleColor,
buttonTitle: buttonTitle,
buttonTitleColor: buttonTitleColor,
dialogPlatform: _dialogType,
barrierDismissible: barrierDismissible,
);
}
}