2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 13:36:50 +00:00

Add 'pull to refresh' for StockItem detail view

This commit is contained in:
Oliver Walters 2020-04-10 00:29:36 +10:00
parent 36a7bd1214
commit 87d400415c

View File

@ -42,6 +42,15 @@ class _StockItemDisplayState extends State<StockDetailWidget> {
final InvenTreeStockItem item;
/**
* Function to reload the page data
*/
Future<void> _refresh() async {
await item.reload();
setState(() {});
}
void _editStockItem() {
// TODO - Form for editing stock item
}
@ -478,8 +487,11 @@ class _StockItemDisplayState extends State<StockDetailWidget> {
children: actionButtons(),
),
body: Center(
child: ListView(
children: stockTiles(),
child: new RefreshIndicator(
onRefresh: _refresh,
child: ListView(
children: stockTiles(),
)
)
)
);