maybeWhen<TResult extends Object?> method Null safety

  1. @optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
  1. {TResult linear(
    1. Alignment begin,
    2. Alignment end,
    3. List<Color> colors,
    4. List<double>? stops,
    5. TileMode tileMode,
    6. GradientTransform? transform
    )?,
  2. 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. 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
    )?,
  4. required TResult orElse(
      )}
    )
    @optionalTypeArgs, inherited

    Implementation

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