This commit is contained in:
Hamza-Ayed
2024-03-25 17:15:13 +03:00
parent 5c702e7d06
commit 0f79b2d86b
20 changed files with 327 additions and 179 deletions

View File

@@ -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']),
);