LocationData.fromMap constructor

LocationData.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory LocationData.fromMap(Map<String, dynamic> map) {
  return LocationData(
    latitude: map['latitude']?.toDouble() ?? 0.0,
    longitude: map['longitude']?.toDouble() ?? 0.0,
    accuracy: map['accuracy']?.toDouble(),
    altitude: map['altitude']?.toDouble(),
    speed: map['speed']?.toDouble(),
    heading: map['heading']?.toDouble(),
    timestamp: DateTime.fromMillisecondsSinceEpoch(map['timestamp']),
    provider: map['provider'],
  );
}