when method

void when({
  1. required void onGeoObject(
    1. GeoObject value
    ),
  2. required void onGeoObjectCollection(
    1. GeoObjectCollection value
    ),
})

Applies the passed function to the variant value.

Implementation

void when({
  required void Function(mapkit_geo_object.GeoObject value) onGeoObject,
  required void Function(GeoObjectCollection value) onGeoObjectCollection,
}) {
  if (_value is mapkit_geo_object.GeoObject) {
    return onGeoObject(_value as mapkit_geo_object.GeoObject);
  }
  if (_value is GeoObjectCollection) {
    return onGeoObjectCollection(_value as GeoObjectCollection);
  }
  assert(false);
}