when<TResult extends Object?> method Null safety

  1. @optionalTypeArgs
TResult when<TResult extends Object?>(
  1. {required TResult box(
    1. Color? color,
    2. DecorationImage? image,
    3. ShapeBorder? border,
    4. BorderRadius? borderRadius,
    5. List<BoxShadow>? boxShadow,
    6. Gradient? gradient,
    7. BlendMode? backgroundBlendMode,
    8. BoxShape shape
    ),
  2. required TResult shape(
    1. Color? color,
    2. DecorationImage? image,
    3. Gradient? gradient,
    4. List<BoxShadow>? shadows,
    5. ShapeBorder shape
    )}
)
@optionalTypeArgs, inherited

Implementation

@optionalTypeArgs
TResult when<TResult extends Object?>({
  required TResult Function(
          Color? color,
          DecorationImage? image,
          ShapeBorder? border,
          BorderRadius? borderRadius,
          List<BoxShadow>? boxShadow,
          Gradient? gradient,
          BlendMode? backgroundBlendMode,
          BoxShape shape)
      box,
  required TResult Function(Color? color, DecorationImage? image,
          Gradient? gradient, List<BoxShadow>? shadows, ShapeBorder shape)
      shape,
}) =>
    throw _privateConstructorUsedError;