when method
void
when({
- required void onWait(
- MasstransitWait value
- required void onFitness(
- MasstransitFitness value
- required void onTransfer(
- MasstransitTransfer value
- required void onTaxi(
- MasstransitTaxi value
- required void onVectorMasstransitTransport(
- List<
MasstransitTransport> value
- List<
Applies the passed function to the variant value.
Implementation
void when({
required void Function(MasstransitWait value) onWait,
required void Function(MasstransitFitness value) onFitness,
required void Function(MasstransitTransfer value) onTransfer,
required void Function(MasstransitTaxi value) onTaxi,
required void Function(
core.List<transport_masstransit_transport.MasstransitTransport>
value)
onVectorMasstransitTransport,
}) {
if (_value is MasstransitWait) {
return onWait(_value as MasstransitWait);
}
if (_value is MasstransitFitness) {
return onFitness(_value as MasstransitFitness);
}
if (_value is MasstransitTransfer) {
return onTransfer(_value as MasstransitTransfer);
}
if (_value is MasstransitTaxi) {
return onTaxi(_value as MasstransitTaxi);
}
if (_value
is core.List<transport_masstransit_transport.MasstransitTransport>) {
return onVectorMasstransitTransport(_value
as core.List<transport_masstransit_transport.MasstransitTransport>);
}
assert(false);
}