maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult mobile(
- NetworkTypeMobile value
- TResult mobileRoaming(
- NetworkTypeMobileRoaming value
- TResult none(
- NetworkTypeNone value
- TResult other(
- NetworkTypeOther value
- TResult wiFi(
- NetworkTypeWiFi value
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(NetworkTypeMobile value)? mobile,
TResult Function(NetworkTypeMobileRoaming value)? mobileRoaming,
TResult Function(NetworkTypeNone value)? none,
TResult Function(NetworkTypeOther value)? other,
TResult Function(NetworkTypeWiFi value)? wiFi,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case NetworkTypeMobile.constructor:
if (mobile != null) {
return mobile.call(this as NetworkTypeMobile);
}
break;
case NetworkTypeMobileRoaming.constructor:
if (mobileRoaming != null) {
return mobileRoaming.call(this as NetworkTypeMobileRoaming);
}
break;
case NetworkTypeNone.constructor:
if (none != null) {
return none.call(this as NetworkTypeNone);
}
break;
case NetworkTypeOther.constructor:
if (other != null) {
return other.call(this as NetworkTypeOther);
}
break;
case NetworkTypeWiFi.constructor:
if (wiFi != null) {
return wiFi.call(this as NetworkTypeWiFi);
}
break;
}
return orElse.call();
}