2020-10-13 07:50:25 +06:30
|
|
|
import 'package:fcs/domain/entities/cargo.dart';
|
|
|
|
|
import 'package:fcs/domain/vo/delivery_address.dart';
|
|
|
|
|
|
2020-09-04 01:42:58 +06:30
|
|
|
List<Day> dayLists = [
|
|
|
|
|
Day(id: 1, name: 'Sun'),
|
|
|
|
|
Day(id: 2, name: 'Mon'),
|
|
|
|
|
Day(id: 3, name: 'Tue'),
|
|
|
|
|
Day(id: 4, name: 'Wed'),
|
|
|
|
|
Day(id: 5, name: 'Thu'),
|
|
|
|
|
Day(id: 6, name: 'Fri'),
|
|
|
|
|
Day(id: 7, name: 'Sat'),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
class Setting {
|
|
|
|
|
final int supportBuildNum;
|
2020-09-04 15:30:10 +06:30
|
|
|
|
|
|
|
|
// contact page
|
|
|
|
|
String usaAddress;
|
|
|
|
|
String mmAddress;
|
|
|
|
|
String usaContactNumber;
|
|
|
|
|
String mmContactNumber;
|
|
|
|
|
String emailAddress;
|
|
|
|
|
String facebookLink;
|
2020-09-13 21:49:39 +06:30
|
|
|
bool inviteRequired;
|
|
|
|
|
String appUrl;
|
2020-09-18 04:04:21 +06:30
|
|
|
final String termsEng;
|
|
|
|
|
final String termsMm;
|
2020-10-08 03:32:52 +06:30
|
|
|
String about;
|
2020-10-13 07:50:25 +06:30
|
|
|
double volumetricRatio;
|
2020-10-08 03:32:52 +06:30
|
|
|
|
|
|
|
|
List<String> shipmentTypes;
|
2020-10-13 07:50:25 +06:30
|
|
|
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");
|
2020-10-08 03:32:52 +06:30
|
|
|
|
2020-10-13 07:50:25 +06:30
|
|
|
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});
|
2020-09-04 01:42:58 +06:30
|
|
|
|
|
|
|
|
factory Setting.fromMap(Map<String, dynamic> map) {
|
|
|
|
|
return Setting(
|
2020-10-08 03:32:52 +06:30
|
|
|
supportBuildNum: map['support_build_number'],
|
|
|
|
|
inviteRequired: map['invite_required'],
|
|
|
|
|
appUrl: map['app_url'],
|
|
|
|
|
usaAddress: map['usa_address'],
|
|
|
|
|
mmAddress: map['mm_address'],
|
|
|
|
|
usaContactNumber: map['usa_contact_number'],
|
|
|
|
|
mmContactNumber: map['mm_contact_number'],
|
|
|
|
|
emailAddress: map['email_address'],
|
|
|
|
|
facebookLink: map['facebook_link'],
|
|
|
|
|
about: map['about'],
|
|
|
|
|
termsEng: map['terms_eng'],
|
|
|
|
|
termsMm: map['terms_mm'],
|
2020-10-13 07:50:25 +06:30
|
|
|
volumetricRatio: map['volumetric_ratio'],
|
2020-10-08 03:32:52 +06:30
|
|
|
shipmentTypes: List.from(map['shipment_types']),
|
2020-10-13 07:50:25 +06:30
|
|
|
cargoTypes: map['cargo_types'] == null
|
|
|
|
|
? []
|
|
|
|
|
: Map<String, int>.from(map['cargo_types']),
|
2020-10-08 03:32:52 +06:30
|
|
|
);
|
2020-09-04 01:42:58 +06:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toMap() {
|
|
|
|
|
return {
|
2020-09-18 04:04:21 +06:30
|
|
|
'terms_eng': termsEng,
|
|
|
|
|
'terms_mm': termsMm,
|
2020-09-04 01:42:58 +06:30
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() {
|
2020-10-08 03:32:52 +06:30
|
|
|
return 'Setting{supportBuildNum:$supportBuildNum,about:$about}';
|
2020-09-04 01:42:58 +06:30
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Day {
|
|
|
|
|
int id;
|
|
|
|
|
String name;
|
|
|
|
|
bool isChecked = false;
|
|
|
|
|
Day({this.id, this.name, this.isChecked});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() {
|
|
|
|
|
return 'Day{id:$id,name:$name,isChecked:$isChecked}';
|
|
|
|
|
}
|
|
|
|
|
}
|