showAlert static method
void
showAlert({})
Implementation
static void showAlert(
{String? title,
required String message,
List<Widget>? actions,
Widget? content,
bool? barrierDismissible,
required DialogStyle dialogStyle}) {
showDialog(
context: buildContext,
routeSettings: _routeSettings,
builder: (_) {
return AlertDialog(
backgroundColor: dialogStyle.backgroundColor, //Colors.white,
title: title != null
? Text(
title,
style: dialogStyle.titleTextStyle,
// style: const TextStyle(fontSize: 17),
)
: const Offstage(),
contentPadding: title != null
? const EdgeInsets.only(top: 15, right: 25, left: 25, bottom: 0)
: const EdgeInsets.only(top: 0, right: 25, left: 25, bottom: 5),
content: PopScope(
canPop: barrierDismissible ?? true,
onPopInvokedWithResult: (didPop, result) {
if (didPop) {
return;
}
},
child: content ??
Text(
message,
style: dialogStyle.contentTextStyle,
/*style: const TextStyle(
color: textHintColor,
fontWeight: FontWeight.normal,
fontSize: 18),*/
),
),
contentTextStyle: dialogStyle.contentTextStyle,
// contentTextStyle: const TextStyle(color: textHintColor, fontWeight: FontWeight.w500),
actions: actions,
);
},
barrierDismissible: barrierDismissible ?? true);
}