From e53170ed7e5c08eebbfc878a842758cbc3be03c7 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 12 Feb 2021 22:58:52 +1100 Subject: [PATCH] Reload page after performing QR action(s) --- lib/l10n | 2 +- lib/widget/stock_detail.dart | 69 +++++------------------------------- 2 files changed, 10 insertions(+), 61 deletions(-) diff --git a/lib/l10n b/lib/l10n index fc412e03..47cab0e5 160000 --- a/lib/l10n +++ b/lib/l10n @@ -1 +1 @@ -Subproject commit fc412e0315c435efa43bbdc69a20e00ba35c8481 +Subproject commit 47cab0e55b09fc0bfe80ee841e2f8b653d18bb0a diff --git a/lib/widget/stock_detail.dart b/lib/widget/stock_detail.dart index 9f018626..ab871507 100644 --- a/lib/widget/stock_detail.dart +++ b/lib/widget/stock_detail.dart @@ -419,7 +419,7 @@ class _StockItemDisplayState extends RefreshableState { tiles.add( ListTile( - title: Text("Test Results"), + title: Text(I18N.of(context).testResults), leading: FaIcon(FontAwesomeIcons.tasks), trailing: Text("${item.testResultCount}"), onTap: () { @@ -508,14 +508,16 @@ class _StockItemDisplayState extends RefreshableState { // Scan item into a location tiles.add( ListTile( - title: Text("Scan Into Location"), + title: Text(I18N.of(context).scanIntoLocation), leading: FaIcon(FontAwesomeIcons.exchangeAlt), trailing: FaIcon(FontAwesomeIcons.qrcode), onTap: () { Navigator.push( context, MaterialPageRoute(builder: (context) => InvenTreeQRView(StockItemScanIntoLocationHandler(item))) - ); + ).then((context) { + refresh(); + }); }, ) ); @@ -524,14 +526,16 @@ class _StockItemDisplayState extends RefreshableState { if (item.uid.isEmpty) { tiles.add( ListTile( - title: Text("Assign Barcode"), + title: Text(I18N.of(context).assignBarcode), leading: FaIcon(FontAwesomeIcons.barcode), trailing: FaIcon(FontAwesomeIcons.qrcode), onTap: () { Navigator.push( context, MaterialPageRoute(builder: (context) => InvenTreeQRView(StockItemBarcodeAssignmentHandler(item))) - ); + ).then((context) { + refresh(); + }); } ) ); @@ -540,49 +544,6 @@ class _StockItemDisplayState extends RefreshableState { return tiles; } - /* - * Return a list of context-sensitive action buttons. - * Not all buttons will be avaialable for a given StockItem, - * depending on the properties of that StockItem - */ - - /* - List actionButtons() { - var buttons = List(); - - // The following actions only apply if the StockItem is not serialized - if (!item.isSerialized()) { - buttons.add(SpeedDialChild( - child: Icon(FontAwesomeIcons.plusCircle), - label: "Add Stock", - onTap: _addStockDialog, - ) - ); - - buttons.add(SpeedDialChild( - child: Icon(FontAwesomeIcons.minusCircle), - label: "Remove Stock", - onTap: _removeStockDialog, - ), - ); - - buttons.add(SpeedDialChild( - child: Icon(FontAwesomeIcons.checkCircle), - label: "Count Stock", - onTap: _countStockDialog, - )); - } - - buttons.add(SpeedDialChild( - child: Icon(FontAwesomeIcons.exchangeAlt), - label: "Transfer Stock", - onTap: _transferStockDialog, - )); - - return buttons; - } - */ - @override Widget getBottomNavBar(BuildContext context) { return BottomNavigationBar( @@ -626,16 +587,4 @@ class _StockItemDisplayState extends RefreshableState { Widget getBody(BuildContext context) { return getSelectedWidget(tabIndex); } - - /* - @override - Widget getFab(BuildContext context) { - return SpeedDial( - visible: true, - animatedIcon: AnimatedIcons.menu_close, - heroTag: 'stock-item-fab', - children: actionButtons(), - ); - } - */ } \ No newline at end of file