2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 18:25:26 +00:00

Add progress indicators to a bunch o' stuff

This commit is contained in:
Oliver Walters
2021-02-11 21:38:48 +11:00
parent dba45c7600
commit b1b85a33f8
8 changed files with 172 additions and 96 deletions

View File

@ -1,6 +1,7 @@
import 'package:InvenTree/api.dart';
import 'package:InvenTree/inventree/stock.dart';
import 'package:InvenTree/preferences.dart';
import 'package:InvenTree/widget/progress.dart';
import 'package:InvenTree/widget/refreshable_state.dart';
import 'package:InvenTree/widget/fields.dart';
@ -235,16 +236,25 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
List<Widget> detailTiles() {
List<Widget> tiles = [
locationDescriptionCard(),
Divider(),
ListTile(
title: Text(
I18N.of(context).sublocations,
style: TextStyle(fontWeight: FontWeight.bold)
),
),
SublocationList(_sublocations)
];
if (loading) {
tiles.add(progressIndicator());
} else if (_sublocations.length > 0) {
tiles.add(SublocationList(_sublocations));
} else {
tiles.add(ListTile(
title: Text("No Sublocations"),
subtitle: Text("No sublocations available")
));
}
return tiles;
}
@ -252,16 +262,25 @@ List<Widget> detailTiles() {
List<Widget> stockTiles() {
List<Widget> tiles = [
locationDescriptionCard(),
Divider(),
ListTile(
title: Text(
I18N.of(context).stockItems,
style: TextStyle(fontWeight: FontWeight.bold)
)
),
StockList(_items),
)
];
if (loading) {
tiles.add(progressIndicator());
} else if (_items.length > 0) {
tiles.add(StockList(_items));
} else {
tiles.add(ListTile(
title: Text("No Stock Items"),
subtitle: Text("No stock items available in this location")
));
}
return tiles;
}