3/25/1
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
class CarLocationModel {
|
||||
int id;
|
||||
int driverId;
|
||||
String id;
|
||||
String driverId;
|
||||
double latitude;
|
||||
double heading;
|
||||
double speed;
|
||||
double longitude;
|
||||
DateTime createdAt;
|
||||
DateTime updatedAt;
|
||||
@@ -11,6 +13,8 @@ class CarLocationModel {
|
||||
required this.driverId,
|
||||
required this.latitude,
|
||||
required this.longitude,
|
||||
required this.heading,
|
||||
required this.speed,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
});
|
||||
@@ -19,8 +23,10 @@ class CarLocationModel {
|
||||
return CarLocationModel(
|
||||
id: json['id'],
|
||||
driverId: json['driver_id'],
|
||||
latitude: json['latitude'],
|
||||
longitude: json['longitude'],
|
||||
latitude: double.parse(json['latitude'].toString()),
|
||||
longitude: double.parse(json['longitude'].toString()),
|
||||
heading: double.parse(json['heading'].toString()),
|
||||
speed: double.parse(json['speed'].toString()),
|
||||
createdAt: DateTime.parse(json['created_at']),
|
||||
updatedAt: DateTime.parse(json['updated_at']),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user