105 lines
2.7 KiB
Dart
105 lines
2.7 KiB
Dart
|
|
|
|
class Destination {
|
|
String? name;
|
|
String? address;
|
|
String? phone;
|
|
String? email;
|
|
String? webcontents;
|
|
String? videos;
|
|
String? category;
|
|
int? series;
|
|
double? lat;
|
|
double? lon;
|
|
int? location_id;
|
|
int? list_order;
|
|
String? photos;
|
|
double? checkin_radious;
|
|
int? auto_checkin;
|
|
bool? selected = false;
|
|
bool? checkedin = false;
|
|
double? cp;
|
|
double? checkin_point;
|
|
double? buy_point;
|
|
|
|
Destination({
|
|
this.name,
|
|
this.address,
|
|
this.phone,
|
|
this.email,
|
|
this.webcontents,
|
|
this.videos,
|
|
this.category,
|
|
this.series,
|
|
this.lat,
|
|
this.lon,
|
|
this.location_id,
|
|
this.list_order,
|
|
this.photos,
|
|
this.checkin_radious,
|
|
this.auto_checkin,
|
|
this.selected,
|
|
this.checkedin,
|
|
this.cp,
|
|
this.checkin_point,
|
|
this.buy_point
|
|
});
|
|
|
|
factory Destination.fromMap(Map<String, dynamic> json) {
|
|
|
|
bool selec = json['selected'] == 0 ? false : true;
|
|
bool checkin = json['checkedin'] == 0 ? false : true;
|
|
|
|
return Destination(
|
|
name: json['name'],
|
|
address: json['address'],
|
|
phone: json['phone'],
|
|
email: json['email'],
|
|
webcontents: json['webcontents'],
|
|
videos: json['videos'],
|
|
category: json['category'],
|
|
series: json['series'],
|
|
lat: json['lat'],
|
|
lon: json['lon'],
|
|
location_id: json['location_id'],
|
|
list_order: json['list_order'],
|
|
photos: json['photos'],
|
|
checkin_radious: json['checkin_radious'],
|
|
auto_checkin:json['auto_checkin'],
|
|
selected: selec,
|
|
checkedin: checkin,
|
|
cp: json['cp'],
|
|
checkin_point: json['checkin_point'],
|
|
buy_point: json['buy_point']
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toMap(){
|
|
int sel = selected == false ? 0 : 1;
|
|
int check = checkedin == false ? 0 : 1;
|
|
return {
|
|
'name':name,
|
|
'address': address,
|
|
'phone': phone,
|
|
'email': email,
|
|
'webcontents': webcontents,
|
|
'videos': videos,
|
|
'category':category,
|
|
'series':series,
|
|
'lat':lat,
|
|
'lon':lon,
|
|
'location_id':location_id,
|
|
'list_order':list_order,
|
|
'photos':photos,
|
|
'checkin_radious': checkin_radious,
|
|
'auto_checkin': auto_checkin,
|
|
'selected': sel,
|
|
'checkedin': check,
|
|
'cp' : cp,
|
|
'checkin_point' : checkin_point,
|
|
'buy_point' : buy_point
|
|
};
|
|
}
|
|
|
|
|
|
} |