2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-05-01 15:06:49 +00:00

Rearranged stock item detail page

This commit is contained in:
Oliver Walters 2021-01-21 20:33:36 +11:00
parent 26cdb760eb
commit 65a01ff98c

View File

@ -366,6 +366,33 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
)
);
// 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<StockDetailWidget> {
)
);
// 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(