Location.fromJson constructor
Location.fromJson(
- Map<String, dynamic> data
)
Implementation
factory Location.fromJson(Map<String, dynamic> data) {
return Location(
latitude: double.parse("${data["latitude"]}"),
longitude: double.parse("${data["longitude"]}"),
altitude: double.parse("${data["altitude"]}"),
speed: double.parse("${data["speed"]}"),
accuracy: double.parse("${data["accuracy"]}"),
bearing: double.parse("${data["bearing"]}"),
speedometer: double.parse("${data["speedometer"]}"),
timestamp: int.parse("${data["timestamp"]}"),
isMock: bool.parse("${data["is_mock"]}"),
battery: int.parse("${data["battery"]}"));
}