LocationData.fromJson constructor

LocationData.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory LocationData.fromJson(Map<String, dynamic> json) {
  return LocationData(
    latitude: json['latitude']?.toDouble() ?? 0.0,
    longitude: json['longitude']?.toDouble() ?? 0.0,
    accuracy: json['accuracy']?.toDouble(),
    altitude: json['altitude']?.toDouble(),
    speed: json['speed']?.toDouble(),
    bearing: json['bearing']?.toDouble(),
    provider: json['provider'],
  );
}