fromList method Null safety

  1. @visibleForTesting
LatLngBounds? fromList(
  1. Object? json
)

Converts a list to LatLngBounds.

Implementation

@visibleForTesting
static LatLngBounds? fromList(Object? json) {
  if (json == null) {
    return null;
  }
  assert(json is List && json.length == 2);
  final list = json as List;
  return LatLngBounds(
    southwest: LatLng.fromJson(list[0])!,
    northeast: LatLng.fromJson(list[1])!,
  );
}