mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-14 19:25:27 +00:00
.empty() -> []
Turns out .empty() creates an empty list which is fixed length!
This commit is contained in:
@ -130,7 +130,7 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
|
||||
// The local InvenTreePartCategory object
|
||||
final InvenTreePartCategory? category;
|
||||
|
||||
List<InvenTreePartCategory> _subcategories = List<InvenTreePartCategory>.empty();
|
||||
List<InvenTreePartCategory> _subcategories = [];
|
||||
|
||||
@override
|
||||
Future<void> onBuild(BuildContext context) async {
|
||||
|
@ -107,7 +107,7 @@ class _CompanyDetailState extends RefreshableState<CompanyDetailWidget> {
|
||||
|
||||
List<Widget> _companyTiles() {
|
||||
|
||||
var tiles = List<Widget>.empty();
|
||||
List<Widget> tiles = [];
|
||||
|
||||
bool sep = false;
|
||||
|
||||
|
@ -39,9 +39,9 @@ class CustomerListWidget extends CompanyListWidget {
|
||||
|
||||
class _CompanyListState extends RefreshableState<CompanyListWidget> {
|
||||
|
||||
var _companies = new List<InvenTreeCompany>.empty();
|
||||
List<InvenTreeCompany> _companies = [];
|
||||
|
||||
var _filteredCompanies = new List<InvenTreeCompany>.empty();
|
||||
List<InvenTreeCompany> _filteredCompanies = [];
|
||||
|
||||
String _title = "Companies";
|
||||
|
||||
|
@ -220,7 +220,7 @@ void showFormDialog(String title, {String? acceptText, String? cancelText, Globa
|
||||
];
|
||||
}
|
||||
|
||||
var _fields = fields ?? List<Widget>.empty();
|
||||
List<Widget> _fields = fields ?? [];
|
||||
|
||||
OneContext().showDialog(
|
||||
builder: (BuildContext context) {
|
||||
|
@ -128,7 +128,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
|
||||
_LocationDisplayState(this.location) {}
|
||||
|
||||
List<InvenTreeStockLocation> _sublocations = List<InvenTreeStockLocation>.empty();
|
||||
List<InvenTreeStockLocation> _sublocations = [];
|
||||
|
||||
String _locationFilter = '';
|
||||
|
||||
|
@ -296,7 +296,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
)
|
||||
),
|
||||
suggestionsCallback: (pattern) async {
|
||||
var suggestions = List<InvenTreeStockLocation>.empty();
|
||||
List<InvenTreeStockLocation> suggestions = [];
|
||||
|
||||
for (var loc in locations) {
|
||||
if (loc.matchAgainstString(pattern)) {
|
||||
|
Reference in New Issue
Block a user