2
0
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:
Oliver
2021-07-13 00:13:38 +10:00
parent dd39b98ae9
commit 40613c9c36
11 changed files with 16 additions and 16 deletions

View File

@ -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 {

View File

@ -107,7 +107,7 @@ class _CompanyDetailState extends RefreshableState<CompanyDetailWidget> {
List<Widget> _companyTiles() {
var tiles = List<Widget>.empty();
List<Widget> tiles = [];
bool sep = false;

View File

@ -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";

View File

@ -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) {

View File

@ -128,7 +128,7 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
_LocationDisplayState(this.location) {}
List<InvenTreeStockLocation> _sublocations = List<InvenTreeStockLocation>.empty();
List<InvenTreeStockLocation> _sublocations = [];
String _locationFilter = '';

View File

@ -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)) {