when method
void
when({
- required void onDirectionSignToponym(),
- required void onDirectionSignRoad(
- DrivingDirectionSignRoad value
- required void onDirectionSignExit(
- DrivingDirectionSignExit value
- required void onDirectionSignIcon(
- DrivingDirectionSignIcon value
Applies the passed function to the variant value.
Implementation
void when({
required void Function(DrivingDirectionSignToponym value)
onDirectionSignToponym,
required void Function(DrivingDirectionSignRoad value) onDirectionSignRoad,
required void Function(DrivingDirectionSignExit value) onDirectionSignExit,
required void Function(DrivingDirectionSignIcon value) onDirectionSignIcon,
}) {
if (_value is DrivingDirectionSignToponym) {
return onDirectionSignToponym(_value as DrivingDirectionSignToponym);
}
if (_value is DrivingDirectionSignRoad) {
return onDirectionSignRoad(_value as DrivingDirectionSignRoad);
}
if (_value is DrivingDirectionSignExit) {
return onDirectionSignExit(_value as DrivingDirectionSignExit);
}
if (_value is DrivingDirectionSignIcon) {
return onDirectionSignIcon(_value as DrivingDirectionSignIcon);
}
assert(false);
}