2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Load stock detail *before* opening new view

This commit is contained in:
Oliver Walters 2021-02-07 09:43:16 +11:00
parent 12f4a4fa38
commit b18daf3acf

View File

@ -80,6 +80,14 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
refresh();
}
void _showStock(BuildContext context) async {
await part.getStockItems(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PartStockDetailWidget(part))
);
}
void _editPartDialog() {
// Values which can be edited
@ -209,10 +217,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
leading: FaIcon(FontAwesomeIcons.boxes),
trailing: Text("${part.inStock}"),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PartStockDetailWidget(part))
);
_showStock(context);
},
),
);