From 36a7bd1214c7cdb22dd0414a7d8484834baa2420 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 10 Apr 2020 00:21:43 +1000 Subject: [PATCH] Add framework for edit StockItem dialog --- lib/widget/stock_detail.dart | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/widget/stock_detail.dart b/lib/widget/stock_detail.dart index 54cf2927..0c03c407 100644 --- a/lib/widget/stock_detail.dart +++ b/lib/widget/stock_detail.dart @@ -34,6 +34,7 @@ class _StockItemDisplayState extends State { final _removeStockKey = GlobalKey(); final _countStockKey = GlobalKey(); final _moveStockKey = GlobalKey(); + final _editStockKey = GlobalKey(); _StockItemDisplayState(this.item) { // TODO @@ -45,7 +46,32 @@ class _StockItemDisplayState extends State { // TODO - Form for editing stock item } - void _addStock(double quantity) async { + void _editStockItemDialog() { + + return; + // TODO - Finish implementing this + + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: Text("Edit Stock Item"), + actions: [ + FlatButton( + child: Text("Save"), + onPressed: () { + if (_editStockKey.currentState.validate()) { + // TODO + } + }, + ) + ], + ); + } + ); + } + + void _addStock() async { Navigator.of(context).pop();