fromJson static method

LatLng? fromJson(
  1. Object? json
)

Initialize a LatLng from an [lat, lng] array.

Implementation

static LatLng? fromJson(Object? json) {
  if (json == null) {
    return null;
  }
  assert(json is List && json.length == 2);
  final list = json as List;
  return LatLng(list[0], list[1]);
}