maybeWhen<T> method

T maybeWhen<T>({
  1. T? private()?,
  2. T? public()?,
  3. required T orElse(),
})

Implementation

T maybeWhen<T>({
  T? Function()? private,
  T? Function()? public,
  required T Function() orElse,
}) =>
    {
      Visibility.private: private,
      Visibility.public: public,
    }[this]
        ?.call() ??
    orElse();