maybeWhen<T> method

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

Implementation

T maybeWhen<T>({
  T? Function()? b,
  T? Function()? f,
  required T Function() orElse,
}) =>
    {
      Direction.b: b,
      Direction.f: f,
    }[this]
        ?.call() ??
    orElse();