maybeWhen<T> method

T maybeWhen<T>({
  1. T? offline()?,
  2. T? online()?,
  3. T? unavailable()?,
  4. 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();