update carton from packages

This commit is contained in:
2021-01-08 17:13:51 +06:30
parent f0662ff1d0
commit 32b8c5ae93
17 changed files with 321 additions and 371 deletions

View File

@@ -36,6 +36,7 @@ class RateDataProvider {
.collection(config_collection)
.document(rate_doc_id)
.collection(cargo_types_collection)
.where("custom_duty", isEqualTo: false)
.snapshots();
await for (var snaps in snapshots) {
@@ -48,18 +49,19 @@ class RateDataProvider {
}
}
Stream<List<CustomDuty>> _customDutiesStream() async* {
List<CustomDuty> customDuries = [];
Stream<List<CargoType>> _customDutiesStream() async* {
List<CargoType> customDuries = [];
Stream<QuerySnapshot> snapshots = Firestore.instance
.collection(config_collection)
.document(rate_doc_id)
.collection(custom_duties_collection)
.collection(cargo_types_collection)
.where("custom_duty", isEqualTo: true)
.snapshots();
await for (var snaps in snapshots) {
customDuries = [];
customDuries = snaps.documents.map((snap) {
return CustomDuty.fromMap(snap.data, snap.documentID);
return CargoType.fromMap(snap.data, snap.documentID);
}).toList();
yield customDuries;
}
@@ -84,7 +86,7 @@ class RateDataProvider {
StreamSubscription<Rate> rateListener;
StreamSubscription<List<CargoType>> cargoListener;
StreamSubscription<List<CustomDuty>> customListener;
StreamSubscription<List<CargoType>> customListener;
StreamSubscription<List<DiscountByWeight>> discountListener;
Stream<Rate> rate() {
Future<void> _start() async {