Primera app funcional
This commit is contained in:
39
lib/models/route_model.dart
Normal file
39
lib/models/route_model.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
class RoutePosition {
|
||||
final int positionId;
|
||||
final double lat;
|
||||
final double lng;
|
||||
final int speed;
|
||||
final String timestamp;
|
||||
|
||||
RoutePosition({required this.positionId, required this.lat,
|
||||
required this.lng, required this.speed, required this.timestamp});
|
||||
|
||||
LatLng get latLng => LatLng(lat, lng);
|
||||
}
|
||||
|
||||
class RouteModel {
|
||||
final String routeId;
|
||||
final String name;
|
||||
final int truckId;
|
||||
String status;
|
||||
final List<RoutePosition> positions;
|
||||
final String turno; // MATUTINO | VESPERTINO | NOCTURNO
|
||||
|
||||
RouteModel({required this.routeId, required this.name,
|
||||
required this.truckId, required this.status,
|
||||
required this.positions, this.turno = 'MATUTINO'});
|
||||
|
||||
List<LatLng> get polylinePoints =>
|
||||
positions.map((p) => LatLng(p.lat, p.lng)).toList();
|
||||
}
|
||||
|
||||
class ColonyModel {
|
||||
final String colonia;
|
||||
final String routeId;
|
||||
final String horarioEstimado;
|
||||
|
||||
ColonyModel({required this.colonia, required this.routeId,
|
||||
required this.horarioEstimado});
|
||||
}
|
||||
Reference in New Issue
Block a user