mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Improve functionality of showErrorDialog function
- Provide callback for when the dialog is dismissed - Optionally set the error title bar
This commit is contained in:
parent
baed2d98c6
commit
6102b39e9d
1 changed files with 7 additions and 3 deletions
|
|
@ -9,12 +9,12 @@ void showMessage(BuildContext context, String message) {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
void showErrorDialog(BuildContext context, String title, String description) {
|
Future<void> showErrorDialog(BuildContext context, String title, String description, {String error = "Error", Function onDismissed}) async {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
child: SimpleDialog(
|
child: SimpleDialog(
|
||||||
title: ListTile(
|
title: ListTile(
|
||||||
title: Text("Error"),
|
title: Text(error),
|
||||||
leading: FaIcon(FontAwesomeIcons.exclamationCircle),
|
leading: FaIcon(FontAwesomeIcons.exclamationCircle),
|
||||||
),
|
),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|
@ -24,7 +24,11 @@ void showErrorDialog(BuildContext context, String title, String description) {
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
).then((value) {
|
||||||
|
if (onDismissed != null) {
|
||||||
|
onDismissed();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void showProgressDialog(BuildContext context, String title, String description) {
|
void showProgressDialog(BuildContext context, String title, String description) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue