mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 10:15:32 +00:00
Show snack bar with image upload result
This commit is contained in:
@ -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