import 'codable.dart';

class TraceLocation implements Codable {
  double? latitude;

  double? longitude;

  int? time;

  double? bearing;

  double? speed;

  TraceLocation(
      {this.latitude, this.longitude, this.time, this.bearing, this.speed});

  @override
  Map<String, dynamic> toJson() {
    return {
      'latitude': latitude,
      'longitude': longitude,
      'time': time,
      'bearing': bearing,
      'speed': speed,
    };
  }

  factory TraceLocation.fromJson(Map<String, dynamic> map) {
    return TraceLocation(
      latitude: map['latitude'],
      longitude: map['longitude'],
      time: map['time'],
      bearing: map['bearing'],
      speed: map['speed'],
    );
  }
}
