mirror of
https://github.com/inventree/inventree-app.git
synced 2026-10-08 08:07:09 +00:00
Improve error management for label printing (#588)
- Handle empty label - Handle empty printer
This commit is contained in:
1 parent
bc44b99d43
commit
d84f76d482
3 files changed
+39
No files matched your search
@@ -94,6 +94,28 @@ Future<void> selectAndPrintLabel(
|
||||
"",
|
||||
fields,
|
||||
icon: TablerIcons.printer,
|
||||
validate: (Map<String, dynamic> data) {
|
||||
final template = data["label"];
|
||||
final plugin = data["plugin"];
|
||||
|
||||
if (template == null) {
|
||||
showSnackIcon(
|
||||
L10().labelSelectTemplate,
|
||||
success: false,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (plugin == null) {
|
||||
showSnackIcon(
|
||||
L10().labelSelectPrinter,
|
||||
success: false,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
onSuccess: (Map<String, dynamic> data) async {
|
||||
int labelId = (data["label"] ?? -1) as int;
|
||||
var pluginKey = data["plugin"];
|
||||
|
||||
Reference in new issue
Block a user