nullableFromJson static method

LatLngBounds? nullableFromJson(
  1. dynamic value
)

Implementation

static LatLngBounds? nullableFromJson(dynamic value) {
  if (value is String && value.isNotEmpty) {
    final list = value.split(";");
    final southWestList = list[0].split(",");
    final northEastList = list[1].split(",");
    final west = double.parse(southWestList[0]);
    final south = double.parse(southWestList[1]);
    final east = double.parse(northEastList[0]);
    final north = double.parse(northEastList[1]);
    return LatLngBounds(southWest: LatLng(south, west), northEast: LatLng(north, east));
  }
  return null;
}