mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-29 05:56:47 +00:00
Show snack bar with image upload result
This commit is contained in:
parent
a7d19c4c5a
commit
a78e0e65e1
2
lib/l10n
2
lib/l10n
@ -1 +1 @@
|
|||||||
Subproject commit 8f0cf961ecf8b518e99e6b994ec3cdffc5c3c5b0
|
Subproject commit 7a23f04bfc11dd099511536bdb8b72a9b35edecf
|
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user