mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
.empty() -> []
Turns out .empty() creates an empty list which is fixed length!
This commit is contained in:
parent
dd39b98ae9
commit
40613c9c36
11 changed files with 16 additions and 16 deletions
|
|
@ -307,7 +307,7 @@ class InvenTreeModel {
|
|||
var response = await api.get(URL, params: params);
|
||||
|
||||
// A list of "InvenTreeModel" items
|
||||
List<InvenTreeModel> results = new List<InvenTreeModel>.empty();
|
||||
List<InvenTreeModel> results = [];
|
||||
|
||||
if (response == null) {
|
||||
return results;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ class InvenTreePart extends InvenTreeModel {
|
|||
}
|
||||
|
||||
// Cached list of stock items
|
||||
List<InvenTreeStockItem> stockItems = List<InvenTreeStockItem>.empty();
|
||||
List<InvenTreeStockItem> stockItems = [];
|
||||
|
||||
int get stockItemCount => stockItems.length;
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ class InvenTreePart extends InvenTreeModel {
|
|||
int get supplier_count => (jsondata['suppliers'] ?? 0) as int;
|
||||
|
||||
// Cached list of test templates
|
||||
List<InvenTreePartTestTemplate> testingTemplates = List<InvenTreePartTestTemplate>.empty();
|
||||
List<InvenTreePartTestTemplate> testingTemplates = [];
|
||||
|
||||
int get testTemplateCount => testingTemplates.length;
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ class InvenTreePart extends InvenTreeModel {
|
|||
|
||||
if (fn.isNotEmpty) return fn;
|
||||
|
||||
List<String> elements = List<String>.empty();
|
||||
List<String> elements = [];
|
||||
|
||||
if (IPN.isNotEmpty) elements.add(IPN);
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class InvenTreeStockItem extends InvenTreeModel {
|
|||
// TODO
|
||||
}
|
||||
|
||||
List<InvenTreePartTestTemplate> testTemplates = List<InvenTreePartTestTemplate>.empty();
|
||||
List<InvenTreePartTestTemplate> testTemplates = [];
|
||||
|
||||
int get testTemplateCount => testTemplates.length;
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ class InvenTreeStockItem extends InvenTreeModel {
|
|||
});
|
||||
}
|
||||
|
||||
List<InvenTreeStockItemTestResult> testResults = List<InvenTreeStockItemTestResult>.empty();
|
||||
List<InvenTreeStockItemTestResult> testResults = [];
|
||||
|
||||
int get testResultCount => testResults.length;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue