maybeWhen<T> method
T
maybeWhen<T>({
- T? offline()?,
- T? online()?,
- required T orElse(),
Implementation
T maybeWhen<T>({
T? Function()? offline,
T? Function()? online,
T? Function()? unavailable,
required T Function() orElse,
}) =>
{
PresenceType.offline: offline,
PresenceType.online: online,
PresenceType.unavailable: unavailable,
}[this]
?.call() ??
orElse();