mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-13 10:45:29 +00:00
Label fix (#411)
* Cleanup label printing options - Improve calls to setState() - Should fix potential race conditions * Use name if description not available * Code simplification * Fetch plugins even if the server reports "plugins enabled" - Builtin plugins are still a thing! * Use name *and* description to display label
This commit is contained in:
@ -66,12 +66,18 @@ Future<void> selectAndPrintLabel(
|
||||
|
||||
// Construct list of available label templates
|
||||
for (var label in labels) {
|
||||
String display_name = (label["description"] ?? "").toString();
|
||||
String name = (label["name"] ?? "").toString();
|
||||
String description = (label["description"] ?? "").toString();
|
||||
|
||||
if (description.isNotEmpty) {
|
||||
name += " - ${description}";
|
||||
}
|
||||
|
||||
int pk = (label["pk"] ?? -1) as int;
|
||||
|
||||
if (display_name.isNotEmpty && pk > 0) {
|
||||
if (name.isNotEmpty && pk > 0) {
|
||||
label_options.add({
|
||||
"display_name": display_name,
|
||||
"display_name": name,
|
||||
"value": pk,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user