maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult bottom(
    1. PageBlockVerticalAlignmentBottom value
    )?,
  2. TResult middle(
    1. PageBlockVerticalAlignmentMiddle value
    )?,
  3. TResult top(
    1. PageBlockVerticalAlignmentTop value
    )?,
  4. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(PageBlockVerticalAlignmentBottom value)? bottom,
  TResult Function(PageBlockVerticalAlignmentMiddle value)? middle,
  TResult Function(PageBlockVerticalAlignmentTop value)? top,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case PageBlockVerticalAlignmentBottom.constructor:
      if (bottom != null) {
        return bottom.call(this as PageBlockVerticalAlignmentBottom);
      }
      break;
    case PageBlockVerticalAlignmentMiddle.constructor:
      if (middle != null) {
        return middle.call(this as PageBlockVerticalAlignmentMiddle);
      }
      break;
    case PageBlockVerticalAlignmentTop.constructor:
      if (top != null) {
        return top.call(this as PageBlockVerticalAlignmentTop);
      }
      break;
  }
  return orElse.call();
}