mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-13 10:45:29 +00:00
Toot toot, it's the refactor tractor
- Introduces the concept of a "BarcodeHandler" - Re-uses most of the code - Custom handlers for barcode success / failure
This commit is contained in:
@ -9,6 +9,28 @@ void showMessage(BuildContext context, String message) {
|
||||
));
|
||||
}
|
||||
|
||||
Future<void> showInfoDialog(BuildContext context, String title, String description, {IconData icon = FontAwesomeIcons.info, String info = "Info", Function onDismissed}) async {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SimpleDialog(
|
||||
title: ListTile(
|
||||
title: Text(info),
|
||||
leading: FaIcon(icon),
|
||||
),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: Text(title),
|
||||
subtitle: Text(description)
|
||||
)
|
||||
]
|
||||
)
|
||||
).then((value) {
|
||||
if (onDismissed != null) {
|
||||
onDismissed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> showErrorDialog(BuildContext context, String title, String description, {IconData icon = FontAwesomeIcons.exclamationCircle, String error = "Error", Function onDismissed}) async {
|
||||
showDialog(
|
||||
context: context,
|
||||
|
Reference in New Issue
Block a user