fromMap static method

Location? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static Location? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var latitude = _map['latitude']! as double;
  var longitude = _map['longitude']! as double;
  var horizontal_accuracy = _map['horizontal_accuracy']! as double;
  return Location(
    extra: extra,
    clientId: clientId,
    latitude: latitude,
    longitude: longitude,
    horizontal_accuracy: horizontal_accuracy,
  );
}