showAlertDialog method
Show a simple dialog with title, message and a close button.
Example usage:
void _showUploadSuccessDialog(BuildContext context) {
context.showDialog(
message: "Uploaded successful!",
);
}
Implementation
Future showAlertDialog({
String? title,
required String message,
closeButtonTitle = "OK",
}) {
return showDialog<void>(
context: this,
builder: (BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(FludaX.x3),
),
title: (title != null)
? Text(
title,
style: context.theme.textTheme.headline5,
)
: const SizedBox(),
content: Text(
message,
style: context.theme.textTheme.headline6,
),
actions: <Widget>[
TextButton(
child: Text(
closeButtonTitle,
style: context.theme.textTheme.button,
),
onPressed: () => this.navigator.pop(),
),
],
);
},
);
}