when<TResult extends Object?> method Null safety

  1. @optionalTypeArgs
TResult when<TResult extends Object?>(
  1. {required TResult linear(
    1. Alignment begin,
    2. Alignment end,
    3. List<Color> colors,
    4. List<double>? stops,
    5. TileMode tileMode,
    6. GradientTransform? transform
    ),
  2. required TResult radial(
    1. Alignment center,
    2. double radius,
    3. List<Color> colors,
    4. List<double>? stops,
    5. TileMode tileMode,
    6. Alignment? focal,
    7. double focalRadius,
    8. GradientTransform? transform
    ),
  3. required TResult sweep(
    1. Alignment center,
    2. double startAngle,
    3. double endAngle,
    4. List<Color> colors,
    5. List<double>? stops,
    6. TileMode tileMode,
    7. GradientTransform? transform
    )}
)
@optionalTypeArgs, inherited

Implementation

@optionalTypeArgs
TResult when<TResult extends Object?>({
  required TResult Function(
          Alignment begin,
          Alignment end,
          List<Color> colors,
          List<double>? stops,
          TileMode tileMode,
          GradientTransform? transform)
      linear,
  required TResult Function(
          Alignment center,
          double radius,
          List<Color> colors,
          List<double>? stops,
          TileMode tileMode,
          Alignment? focal,
          double focalRadius,
          GradientTransform? transform)
      radial,
  required TResult Function(
          Alignment center,
          double startAngle,
          double endAngle,
          List<Color> colors,
          List<double>? stops,
          TileMode tileMode,
          GradientTransform? transform)
      sweep,
}) =>
    throw _privateConstructorUsedError;