maybeWhen<T> method

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

Implementation

T maybeWhen<T>({
  T? Function()? rank,
  T? Function()? recent,
  required T Function() orElse,
}) =>
    {
      SearchOrder.rank: rank,
      SearchOrder.recent: recent,
    }[this]
        ?.call() ??
    orElse();