From e4fbf8bd20828c5bfd238b021c04900ed250dea7 Mon Sep 17 00:00:00 2001 From: Sai Naw Wun Date: Fri, 16 Oct 2020 11:05:38 +0630 Subject: [PATCH] add paginator --- lib/pages/fcs_shipment/fcs_shipment_list.dart | 1 + lib/pages/fcs_shipment/model/fcs_shipment_model.dart | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/pages/fcs_shipment/fcs_shipment_list.dart b/lib/pages/fcs_shipment/fcs_shipment_list.dart index 8516043..8acd33d 100644 --- a/lib/pages/fcs_shipment/fcs_shipment_list.dart +++ b/lib/pages/fcs_shipment/fcs_shipment_list.dart @@ -29,6 +29,7 @@ class _FcsShipmentListState extends State { Provider.of(context, listen: false).loadMore(); } }); + Provider.of(context, listen: false).initData(); } @override diff --git a/lib/pages/fcs_shipment/model/fcs_shipment_model.dart b/lib/pages/fcs_shipment/model/fcs_shipment_model.dart index dd1d8ec..bc45964 100644 --- a/lib/pages/fcs_shipment/model/fcs_shipment_model.dart +++ b/lib/pages/fcs_shipment/model/fcs_shipment_model.dart @@ -36,6 +36,14 @@ class FcsShipmentModel extends BaseModel { _delivered = _getDelivered(); } + initData() { + _selectedIndex = 1; + _loadFcsShipments(); + + if (_delivered != null) _delivered.close(); + _delivered = _getDelivered(); + } + Future _loadFcsShipments() async { if (user == null || !user.hasFcsShipments()) return; String path = "/$fcs_shipment_collection/";