when<TResult extends Object?> method Null safety

  1. @optionalTypeArgs
TResult when<TResult extends Object?>(
  1. {required TResult widget(
    1. Widget child,
    2. PlaceholderAlignment alignment,
    3. TextBaseline? baseline,
    4. TextStyle? style
    ),
  2. required TResult text(
    1. String? text,
    2. List<InlineSpan>? children,
    3. TextStyle? style,
    4. MouseCursor? mouseCursor,
    5. Callback? onTap,
    6. String? semanticsLabel,
    7. Locale? locale,
    8. bool? spellOut
    )}
)
@optionalTypeArgs, inherited

Implementation

@optionalTypeArgs
TResult when<TResult extends Object?>({
  required TResult Function(Widget child, PlaceholderAlignment alignment,
          TextBaseline? baseline, TextStyle? style)
      widget,
  required TResult Function(
          String? text,
          List<InlineSpan>? children,
          TextStyle? style,
          MouseCursor? mouseCursor,
          Callback? onTap,
          String? semanticsLabel,
          Locale? locale,
          bool? spellOut)
      text,
}) =>
    throw _privateConstructorUsedError;