2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-07-30 01:01:37 +00:00

Snack bars for barcode actions

This commit is contained in:
Oliver Walters
2021-02-17 08:41:17 +11:00
parent 0773b2e70d
commit b7e9c06dfa
4 changed files with 118 additions and 91 deletions

View File

@@ -24,8 +24,18 @@ void showSnackIcon(String text, {IconData icon, Function onAction, bool success,
if (success == true) {
backgroundColor = Colors.lightGreen;
// Select an icon if we do not have an action
if (icon == null && onAction == null) {
icon = FontAwesomeIcons.checkCircle;
}
} else if (success == false) {
backgroundColor = Colors.deepOrange;
if (icon == null && onAction == null) {
icon = FontAwesomeIcons.exclamationCircle;
}
}
SnackBarAction action;