diff --git a/lib/pages/fcs_shipment/model/fcs_shipment_model.dart b/lib/pages/fcs_shipment/model/fcs_shipment_model.dart index 7ee76d8..351d73e 100644 --- a/lib/pages/fcs_shipment/model/fcs_shipment_model.dart +++ b/lib/pages/fcs_shipment/model/fcs_shipment_model.dart @@ -15,9 +15,9 @@ class FcsShipmentModel extends BaseModel { List _fcsShipments = []; List get fcsShipments => _selectedIndex == 1 ? _fcsShipments - : List.from(_shipped.values); + : List.from(_shipped!.values); - late Paginator _shipped; + Paginator? _shipped; bool isLoading = false; int _selectedIndex = 1; set selectedIndex(int index) { @@ -37,9 +37,9 @@ class FcsShipmentModel extends BaseModel { _selectedIndex = 1; _loadFcsShipments(); - if (_shipped != null) _shipped.close(); + if (_shipped != null) _shipped!.close(); _shipped = _getShipped(); - _shipped.load(); + _shipped!.load(); } Future _loadFcsShipments() async { @@ -84,10 +84,10 @@ class FcsShipmentModel extends BaseModel { } Future loadMore() async { - if (_shipped.ended || _selectedIndex == 1) return; + if (_shipped!.ended || _selectedIndex == 1) return; isLoading = true; notifyListeners(); - await _shipped.load(onFinished: () { + await _shipped!.load(onFinished: () { isLoading = false; notifyListeners(); }); @@ -95,7 +95,7 @@ class FcsShipmentModel extends BaseModel { Future refresh() async { if (_selectedIndex == 1) return; - await _shipped.refresh(onFinished: () { + await _shipped!.refresh(onFinished: () { notifyListeners(); }); } @@ -158,7 +158,7 @@ class FcsShipmentModel extends BaseModel { @override logout() async { if (listener != null) await listener!.cancel(); - if (_shipped != null) _shipped.close(); + if (_shipped != null) _shipped!.close(); _fcsShipments = []; }