大幅変更&環境バージョンアップ
This commit is contained in:
47
lib/model/gps_data.dart
Normal file
47
lib/model/gps_data.dart
Normal file
@ -0,0 +1,47 @@
|
||||
class GpsData {
|
||||
int id;
|
||||
String team_name;
|
||||
String event_code;
|
||||
double lat;
|
||||
double lon;
|
||||
int is_checkin;
|
||||
int created_at;
|
||||
int is_synced;
|
||||
|
||||
GpsData({
|
||||
required this.id,
|
||||
required this.team_name,
|
||||
required this.event_code,
|
||||
required this.lat,
|
||||
required this.lon,
|
||||
required this.created_at,
|
||||
this.is_checkin = 0,
|
||||
this.is_synced = 0,
|
||||
});
|
||||
|
||||
factory GpsData.fromMap(Map<String, dynamic> json) {
|
||||
return GpsData(
|
||||
id: json["id"],
|
||||
team_name: json["team_name"],
|
||||
event_code: json["event_code"],
|
||||
lat: json["lat"],
|
||||
lon: json["lon"],
|
||||
is_checkin: json["is_checkin"],
|
||||
created_at: json["created_at"],
|
||||
is_synced: json["is_synced"] ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
'team_name': team_name,
|
||||
'event_code': event_code,
|
||||
'lat': lat,
|
||||
'lon': lon,
|
||||
'is_checkin': is_checkin,
|
||||
'created_at': created_at,
|
||||
'is_synced': is_synced,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user