mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-13 10:45:29 +00:00
Show snack bar with image upload result
This commit is contained in:
2
lib/l10n
2
lib/l10n
Submodule lib/l10n updated: 8f0cf961ec...7a23f04bfc
@ -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();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user