fix errors

This commit is contained in:
Sai Naw Wun
2020-10-22 04:14:53 +06:30
parent 2021f74872
commit e5540c5491
32 changed files with 1069 additions and 811 deletions

View File

@@ -83,7 +83,7 @@ class FcsShipmentModel extends BaseModel {
}
Future<void> loadMore() async {
if (_shipped.ended && _selectedIndex == 1) return;
if (_shipped.ended || _selectedIndex == 1) return;
isLoading = true;
notifyListeners();
await _shipped.load(onFinished: () {
@@ -132,6 +132,24 @@ class FcsShipmentModel extends BaseModel {
return null;
}
Future<List<FcsShipment>> getInvoiceFcsShipments() async {
List<FcsShipment> fcsShipments = [];
try {
var snaps = await Firestore.instance
.collection("/$fcs_shipment_collection")
.where("pending_invoice_user_count", isGreaterThan: 0)
.getDocuments(source: Source.server);
fcsShipments = snaps.documents.map((documentSnapshot) {
var fcs = FcsShipment.fromMap(
documentSnapshot.data, documentSnapshot.documentID);
return fcs;
}).toList();
} catch (e) {
log.warning("Error!! $e");
}
return fcsShipments;
}
void initUser(user) {
super.initUser(user);
}