class GeoPosition { final double latitude; final double longitude; final double altitude; final double speed; /* * Class for the geographical position element needed for tracking the bird */ GeoPosition({ required this.latitude, required this.longitude, required this.altitude, this.speed = 0.0, }); factory GeoPosition.fromJson(Map json) { return GeoPosition( latitude: json['latitude'], longitude: json['longitude'], altitude: json['altitude'], speed: json['speed'], ); } Map toJson() { return { 'latitude': latitude, 'longitude': longitude, 'altitude': altitude, 'speed': speed, }; } }