add rate service

This commit is contained in:
Sai Naw Wun
2020-10-15 03:06:13 +06:30
parent 7b88658893
commit 47c07a6c88
45 changed files with 870 additions and 496 deletions

View File

@@ -1,6 +1,3 @@
import 'package:fcs/domain/entities/cargo.dart';
import 'package:fcs/domain/vo/delivery_address.dart';
List<Day> dayLists = [
Day(id: 1, name: 'Sun'),
Day(id: 2, name: 'Mon'),
@@ -26,32 +23,24 @@ class Setting {
final String termsEng;
final String termsMm;
String about;
double volumetricRatio;
List<String> shipmentTypes;
Map<String, int> cargoTypes;
List<Cargo> get cargoTypesList => cargoTypes.entries
.map((e) => Cargo(type: e.key, price: e.value))
.toList();
Cargo get defaultCargoType =>
cargoTypesList.firstWhere((e) => e.type == "General");
Setting(
{this.supportBuildNum,
this.usaAddress,
this.mmAddress,
this.usaContactNumber,
this.mmContactNumber,
this.emailAddress,
this.facebookLink,
this.inviteRequired,
this.appUrl,
this.termsEng,
this.termsMm,
this.about,
this.shipmentTypes,
this.volumetricRatio,
this.cargoTypes});
Setting({
this.supportBuildNum,
this.usaAddress,
this.mmAddress,
this.usaContactNumber,
this.mmContactNumber,
this.emailAddress,
this.facebookLink,
this.inviteRequired,
this.appUrl,
this.termsEng,
this.termsMm,
this.about,
this.shipmentTypes,
});
factory Setting.fromMap(Map<String, dynamic> map) {
return Setting(
@@ -67,11 +56,7 @@ class Setting {
about: map['about'],
termsEng: map['terms_eng'],
termsMm: map['terms_mm'],
volumetricRatio: map['volumetric_ratio'],
shipmentTypes: List.from(map['shipment_types']),
cargoTypes: map['cargo_types'] == null
? []
: Map<String, int>.from(map['cargo_types']),
);
}