maybeWhen<T> method

T maybeWhen<T>({
  1. T? contentBody()?,
  2. T? contentName()?,
  3. T? contentTopic()?,
  4. required T orElse(),
})

Implementation

T maybeWhen<T>({
  T? Function()? contentBody,
  T? Function()? contentName,
  T? Function()? contentTopic,
  required T Function() orElse,
}) =>
    {
      KeyKind.contentBody: contentBody,
      KeyKind.contentName: contentName,
      KeyKind.contentTopic: contentTopic,
    }[this]
        ?.call() ??
    orElse();