update carton from packages
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user