mirror of
https://github.com/inventree/inventree-app.git
synced 2026-11-29 16:55:04 +00:00
Show snack bar with image upload result
This commit is contained in:
1 parent
a7d19c4c5a
commit
a78e0e65e1
2 files changed
+18
-4
No files matched your search
+1
-1
Submodule lib/l10n updated: 8f0cf961ec...7a23f04bfc.
@@ -117,11 +117,25 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload image for this Part.
|
||||
* Show a SnackBar with upload result.
|
||||
*/
|
||||
void _uploadImage(File image) async {
|
||||
|
||||
print("Uploading image...");
|
||||
await part.uploadImage(image);
|
||||
print("Done");
|
||||
final result = await part.uploadImage(image);
|
||||
|
||||
if (result) {
|
||||
showSnackIcon(
|
||||
L10().imageUploadSuccess,
|
||||
success: true
|
||||
);
|
||||
} else {
|
||||
showSnackIcon(
|
||||
L10().imageUploadFailure,
|
||||
success: false,
|
||||
);
|
||||
}
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user