mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Improve error management for label printing (#588)
- Handle empty label - Handle empty printer
This commit is contained in:
parent
bc44b99d43
commit
d84f76d482
3 changed files with 39 additions and 0 deletions
|
|
@ -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"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue