diff --git a/lib/widget/stock_detail.dart b/lib/widget/stock_detail.dart index 9e70a3c0..d08b89cc 100644 --- a/lib/widget/stock_detail.dart +++ b/lib/widget/stock_detail.dart @@ -366,6 +366,33 @@ class _StockItemDisplayState extends RefreshableState { ) ); + // Location information + if ((item.locationId > 0) && (item.locationName != null) && (item.locationName.isNotEmpty)) { + tiles.add( + ListTile( + title: Text("Stock Location"), + subtitle: Text("${item.locationPathString}"), + leading: FaIcon(FontAwesomeIcons.mapMarkerAlt), + onTap: () { + if (item.locationId > 0) { + InvenTreeStockLocation().get(context, item.locationId).then((var loc) { + Navigator.push(context, MaterialPageRoute( + builder: (context) => LocationDisplayWidget(loc))); + }); + } + }, + ) + ); + } else { + tiles.add( + ListTile( + title: Text("Stock Location"), + leading: FaIcon(FontAwesomeIcons.mapMarkerAlt), + subtitle: Text("No location set"), + ) + ); + } + // Quantity information if (item.isSerialized()) { tiles.add( @@ -399,33 +426,6 @@ class _StockItemDisplayState extends RefreshableState { ) ); - // Location information - if ((item.locationId > 0) && (item.locationName != null) && (item.locationName.isNotEmpty)) { - tiles.add( - ListTile( - title: Text("Stock Location"), - subtitle: Text("${item.locationPathString}"), - leading: FaIcon(FontAwesomeIcons.mapMarkerAlt), - onTap: () { - if (item.locationId > 0) { - InvenTreeStockLocation().get(context, item.locationId).then((var loc) { - Navigator.push(context, MaterialPageRoute( - builder: (context) => LocationDisplayWidget(loc))); - }); - } - }, - ) - ); - } else { - tiles.add( - ListTile( - title: Text("Stock Location"), - leading: FaIcon(FontAwesomeIcons.mapMarkerAlt), - subtitle: Text("No location set"), - ) - ); - } - // Supplier part? if (item.supplierPartId > 0) { tiles.add(