2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 02:35:27 +00:00

Bug fix and refactoring

- Display difference between "in stock" and "unallocated stock"
- Refactor to use single function in detail and list widgets
This commit is contained in:
Oliver Walters
2022-04-18 21:49:10 +10:00
parent 8d255885cf
commit 84edaef10a
3 changed files with 31 additions and 16 deletions

View File

@ -204,24 +204,24 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
);
} else {
tiles.add(
ListTile(
title: Text(L10().partCategory),
subtitle: Text(L10().partCategoryTopLevel),
leading: FaIcon(FontAwesomeIcons.sitemap, color: COLOR_CLICK),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => CategoryDisplayWidget(null)));
},
)
ListTile(
title: Text(L10().partCategory),
subtitle: Text(L10().partCategoryTopLevel),
leading: FaIcon(FontAwesomeIcons.sitemap, color: COLOR_CLICK),
onTap: () {
Navigator.push(context, MaterialPageRoute(
builder: (context) => CategoryDisplayWidget(null)));
},
)
);
}
// Stock information
tiles.add(
ListTile(
title: Text(L10().availableStock),
subtitle: Text(L10().stockDetails),
leading: FaIcon(FontAwesomeIcons.boxes, color: COLOR_CLICK),
trailing: Text(part.availableStockString),
trailing: Text(part.stockString()),
onTap: () {
setState(() {
tabIndex = 1;