2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-29 14:06:47 +00:00

Show snack bar with image upload result

This commit is contained in:
Oliver 2021-06-23 19:21:23 +10:00
parent a7d19c4c5a
commit a78e0e65e1
2 changed files with 18 additions and 4 deletions

@ -1 +1 @@
Subproject commit 8f0cf961ecf8b518e99e6b994ec3cdffc5c3c5b0 Subproject commit 7a23f04bfc11dd099511536bdb8b72a9b35edecf

View File

@ -117,11 +117,25 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
refresh(); refresh();
} }
/**
* Upload image for this Part.
* Show a SnackBar with upload result.
*/
void _uploadImage(File image) async { void _uploadImage(File image) async {
print("Uploading image..."); final result = await part.uploadImage(image);
await part.uploadImage(image);
print("Done"); if (result) {
showSnackIcon(
L10().imageUploadSuccess,
success: true
);
} else {
showSnackIcon(
L10().imageUploadFailure,
success: false,
);
}
refresh(); refresh();
} }