maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult connecting()?,
- TResult connectingToProxy()?,
- TResult ready(
- ConnectionStateReady value
- TResult updating(
- ConnectionStateUpdating value
- TResult waitingForNetwork()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(ConnectionStateConnecting value)? connecting,
TResult Function(ConnectionStateConnectingToProxy value)? connectingToProxy,
TResult Function(ConnectionStateReady value)? ready,
TResult Function(ConnectionStateUpdating value)? updating,
TResult Function(ConnectionStateWaitingForNetwork value)? waitingForNetwork,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case ConnectionStateConnecting.constructor:
if (connecting != null) {
return connecting.call(this as ConnectionStateConnecting);
}
break;
case ConnectionStateConnectingToProxy.constructor:
if (connectingToProxy != null) {
return connectingToProxy.call(
this as ConnectionStateConnectingToProxy,
);
}
break;
case ConnectionStateReady.constructor:
if (ready != null) {
return ready.call(this as ConnectionStateReady);
}
break;
case ConnectionStateUpdating.constructor:
if (updating != null) {
return updating.call(this as ConnectionStateUpdating);
}
break;
case ConnectionStateWaitingForNetwork.constructor:
if (waitingForNetwork != null) {
return waitingForNetwork.call(
this as ConnectionStateWaitingForNetwork,
);
}
break;
}
return orElse.call();
}