Unverified Commit fe9a2c54 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Remove 'must not be null' comments from painting and rendering libraries. (#134993)

## Description

This removes all of the comments that are of the form "so-and-so (must not be null|can ?not be null|must be non-null)" from the cases where those values are defines as non-nullable values.

This PR removes them from the painting and rendering libraries.

This was done by hand, since it really didn't lend itself to scripting, so it needs to be more than just spot-checked, I think. I was careful to leave any comment that referred to parameters that were nullable, but I may have missed some.

In addition to being no longer relevant after null safety has been made the default, these comments were largely fragile, in that it was easy for them to get out of date, and not be accurate anymore anyhow.

This did create a number of constructor comments which basically say "Creates a [Foo].", but I don't really know how to avoid that in a large scale change, since there's not much you can really say in a lot of cases.  I think we might consider some leniency for constructors to the "Comment must be meaningful" style guidance (which we de facto have already, since there are a bunch of these).

## Related PRs
- https://github.com/flutter/flutter/pull/134984
- https://github.com/flutter/flutter/pull/134991
- https://github.com/flutter/flutter/pull/134992
- https://github.com/flutter/flutter/pull/134994

## Tests
 - Documentation only change.
parent 14b832aa
...@@ -20,8 +20,6 @@ typedef _SimpleDecoderCallback = Future<ui.Codec> Function(ui.ImmutableBuffer bu ...@@ -20,8 +20,6 @@ typedef _SimpleDecoderCallback = Future<ui.Codec> Function(ui.ImmutableBuffer bu
@immutable @immutable
class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkImage> implements image_provider.NetworkImage { class NetworkImage extends image_provider.ImageProvider<image_provider.NetworkImage> implements image_provider.NetworkImage {
/// Creates an object that fetches the image at the given URL. /// Creates an object that fetches the image at the given URL.
///
/// The arguments [url] and [scale] must not be null.
const NetworkImage(this.url, { this.scale = 1.0, this.headers }); const NetworkImage(this.url, { this.scale = 1.0, this.headers });
@override @override
......
...@@ -40,8 +40,6 @@ class NetworkImage ...@@ -40,8 +40,6 @@ class NetworkImage
extends image_provider.ImageProvider<image_provider.NetworkImage> extends image_provider.ImageProvider<image_provider.NetworkImage>
implements image_provider.NetworkImage { implements image_provider.NetworkImage {
/// Creates an object that fetches the image at the given URL. /// Creates an object that fetches the image at the given URL.
///
/// The arguments [url] and [scale] must not be null.
const NetworkImage(this.url, {this.scale = 1.0, this.headers}); const NetworkImage(this.url, {this.scale = 1.0, this.headers});
@override @override
......
...@@ -185,8 +185,6 @@ abstract class AlignmentGeometry { ...@@ -185,8 +185,6 @@ abstract class AlignmentGeometry {
/// whether the horizontal direction depends on the [TextDirection]. /// whether the horizontal direction depends on the [TextDirection].
class Alignment extends AlignmentGeometry { class Alignment extends AlignmentGeometry {
/// Creates an alignment. /// Creates an alignment.
///
/// The [x] and [y] arguments must not be null.
const Alignment(this.x, this.y); const Alignment(this.x, this.y);
/// The distance fraction in the horizontal direction. /// The distance fraction in the horizontal direction.
...@@ -401,8 +399,6 @@ class Alignment extends AlignmentGeometry { ...@@ -401,8 +399,6 @@ class Alignment extends AlignmentGeometry {
/// whose horizontal component does not depend on the text direction). /// whose horizontal component does not depend on the text direction).
class AlignmentDirectional extends AlignmentGeometry { class AlignmentDirectional extends AlignmentGeometry {
/// Creates a directional alignment. /// Creates a directional alignment.
///
/// The [start] and [y] arguments must not be null.
const AlignmentDirectional(this.start, this.y); const AlignmentDirectional(this.start, this.y);
/// The distance fraction in the horizontal direction. /// The distance fraction in the horizontal direction.
......
...@@ -20,8 +20,6 @@ import 'borders.dart'; ...@@ -20,8 +20,6 @@ import 'borders.dart';
class BeveledRectangleBorder extends OutlinedBorder { class BeveledRectangleBorder extends OutlinedBorder {
/// Creates a border like a [RoundedRectangleBorder] except that the corners /// Creates a border like a [RoundedRectangleBorder] except that the corners
/// are joined by straight lines instead of arcs. /// are joined by straight lines instead of arcs.
///
/// The arguments must not be null.
const BeveledRectangleBorder({ const BeveledRectangleBorder({
super.side, super.side,
this.borderRadius = BorderRadius.zero, this.borderRadius = BorderRadius.zero,
......
...@@ -77,8 +77,6 @@ class BorderSide with Diagnosticable { ...@@ -77,8 +77,6 @@ class BorderSide with Diagnosticable {
/// If one of the sides is zero-width with [BorderStyle.none], then the other /// If one of the sides is zero-width with [BorderStyle.none], then the other
/// side is return as-is. If both of the sides are zero-width with /// side is return as-is. If both of the sides are zero-width with
/// [BorderStyle.none], then [BorderSide.none] is returned. /// [BorderStyle.none], then [BorderSide.none] is returned.
///
/// The arguments must not be null.
static BorderSide merge(BorderSide a, BorderSide b) { static BorderSide merge(BorderSide a, BorderSide b) {
assert(canMerge(a, b)); assert(canMerge(a, b));
final bool aIsNone = a.style == BorderStyle.none && a.width == 0.0; final bool aIsNone = a.style == BorderStyle.none && a.width == 0.0;
...@@ -243,8 +241,6 @@ class BorderSide with Diagnosticable { ...@@ -243,8 +241,6 @@ class BorderSide with Diagnosticable {
/// ///
/// Two sides can be merged if one or both are zero-width with /// Two sides can be merged if one or both are zero-width with
/// [BorderStyle.none], or if they both have the same color and style. /// [BorderStyle.none], or if they both have the same color and style.
///
/// The arguments must not be null.
static bool canMerge(BorderSide a, BorderSide b) { static bool canMerge(BorderSide a, BorderSide b) {
if ((a.style == BorderStyle.none && a.width == 0.0) || if ((a.style == BorderStyle.none && a.width == 0.0) ||
(b.style == BorderStyle.none && b.width == 0.0)) { (b.style == BorderStyle.none && b.width == 0.0)) {
...@@ -256,8 +252,6 @@ class BorderSide with Diagnosticable { ...@@ -256,8 +252,6 @@ class BorderSide with Diagnosticable {
/// Linearly interpolate between two border sides. /// Linearly interpolate between two border sides.
/// ///
/// The arguments must not be null.
///
/// {@macro dart.ui.shadow.lerp} /// {@macro dart.ui.shadow.lerp}
static BorderSide lerp(BorderSide a, BorderSide b, double t) { static BorderSide lerp(BorderSide a, BorderSide b, double t) {
if (identical(a, b)) { if (identical(a, b)) {
...@@ -665,8 +659,6 @@ abstract class ShapeBorder { ...@@ -665,8 +659,6 @@ abstract class ShapeBorder {
abstract class OutlinedBorder extends ShapeBorder { abstract class OutlinedBorder extends ShapeBorder {
/// Abstract const constructor. This constructor enables subclasses to provide /// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions. /// const constructors so that they can be used in const expressions.
///
/// The value of [side] must not be null.
const OutlinedBorder({ this.side = BorderSide.none }); const OutlinedBorder({ this.side = BorderSide.none });
@override @override
...@@ -884,8 +876,6 @@ class _CompoundBorder extends ShapeBorder { ...@@ -884,8 +876,6 @@ class _CompoundBorder extends ShapeBorder {
/// borders (where all the borders have the same configuration); to render a /// borders (where all the borders have the same configuration); to render a
/// uniform border, consider using [Canvas.drawRect] directly. /// uniform border, consider using [Canvas.drawRect] directly.
/// ///
/// The arguments must not be null.
///
/// See also: /// See also:
/// ///
/// * [paintImage], which paints an image in a rectangle on a canvas. /// * [paintImage], which paints an image in a rectangle on a canvas.
......
...@@ -387,8 +387,6 @@ class Border extends BoxBorder { ...@@ -387,8 +387,6 @@ class Border extends BoxBorder {
/// Creates a border. /// Creates a border.
/// ///
/// All the sides of the border default to [BorderSide.none]. /// All the sides of the border default to [BorderSide.none].
///
/// The arguments must not be null.
const Border({ const Border({
this.top = BorderSide.none, this.top = BorderSide.none,
this.right = BorderSide.none, this.right = BorderSide.none,
...@@ -397,8 +395,6 @@ class Border extends BoxBorder { ...@@ -397,8 +395,6 @@ class Border extends BoxBorder {
}); });
/// Creates a border whose sides are all the same. /// Creates a border whose sides are all the same.
///
/// The `side` argument must not be null.
const Border.fromBorderSide(BorderSide side) const Border.fromBorderSide(BorderSide side)
: top = side, : top = side,
right = side, right = side,
...@@ -410,7 +406,7 @@ class Border extends BoxBorder { ...@@ -410,7 +406,7 @@ class Border extends BoxBorder {
/// The `vertical` argument applies to the [left] and [right] sides, and the /// The `vertical` argument applies to the [left] and [right] sides, and the
/// `horizontal` argument applies to the [top] and [bottom] sides. /// `horizontal` argument applies to the [top] and [bottom] sides.
/// ///
/// All arguments default to [BorderSide.none] and must not be null. /// All arguments default to [BorderSide.none].
const Border.symmetric({ const Border.symmetric({
BorderSide vertical = BorderSide.none, BorderSide vertical = BorderSide.none,
BorderSide horizontal = BorderSide.none, BorderSide horizontal = BorderSide.none,
...@@ -437,8 +433,6 @@ class Border extends BoxBorder { ...@@ -437,8 +433,6 @@ class Border extends BoxBorder {
/// ///
/// It is only valid to call this if [BorderSide.canMerge] returns true for /// It is only valid to call this if [BorderSide.canMerge] returns true for
/// the pairwise combination of each side on both [Border]s. /// the pairwise combination of each side on both [Border]s.
///
/// The arguments must not be null.
static Border merge(Border a, Border b) { static Border merge(Border a, Border b) {
assert(BorderSide.canMerge(a.top, b.top)); assert(BorderSide.canMerge(a.top, b.top));
assert(BorderSide.canMerge(a.right, b.right)); assert(BorderSide.canMerge(a.right, b.right));
...@@ -761,8 +755,6 @@ class BorderDirectional extends BoxBorder { ...@@ -761,8 +755,6 @@ class BorderDirectional extends BoxBorder {
/// the trailing edge. They are resolved during [paint]. /// the trailing edge. They are resolved during [paint].
/// ///
/// All the sides of the border default to [BorderSide.none]. /// All the sides of the border default to [BorderSide.none].
///
/// The arguments must not be null.
const BorderDirectional({ const BorderDirectional({
this.top = BorderSide.none, this.top = BorderSide.none,
this.start = BorderSide.none, this.start = BorderSide.none,
...@@ -775,8 +767,6 @@ class BorderDirectional extends BoxBorder { ...@@ -775,8 +767,6 @@ class BorderDirectional extends BoxBorder {
/// ///
/// It is only valid to call this if [BorderSide.canMerge] returns true for /// It is only valid to call this if [BorderSide.canMerge] returns true for
/// the pairwise combination of each side on both [BorderDirectional]s. /// the pairwise combination of each side on both [BorderDirectional]s.
///
/// The arguments must not be null.
static BorderDirectional merge(BorderDirectional a, BorderDirectional b) { static BorderDirectional merge(BorderDirectional a, BorderDirectional b) {
assert(BorderSide.canMerge(a.top, b.top)); assert(BorderSide.canMerge(a.top, b.top));
assert(BorderSide.canMerge(a.start, b.start)); assert(BorderSide.canMerge(a.start, b.start));
......
...@@ -84,8 +84,6 @@ class BoxDecoration extends Decoration { ...@@ -84,8 +84,6 @@ class BoxDecoration extends Decoration {
/// * If [boxShadow] is null, this decoration does not paint a shadow. /// * If [boxShadow] is null, this decoration does not paint a shadow.
/// * If [gradient] is null, this decoration does not paint gradients. /// * If [gradient] is null, this decoration does not paint gradients.
/// * If [backgroundBlendMode] is null, this decoration paints with [BlendMode.srcOver] /// * If [backgroundBlendMode] is null, this decoration paints with [BlendMode.srcOver]
///
/// The [shape] argument must not be null.
const BoxDecoration({ const BoxDecoration({
this.color, this.color,
this.image, this.image,
......
...@@ -30,8 +30,6 @@ import 'borders.dart'; ...@@ -30,8 +30,6 @@ import 'borders.dart';
/// * [Border], which, when used with [BoxDecoration], can also describe a circle. /// * [Border], which, when used with [BoxDecoration], can also describe a circle.
class CircleBorder extends OutlinedBorder { class CircleBorder extends OutlinedBorder {
/// Create a circle border. /// Create a circle border.
///
/// The [side] argument must not be null.
const CircleBorder({ super.side, this.eccentricity = 0.0 }) const CircleBorder({ super.side, this.eccentricity = 0.0 })
: assert(eccentricity >= 0.0, 'The eccentricity argument $eccentricity is not greater than or equal to zero.'), : assert(eccentricity >= 0.0, 'The eccentricity argument $eccentricity is not greater than or equal to zero.'),
assert(eccentricity <= 1.0, 'The eccentricity argument $eccentricity is not less than or equal to one.'); assert(eccentricity <= 1.0, 'The eccentricity argument $eccentricity is not less than or equal to one.');
......
...@@ -86,8 +86,8 @@ Color _colorFromHue( ...@@ -86,8 +86,8 @@ Color _colorFromHue(
class HSVColor { class HSVColor {
/// Creates a color. /// Creates a color.
/// ///
/// All the arguments must not be null and be in their respective ranges. See /// All the arguments must be in their respective ranges. See the fields for
/// the fields for each parameter for a description of their ranges. /// each parameter for a description of their ranges.
const HSVColor.fromAHSV(this.alpha, this.hue, this.saturation, this.value) const HSVColor.fromAHSV(this.alpha, this.hue, this.saturation, this.value)
: assert(alpha >= 0.0), : assert(alpha >= 0.0),
assert(alpha <= 1.0), assert(alpha <= 1.0),
...@@ -254,8 +254,8 @@ class HSVColor { ...@@ -254,8 +254,8 @@ class HSVColor {
class HSLColor { class HSLColor {
/// Creates a color. /// Creates a color.
/// ///
/// All the arguments must not be null and be in their respective ranges. See /// All the arguments must be in their respective ranges. See the fields for
/// the fields for each parameter for a description of their ranges. /// each parameter for a description of their ranges.
const HSLColor.fromAHSL(this.alpha, this.hue, this.saturation, this.lightness) const HSLColor.fromAHSL(this.alpha, this.hue, this.saturation, this.lightness)
: assert(alpha >= 0.0), : assert(alpha >= 0.0),
assert(alpha <= 1.0), assert(alpha <= 1.0),
...@@ -499,8 +499,6 @@ class ColorSwatch<T> extends Color { ...@@ -499,8 +499,6 @@ class ColorSwatch<T> extends Color {
/// [DiagnosticsProperty] that has an [Color] as value. /// [DiagnosticsProperty] that has an [Color] as value.
class ColorProperty extends DiagnosticsProperty<Color> { class ColorProperty extends DiagnosticsProperty<Color> {
/// Create a diagnostics property for [Color]. /// Create a diagnostics property for [Color].
///
/// The [showName], [style], and [level] arguments must not be null.
ColorProperty( ColorProperty(
String super.name, String super.name,
super.value, { super.value, {
......
...@@ -33,7 +33,7 @@ import 'edge_insets.dart'; ...@@ -33,7 +33,7 @@ import 'edge_insets.dart';
/// radius in a step function instead of gradually like the /// radius in a step function instead of gradually like the
/// [ContinuousRectangleBorder]. /// [ContinuousRectangleBorder].
class ContinuousRectangleBorder extends OutlinedBorder { class ContinuousRectangleBorder extends OutlinedBorder {
/// The arguments must not be null. /// Creates a [ContinuousRectangleBorder].
const ContinuousRectangleBorder({ const ContinuousRectangleBorder({
super.side, super.side,
this.borderRadius = BorderRadius.zero, this.borderRadius = BorderRadius.zero,
......
...@@ -40,9 +40,6 @@ enum ImageRepeat { ...@@ -40,9 +40,6 @@ enum ImageRepeat {
@immutable @immutable
class DecorationImage { class DecorationImage {
/// Creates an image to show in a [BoxDecoration]. /// Creates an image to show in a [BoxDecoration].
///
/// The [image], [alignment], [repeat], and [matchTextDirection] arguments
/// must not be null.
const DecorationImage({ const DecorationImage({
required this.image, required this.image,
this.onError, this.onError,
...@@ -173,9 +170,9 @@ class DecorationImage { ...@@ -173,9 +170,9 @@ class DecorationImage {
/// Creates a [DecorationImagePainter] for this [DecorationImage]. /// Creates a [DecorationImagePainter] for this [DecorationImage].
/// ///
/// The `onChanged` argument must not be null. It will be called whenever the /// The `onChanged` argument will be called whenever the image needs to be
/// image needs to be repainted, e.g. because it is loading incrementally or /// repainted, e.g. because it is loading incrementally or because it is
/// because it is animated. /// animated.
DecorationImagePainter createPainter(VoidCallback onChanged) { DecorationImagePainter createPainter(VoidCallback onChanged) {
return _DecorationImagePainter._(this, onChanged); return _DecorationImagePainter._(this, onChanged);
} }
...@@ -502,9 +499,6 @@ void debugFlushLastFrameImageSizeInfo() { ...@@ -502,9 +499,6 @@ void debugFlushLastFrameImageSizeInfo() {
/// bilinear interpolation, rather than the default [FilterQuality.none] which corresponds /// bilinear interpolation, rather than the default [FilterQuality.none] which corresponds
/// to nearest-neighbor. /// to nearest-neighbor.
/// ///
/// The `canvas`, `rect`, `image`, `scale`, `alignment`, `repeat`, `flipHorizontally` and `filterQuality`
/// arguments must not be null.
///
/// See also: /// See also:
/// ///
/// * [paintBorder], which paints a border around a rectangle on a canvas. /// * [paintBorder], which paints a border around a rectangle on a canvas.
......
...@@ -38,8 +38,6 @@ class FlutterLogoDecoration extends Decoration { ...@@ -38,8 +38,6 @@ class FlutterLogoDecoration extends Decoration {
/// ///
/// The [style] controls whether and where to draw the "Flutter" label. If one /// The [style] controls whether and where to draw the "Flutter" label. If one
/// is shown, the [textColor] controls the color of the label. /// is shown, the [textColor] controls the color of the label.
///
/// The [textColor], [style], and [margin] arguments must not be null.
const FlutterLogoDecoration({ const FlutterLogoDecoration({
this.textColor = const Color(0xFF757575), this.textColor = const Color(0xFF757575),
this.style = FlutterLogoStyle.markOnly, this.style = FlutterLogoStyle.markOnly,
......
...@@ -53,8 +53,6 @@ import 'basic_types.dart'; ...@@ -53,8 +53,6 @@ import 'basic_types.dart';
@immutable @immutable
class FractionalOffset extends Alignment { class FractionalOffset extends Alignment {
/// Creates a fractional offset. /// Creates a fractional offset.
///
/// The [dx] and [dy] arguments must not be null.
const FractionalOffset(double dx, double dy) const FractionalOffset(double dx, double dy)
: super(dx * 2.0 - 1.0, dy * 2.0 - 1.0); : super(dx * 2.0 - 1.0, dy * 2.0 - 1.0);
......
...@@ -35,8 +35,6 @@ import 'basic_types.dart'; ...@@ -35,8 +35,6 @@ import 'basic_types.dart';
/// container. /// container.
/// ///
/// Used by [Tooltip] to position a tooltip relative to its parent. /// Used by [Tooltip] to position a tooltip relative to its parent.
///
/// The arguments must not be null.
Offset positionDependentBox({ Offset positionDependentBox({
required Size size, required Size size,
required Size childSize, required Size childSize,
......
...@@ -149,8 +149,8 @@ class GradientRotation extends GradientTransform { ...@@ -149,8 +149,8 @@ class GradientRotation extends GradientTransform {
abstract class Gradient { abstract class Gradient {
/// Initialize the gradient's colors and stops. /// Initialize the gradient's colors and stops.
/// ///
/// The [colors] argument must not be null, and must have at least two colors /// The [colors] argument must have at least two colors (the length is not
/// (the length is not verified until the [createShader] method is called). /// verified until the [createShader] method is called).
/// ///
/// If specified, the [stops] argument must have the same number of entries as /// If specified, the [stops] argument must have the same number of entries as
/// [colors] (this is also not verified until the [createShader] method is /// [colors] (this is also not verified until the [createShader] method is
...@@ -374,8 +374,7 @@ abstract class Gradient { ...@@ -374,8 +374,7 @@ abstract class Gradient {
class LinearGradient extends Gradient { class LinearGradient extends Gradient {
/// Creates a linear gradient. /// Creates a linear gradient.
/// ///
/// The [colors] argument must not be null. If [stops] is non-null, it must /// If [stops] is non-null, it must have the same length as [colors].
/// have the same length as [colors].
const LinearGradient({ const LinearGradient({
this.begin = Alignment.centerLeft, this.begin = Alignment.centerLeft,
this.end = Alignment.centerRight, this.end = Alignment.centerRight,
...@@ -625,8 +624,7 @@ class LinearGradient extends Gradient { ...@@ -625,8 +624,7 @@ class LinearGradient extends Gradient {
class RadialGradient extends Gradient { class RadialGradient extends Gradient {
/// Creates a radial gradient. /// Creates a radial gradient.
/// ///
/// The [colors] argument must not be null. If [stops] is non-null, it must /// If [stops] is non-null, it must have the same length as [colors].
/// have the same length as [colors].
const RadialGradient({ const RadialGradient({
this.center = Alignment.center, this.center = Alignment.center,
this.radius = 0.5, this.radius = 0.5,
...@@ -921,8 +919,7 @@ class RadialGradient extends Gradient { ...@@ -921,8 +919,7 @@ class RadialGradient extends Gradient {
class SweepGradient extends Gradient { class SweepGradient extends Gradient {
/// Creates a sweep gradient. /// Creates a sweep gradient.
/// ///
/// The [colors] argument must not be null. If [stops] is non-null, it must /// If [stops] is non-null, it must have the same length as [colors].
/// have the same length as [colors].
const SweepGradient({ const SweepGradient({
this.center = Alignment.center, this.center = Alignment.center,
this.startAngle = 0.0, this.startAngle = 0.0,
......
...@@ -231,8 +231,7 @@ class ImageCache { ...@@ -231,8 +231,7 @@ class ImageCache {
/// completely discarded by the cache. It should be set to false when calls /// completely discarded by the cache. It should be set to false when calls
/// to evict are trying to relieve memory pressure, since an image with a /// to evict are trying to relieve memory pressure, since an image with a
/// listener will not actually be evicted from memory, and subsequent attempts /// listener will not actually be evicted from memory, and subsequent attempts
/// to load it will end up allocating more memory for the image again. The /// to load it will end up allocating more memory for the image again.
/// argument must not be null.
/// ///
/// See also: /// See also:
/// ///
...@@ -313,8 +312,6 @@ class ImageCache { ...@@ -313,8 +312,6 @@ class ImageCache {
/// if not, calls the given callback to obtain it first. In either case, the /// if not, calls the given callback to obtain it first. In either case, the
/// key is moved to the 'most recently used' position. /// key is moved to the 'most recently used' position.
/// ///
/// The arguments must not be null. The `loader` cannot return null.
///
/// In the event that the loader throws an exception, it will be caught only if /// In the event that the loader throws an exception, it will be caught only if
/// `onError` is also provided. When an exception is caught resolving an image, /// `onError` is also provided. When an exception is caught resolving an image,
/// no completers are cached and `null` is returned instead of a new /// no completers are cached and `null` is returned instead of a new
......
...@@ -406,8 +406,7 @@ abstract class ImageProvider<T extends Object> { ...@@ -406,8 +406,7 @@ abstract class ImageProvider<T extends Object> {
/// The location may be [ImageCacheStatus.untracked], indicating that this /// The location may be [ImageCacheStatus.untracked], indicating that this
/// image provider's key is not available in the [ImageCache]. /// image provider's key is not available in the [ImageCache].
/// ///
/// The `cache` and `configuration` parameters must not be null. If the /// If the `handleError` parameter is null, errors will be reported to
/// `handleError` parameter is null, errors will be reported to
/// [FlutterError.onError], and the method will return null. /// [FlutterError.onError], and the method will return null.
/// ///
/// A completed return value of null indicates that an error has occurred. /// A completed return value of null indicates that an error has occurred.
...@@ -655,8 +654,6 @@ class _AbstractImageStreamCompleter extends ImageStreamCompleter {} ...@@ -655,8 +654,6 @@ class _AbstractImageStreamCompleter extends ImageStreamCompleter {}
@immutable @immutable
class AssetBundleImageKey { class AssetBundleImageKey {
/// Creates the key for an [AssetImage] or [AssetBundleImageProvider]. /// Creates the key for an [AssetImage] or [AssetBundleImageProvider].
///
/// The arguments must not be null.
const AssetBundleImageKey({ const AssetBundleImageKey({
required this.bundle, required this.bundle,
required this.name, required this.name,
...@@ -1402,8 +1399,6 @@ class ResizeImage extends ImageProvider<ResizeImageKey> { ...@@ -1402,8 +1399,6 @@ class ResizeImage extends ImageProvider<ResizeImageKey> {
// our cache if the headers describe the image as having expired at that point. // our cache if the headers describe the image as having expired at that point.
abstract class NetworkImage extends ImageProvider<NetworkImage> { abstract class NetworkImage extends ImageProvider<NetworkImage> {
/// Creates an object that fetches the image at the given URL. /// Creates an object that fetches the image at the given URL.
///
/// The arguments [url] and [scale] must not be null.
const factory NetworkImage(String url, { double scale, Map<String, String>? headers }) = network_image.NetworkImage; const factory NetworkImage(String url, { double scale, Map<String, String>? headers }) = network_image.NetworkImage;
/// The URL from which the image will be fetched. /// The URL from which the image will be fetched.
...@@ -1436,8 +1431,6 @@ abstract class NetworkImage extends ImageProvider<NetworkImage> { ...@@ -1436,8 +1431,6 @@ abstract class NetworkImage extends ImageProvider<NetworkImage> {
@immutable @immutable
class FileImage extends ImageProvider<FileImage> { class FileImage extends ImageProvider<FileImage> {
/// Creates an object that decodes a [File] as an image. /// Creates an object that decodes a [File] as an image.
///
/// The arguments must not be null.
const FileImage(this.file, { this.scale = 1.0 }); const FileImage(this.file, { this.scale = 1.0 });
/// The file to decode into an image. /// The file to decode into an image.
...@@ -1528,8 +1521,6 @@ class FileImage extends ImageProvider<FileImage> { ...@@ -1528,8 +1521,6 @@ class FileImage extends ImageProvider<FileImage> {
@immutable @immutable
class MemoryImage extends ImageProvider<MemoryImage> { class MemoryImage extends ImageProvider<MemoryImage> {
/// Creates an object that decodes a [Uint8List] buffer as an image. /// Creates an object that decodes a [Uint8List] buffer as an image.
///
/// The arguments must not be null.
const MemoryImage(this.bytes, { this.scale = 1.0 }); const MemoryImage(this.bytes, { this.scale = 1.0 });
/// The bytes to decode into an image. /// The bytes to decode into an image.
...@@ -1674,10 +1665,9 @@ class MemoryImage extends ImageProvider<MemoryImage> { ...@@ -1674,10 +1665,9 @@ class MemoryImage extends ImageProvider<MemoryImage> {
class ExactAssetImage extends AssetBundleImageProvider { class ExactAssetImage extends AssetBundleImageProvider {
/// Creates an object that fetches the given image from an asset bundle. /// Creates an object that fetches the given image from an asset bundle.
/// ///
/// The [assetName] and [scale] arguments must not be null. The [scale] arguments /// The [scale] argument defaults to 1. The [bundle] argument may be null, in
/// defaults to 1.0. The [bundle] argument may be null, in which case the /// which case the bundle provided in the [ImageConfiguration] passed to the
/// bundle provided in the [ImageConfiguration] passed to the [resolve] call /// [resolve] call will be used instead.
/// will be used instead.
/// ///
/// The [package] argument must be non-null when fetching an asset that is /// The [package] argument must be non-null when fetching an asset that is
/// included in a package. See the documentation for the [ExactAssetImage] class /// included in a package. See the documentation for the [ExactAssetImage] class
......
...@@ -233,10 +233,10 @@ const double _kLowDprLimit = 2.0; ...@@ -233,10 +233,10 @@ const double _kLowDprLimit = 2.0;
class AssetImage extends AssetBundleImageProvider { class AssetImage extends AssetBundleImageProvider {
/// Creates an object that fetches an image from an asset bundle. /// Creates an object that fetches an image from an asset bundle.
/// ///
/// The [assetName] argument must not be null. It should name the main asset /// The [assetName] argument should name the main asset from the set of images
/// from the set of images to choose from. The [package] argument must be /// to choose from. The [package] argument must be non-null when fetching an
/// non-null when fetching an asset that is included in package. See the /// asset that is included in package. See the documentation for the
/// documentation for the [AssetImage] class itself for details. /// [AssetImage] class itself for details.
const AssetImage( const AssetImage(
this.assetName, { this.assetName, {
this.bundle, this.bundle,
......
...@@ -20,8 +20,6 @@ import 'package:flutter/scheduler.dart'; ...@@ -20,8 +20,6 @@ import 'package:flutter/scheduler.dart';
class ImageInfo { class ImageInfo {
/// Creates an [ImageInfo] object for the given [image] and [scale]. /// Creates an [ImageInfo] object for the given [image] and [scale].
/// ///
/// Both the [image] and the [scale] must not be null.
///
/// The [debugLabel] may be used to identify the source of this image. /// The [debugLabel] may be used to identify the source of this image.
const ImageInfo({ required this.image, this.scale = 1.0, this.debugLabel }); const ImageInfo({ required this.image, this.scale = 1.0, this.debugLabel });
...@@ -159,8 +157,6 @@ class ImageInfo { ...@@ -159,8 +157,6 @@ class ImageInfo {
@immutable @immutable
class ImageStreamListener { class ImageStreamListener {
/// Creates a new [ImageStreamListener]. /// Creates a new [ImageStreamListener].
///
/// The [onImage] parameter must not be null.
const ImageStreamListener( const ImageStreamListener(
this.onImage, { this.onImage, {
this.onChunk, this.onChunk,
......
...@@ -51,8 +51,6 @@ class InlineSpanSemanticsInformation { ...@@ -51,8 +51,6 @@ class InlineSpanSemanticsInformation {
/// Constructs an object that holds the text and semantics label values of an /// Constructs an object that holds the text and semantics label values of an
/// [InlineSpan]. /// [InlineSpan].
/// ///
/// The text parameter must not be null.
///
/// Use [InlineSpanSemanticsInformation.placeholder] instead of directly setting /// Use [InlineSpanSemanticsInformation.placeholder] instead of directly setting
/// [isPlaceholder]. /// [isPlaceholder].
const InlineSpanSemanticsInformation( const InlineSpanSemanticsInformation(
......
...@@ -541,8 +541,6 @@ List<String> debugDescribeTransform(Matrix4? transform) { ...@@ -541,8 +541,6 @@ List<String> debugDescribeTransform(Matrix4? transform) {
/// Property which handles [Matrix4] that represent transforms. /// Property which handles [Matrix4] that represent transforms.
class TransformProperty extends DiagnosticsProperty<Matrix4> { class TransformProperty extends DiagnosticsProperty<Matrix4> {
/// Create a diagnostics property for [Matrix4] objects. /// Create a diagnostics property for [Matrix4] objects.
///
/// The [showName] and [level] arguments must not be null.
TransformProperty( TransformProperty(
String super.name, String super.name,
super.value, { super.value, {
......
...@@ -130,8 +130,6 @@ class CircularNotchedRectangle extends NotchedShape { ...@@ -130,8 +130,6 @@ class CircularNotchedRectangle extends NotchedShape {
class AutomaticNotchedShape extends NotchedShape { class AutomaticNotchedShape extends NotchedShape {
/// Creates a [NotchedShape] that is defined by two [ShapeBorder]s. /// Creates a [NotchedShape] that is defined by two [ShapeBorder]s.
/// ///
/// The [host] must not be null.
///
/// The [guest] may be null, in which case no notch is created even /// The [guest] may be null, in which case no notch is created even
/// if a guest rectangle is provided to [getOuterPath]. /// if a guest rectangle is provided to [getOuterPath].
const AutomaticNotchedShape(this.host, [ this.guest ]); const AutomaticNotchedShape(this.host, [ this.guest ]);
......
...@@ -25,8 +25,6 @@ import 'circle_border.dart'; ...@@ -25,8 +25,6 @@ import 'circle_border.dart';
/// describe a rounded rectangle. /// describe a rounded rectangle.
class RoundedRectangleBorder extends OutlinedBorder { class RoundedRectangleBorder extends OutlinedBorder {
/// Creates a rounded rectangle border. /// Creates a rounded rectangle border.
///
/// The arguments must not be null.
const RoundedRectangleBorder({ const RoundedRectangleBorder({
super.side, super.side,
this.borderRadius = BorderRadius.zero, this.borderRadius = BorderRadius.zero,
......
...@@ -68,8 +68,6 @@ class ShapeDecoration extends Decoration { ...@@ -68,8 +68,6 @@ class ShapeDecoration extends Decoration {
/// ///
/// The [color] and [gradient] properties are mutually exclusive, one (or /// The [color] and [gradient] properties are mutually exclusive, one (or
/// both) of them must be null. /// both) of them must be null.
///
/// The [shape] must not be null.
const ShapeDecoration({ const ShapeDecoration({
this.color, this.color,
this.image, this.image,
...@@ -157,8 +155,7 @@ class ShapeDecoration extends Decoration { ...@@ -157,8 +155,7 @@ class ShapeDecoration extends Decoration {
/// Shapes can be stacked (using the `+` operator). The color, gradient, and /// Shapes can be stacked (using the `+` operator). The color, gradient, and
/// image are drawn into the inner-most shape specified. /// image are drawn into the inner-most shape specified.
/// ///
/// The [shape] property specifies the outline (border) of the decoration. The /// The [shape] property specifies the outline (border) of the decoration.
/// shape must not be null.
/// ///
/// ## Directionality-dependent shapes /// ## Directionality-dependent shapes
/// ///
......
...@@ -25,8 +25,6 @@ import 'rounded_rectangle_border.dart'; ...@@ -25,8 +25,6 @@ import 'rounded_rectangle_border.dart';
/// * [BorderSide], which is used to describe the border of the stadium. /// * [BorderSide], which is used to describe the border of the stadium.
class StadiumBorder extends OutlinedBorder { class StadiumBorder extends OutlinedBorder {
/// Create a stadium border. /// Create a stadium border.
///
/// The [side] argument must not be null.
const StadiumBorder({ super.side }); const StadiumBorder({ super.side });
@override @override
......
...@@ -318,8 +318,6 @@ class StrutStyle with Diagnosticable { ...@@ -318,8 +318,6 @@ class StrutStyle with Diagnosticable {
/// Builds a StrutStyle that contains values of the equivalent properties in /// Builds a StrutStyle that contains values of the equivalent properties in
/// the provided [textStyle]. /// the provided [textStyle].
/// ///
/// The [textStyle] parameter must not be null.
///
/// The named parameters override the [textStyle]'s argument's properties. /// The named parameters override the [textStyle]'s argument's properties.
/// Since TextStyle does not contain [leading] or [forceStrutHeight], these /// Since TextStyle does not contain [leading] or [forceStrutHeight], these
/// values will take on default values (null and false) unless otherwise /// values will take on default values (null and false) unless otherwise
......
...@@ -56,8 +56,6 @@ enum TextOverflow { ...@@ -56,8 +56,6 @@ enum TextOverflow {
/// Placeholders specify an empty space in the text layout, which is used /// Placeholders specify an empty space in the text layout, which is used
/// to later render arbitrary inline widgets into defined by a [WidgetSpan]. /// to later render arbitrary inline widgets into defined by a [WidgetSpan].
/// ///
/// The [size] and [alignment] properties are required and cannot be null.
///
/// See also: /// See also:
/// ///
/// * [WidgetSpan], a subclass of [InlineSpan] and [PlaceholderSpan] that /// * [WidgetSpan], a subclass of [InlineSpan] and [PlaceholderSpan] that
...@@ -470,8 +468,6 @@ class TextPainter { ...@@ -470,8 +468,6 @@ class TextPainter {
/// The `text` and `textDirection` arguments are optional but [text] and /// The `text` and `textDirection` arguments are optional but [text] and
/// [textDirection] must be non-null before calling [layout]. /// [textDirection] must be non-null before calling [layout].
/// ///
/// The [textAlign] property must not be null.
///
/// The [maxLines] property, if non-null, must be greater than zero. /// The [maxLines] property, if non-null, must be greater than zero.
TextPainter({ TextPainter({
InlineSpan? text, InlineSpan? text,
...@@ -707,7 +703,7 @@ class TextPainter { ...@@ -707,7 +703,7 @@ class TextPainter {
/// ///
/// After this is set, you must call [layout] before the next call to [paint]. /// After this is set, you must call [layout] before the next call to [paint].
/// ///
/// The [textAlign] property must not be null. It defaults to [TextAlign.start]. /// The [textAlign] property defaults to [TextAlign.start].
TextAlign get textAlign => _textAlign; TextAlign get textAlign => _textAlign;
TextAlign _textAlign; TextAlign _textAlign;
set textAlign(TextAlign value) { set textAlign(TextAlign value) {
......
...@@ -929,8 +929,6 @@ class TextStyle with Diagnosticable { ...@@ -929,8 +929,6 @@ class TextStyle with Diagnosticable {
/// applied to a `style` whose [fontWeight] is [FontWeight.w500] will return a /// applied to a `style` whose [fontWeight] is [FontWeight.w500] will return a
/// [TextStyle] with a [FontWeight.w300]. /// [TextStyle] with a [FontWeight.w300].
/// ///
/// The numeric arguments must not be null.
///
/// If the underlying values are null, then the corresponding factors and/or /// If the underlying values are null, then the corresponding factors and/or
/// deltas must not be specified. /// deltas must not be specified.
/// ///
...@@ -1321,9 +1319,9 @@ class TextStyle with Diagnosticable { ...@@ -1321,9 +1319,9 @@ class TextStyle with Diagnosticable {
/// The style information for paragraphs, encoded for use by `dart:ui`. /// The style information for paragraphs, encoded for use by `dart:ui`.
/// ///
/// The `textScaleFactor` argument must not be null. If omitted, it defaults /// If the `textScaleFactor` argument is omitted, it defaults to one. The
/// to 1.0. The other arguments may be null. The `maxLines` argument, if /// other arguments may be null. The `maxLines` argument, if specified and
/// specified and non-null, must be greater than zero. /// non-null, must be greater than zero.
/// ///
/// If the font size on this style isn't set, it will default to 14 logical /// If the font size on this style isn't set, it will default to 14 logical
/// pixels. /// pixels.
......
...@@ -175,7 +175,7 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { ...@@ -175,7 +175,7 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.hardEdge], and must not be null. /// Defaults to [Clip.hardEdge].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
......
...@@ -899,8 +899,6 @@ class BoxHitTestResult extends HitTestResult { ...@@ -899,8 +899,6 @@ class BoxHitTestResult extends HitTestResult {
/// A hit test entry used by [RenderBox]. /// A hit test entry used by [RenderBox].
class BoxHitTestEntry extends HitTestEntry<RenderBox> { class BoxHitTestEntry extends HitTestEntry<RenderBox> {
/// Creates a box hit test entry. /// Creates a box hit test entry.
///
/// The [localPosition] argument must not be null.
BoxHitTestEntry(super.target, this.localPosition); BoxHitTestEntry(super.target, this.localPosition);
/// The position of the hit test in the local coordinates of [target]. /// The position of the hit test in the local coordinates of [target].
......
...@@ -303,8 +303,6 @@ class RenderCustomMultiChildLayoutBox extends RenderBox ...@@ -303,8 +303,6 @@ class RenderCustomMultiChildLayoutBox extends RenderBox
with ContainerRenderObjectMixin<RenderBox, MultiChildLayoutParentData>, with ContainerRenderObjectMixin<RenderBox, MultiChildLayoutParentData>,
RenderBoxContainerDefaultsMixin<RenderBox, MultiChildLayoutParentData> { RenderBoxContainerDefaultsMixin<RenderBox, MultiChildLayoutParentData> {
/// Creates a render object that customizes the layout of multiple children. /// Creates a render object that customizes the layout of multiple children.
///
/// The [delegate] argument must not be null.
RenderCustomMultiChildLayoutBox({ RenderCustomMultiChildLayoutBox({
List<RenderBox>? children, List<RenderBox>? children,
required MultiChildLayoutDelegate delegate, required MultiChildLayoutDelegate delegate,
......
...@@ -303,8 +303,6 @@ abstract class CustomPainter extends Listenable { ...@@ -303,8 +303,6 @@ abstract class CustomPainter extends Listenable {
@immutable @immutable
class CustomPainterSemantics { class CustomPainterSemantics {
/// Creates semantics information describing a rectangle on a canvas. /// Creates semantics information describing a rectangle on a canvas.
///
/// Arguments `rect` and `properties` must not be null.
const CustomPainterSemantics({ const CustomPainterSemantics({
this.key, this.key,
required this.rect, required this.rect,
......
...@@ -36,8 +36,6 @@ const Radius _kFloatingCursorRadius = Radius.circular(1.0); ...@@ -36,8 +36,6 @@ const Radius _kFloatingCursorRadius = Radius.circular(1.0);
@immutable @immutable
class TextSelectionPoint { class TextSelectionPoint {
/// Creates a description of a point in a text selection. /// Creates a description of a point in a text selection.
///
/// The [point] argument must not be null.
const TextSelectionPoint(this.point, this.direction); const TextSelectionPoint(this.point, this.direction);
/// Coordinates of the lower left or lower right corner of the selection, /// Coordinates of the lower left or lower right corner of the selection,
...@@ -261,9 +259,7 @@ class VerticalCaretMovementRun implements Iterator<TextPosition> { ...@@ -261,9 +259,7 @@ class VerticalCaretMovementRun implements Iterator<TextPosition> {
class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ContainerRenderObjectMixin<RenderBox, TextParentData>, RenderInlineChildrenContainerDefaults implements TextLayoutMetrics { class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ContainerRenderObjectMixin<RenderBox, TextParentData>, RenderInlineChildrenContainerDefaults implements TextLayoutMetrics {
/// Creates a render object that implements the visual aspects of a text field. /// Creates a render object that implements the visual aspects of a text field.
/// ///
/// The [textAlign] argument must not be null. It defaults to [TextAlign.start]. /// The [textAlign] argument defaults to [TextAlign.start].
///
/// The [textDirection] argument must not be null.
/// ///
/// If [showCursor] is not specified, then it defaults to hiding the cursor. /// If [showCursor] is not specified, then it defaults to hiding the cursor.
/// ///
...@@ -271,8 +267,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ...@@ -271,8 +267,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
/// the number of lines. By default, it is 1, meaning this is a single-line /// the number of lines. By default, it is 1, meaning this is a single-line
/// text field. If it is not null, it must be greater than zero. /// text field. If it is not null, it must be greater than zero.
/// ///
/// The [offset] is required and must not be null. You can use [ /// Use [ViewportOffset.zero] for the [offset] if there is no need for
/// ViewportOffset.zero] if you have no need for scrolling. /// scrolling.
RenderEditable({ RenderEditable({
InlineSpan? text, InlineSpan? text,
required TextDirection textDirection, required TextDirection textDirection,
...@@ -564,7 +560,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ...@@ -564,7 +560,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
/// Character used for obscuring text if [obscureText] is true. /// Character used for obscuring text if [obscureText] is true.
/// ///
/// Cannot be null, and must have a length of exactly one. /// Must have a length of exactly one.
String get obscuringCharacter => _obscuringCharacter; String get obscuringCharacter => _obscuringCharacter;
String _obscuringCharacter; String _obscuringCharacter;
set obscuringCharacter(String value) { set obscuringCharacter(String value) {
...@@ -607,8 +603,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ...@@ -607,8 +603,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
/// The object that controls the text selection, used by this render object /// The object that controls the text selection, used by this render object
/// for implementing cut, copy, and paste keyboard shortcuts. /// for implementing cut, copy, and paste keyboard shortcuts.
/// ///
/// It must not be null. It will make cut, copy and paste functionality work /// It will make cut, copy and paste functionality work with the most recently
/// with the most recently set [TextSelectionDelegate]. /// set [TextSelectionDelegate].
TextSelectionDelegate textSelectionDelegate; TextSelectionDelegate textSelectionDelegate;
/// Track whether position of the start of the selected text is within the viewport. /// Track whether position of the start of the selected text is within the viewport.
...@@ -802,8 +798,6 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ...@@ -802,8 +798,6 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
} }
/// How the text should be aligned horizontally. /// How the text should be aligned horizontally.
///
/// This must not be null.
TextAlign get textAlign => _textPainter.textAlign; TextAlign get textAlign => _textPainter.textAlign;
set textAlign(TextAlign value) { set textAlign(TextAlign value) {
if (_textPainter.textAlign == value) { if (_textPainter.textAlign == value) {
...@@ -824,8 +818,6 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ...@@ -824,8 +818,6 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
/// and the Hebrew phrase to its right, while in a [TextDirection.rtl] /// and the Hebrew phrase to its right, while in a [TextDirection.rtl]
/// context, the English phrase will be on the right and the Hebrew phrase on /// context, the English phrase will be on the right and the Hebrew phrase on
/// its left. /// its left.
///
/// This must not be null.
// TextPainter.textDirection is nullable, but it is set to a // TextPainter.textDirection is nullable, but it is set to a
// non-null value in the RenderEditable constructor and we refuse to // non-null value in the RenderEditable constructor and we refuse to
// set it to null here, so _textPainter.textDirection cannot be null. // set it to null here, so _textPainter.textDirection cannot be null.
...@@ -1257,7 +1249,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ...@@ -1257,7 +1249,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.hardEdge], and must not be null. /// Defaults to [Clip.hardEdge].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
......
...@@ -472,7 +472,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -472,7 +472,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.none], and must not be null. /// Defaults to [Clip.none].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.none; Clip _clipBehavior = Clip.none;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
......
...@@ -227,7 +227,7 @@ class RenderFlow extends RenderBox ...@@ -227,7 +227,7 @@ class RenderFlow extends RenderBox
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.hardEdge], and must not be null. /// Defaults to [Clip.hardEdge].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
......
...@@ -23,9 +23,8 @@ export 'package:flutter/painting.dart' show ...@@ -23,9 +23,8 @@ export 'package:flutter/painting.dart' show
class RenderImage extends RenderBox { class RenderImage extends RenderBox {
/// Creates a render box that displays an image. /// Creates a render box that displays an image.
/// ///
/// The [scale], [alignment], [repeat], [matchTextDirection] and [filterQuality] arguments /// The [textDirection] argument must not be null if [alignment] will need
/// must not be null. The [textDirection] argument must not be null if /// resolving or if [matchTextDirection] is true.
/// [alignment] will need resolving or if [matchTextDirection] is true.
RenderImage({ RenderImage({
ui.Image? image, ui.Image? image,
this.debugImageLabel, this.debugImageLabel,
......
...@@ -974,8 +974,6 @@ class TextureLayer extends Layer { ...@@ -974,8 +974,6 @@ class TextureLayer extends Layer {
/// on iOS. /// on iOS.
class PlatformViewLayer extends Layer { class PlatformViewLayer extends Layer {
/// Creates a platform view layer. /// Creates a platform view layer.
///
/// The `rect` and `viewId` parameters must not be null.
PlatformViewLayer({ PlatformViewLayer({
required this.rect, required this.rect,
required this.viewId, required this.viewId,
...@@ -1411,8 +1409,6 @@ class ContainerLayer extends Layer { ...@@ -1411,8 +1409,6 @@ class ContainerLayer extends Layer {
/// may explicitly allow null as a value, for example if they know that they /// may explicitly allow null as a value, for example if they know that they
/// transform all their children identically. /// transform all their children identically.
/// ///
/// The `transform` argument must not be null.
///
/// Used by [FollowerLayer] to transform its child to a [LeaderLayer]'s /// Used by [FollowerLayer] to transform its child to a [LeaderLayer]'s
/// position. /// position.
void applyTransform(Layer? child, Matrix4 transform) { void applyTransform(Layer? child, Matrix4 transform) {
...@@ -1610,7 +1606,7 @@ class ClipRectLayer extends ContainerLayer { ...@@ -1610,7 +1606,7 @@ class ClipRectLayer extends ContainerLayer {
/// The [clipRect] argument must not be null before the compositing phase of /// The [clipRect] argument must not be null before the compositing phase of
/// the pipeline. /// the pipeline.
/// ///
/// The [clipBehavior] argument must not be null, and must not be [Clip.none]. /// The [clipBehavior] argument must not be [Clip.none].
ClipRectLayer({ ClipRectLayer({
Rect? clipRect, Rect? clipRect,
Clip clipBehavior = Clip.hardEdge, Clip clipBehavior = Clip.hardEdge,
...@@ -2368,9 +2364,8 @@ class LayerLink { ...@@ -2368,9 +2364,8 @@ class LayerLink {
class LeaderLayer extends ContainerLayer { class LeaderLayer extends ContainerLayer {
/// Creates a leader layer. /// Creates a leader layer.
/// ///
/// The [link] property must not be null, and must not have been provided to /// The [link] property must not have been provided to any other [LeaderLayer]
/// any other [LeaderLayer] layers that are [attached] to the layer tree at /// layers that are [attached] to the layer tree at the same time.
/// the same time.
/// ///
/// The [offset] property must be non-null before the compositing phase of the /// The [offset] property must be non-null before the compositing phase of the
/// pipeline. /// pipeline.
...@@ -2480,8 +2475,6 @@ class LeaderLayer extends ContainerLayer { ...@@ -2480,8 +2475,6 @@ class LeaderLayer extends ContainerLayer {
class FollowerLayer extends ContainerLayer { class FollowerLayer extends ContainerLayer {
/// Creates a follower layer. /// Creates a follower layer.
/// ///
/// The [link] property must not be null.
///
/// The [unlinkedOffset], [linkedOffset], and [showWhenUnlinked] properties /// The [unlinkedOffset], [linkedOffset], and [showWhenUnlinked] properties
/// must be non-null before the compositing phase of the pipeline. /// must be non-null before the compositing phase of the pipeline.
FollowerLayer({ FollowerLayer({
...@@ -2805,8 +2798,6 @@ class FollowerLayer extends ContainerLayer { ...@@ -2805,8 +2798,6 @@ class FollowerLayer extends ContainerLayer {
/// if [opaque] is true and the layer's annotation is added. /// if [opaque] is true and the layer's annotation is added.
class AnnotatedRegionLayer<T extends Object> extends ContainerLayer { class AnnotatedRegionLayer<T extends Object> extends ContainerLayer {
/// Creates a new layer that annotates its children with [value]. /// Creates a new layer that annotates its children with [value].
///
/// The [value] provided cannot be null.
AnnotatedRegionLayer( AnnotatedRegionLayer(
this.value, { this.value, {
this.size, this.size,
......
...@@ -146,7 +146,7 @@ class RenderListWheelViewport ...@@ -146,7 +146,7 @@ class RenderListWheelViewport
implements RenderAbstractViewport { implements RenderAbstractViewport {
/// Creates a [RenderListWheelViewport] which renders children on a wheel. /// Creates a [RenderListWheelViewport] which renders children on a wheel.
/// ///
/// All arguments must not be null. Optional arguments have reasonable defaults. /// Optional arguments have reasonable defaults.
RenderListWheelViewport({ RenderListWheelViewport({
required this.childManager, required this.childManager,
required ViewportOffset offset, required ViewportOffset offset,
...@@ -220,8 +220,6 @@ class RenderListWheelViewport ...@@ -220,8 +220,6 @@ class RenderListWheelViewport
/// viewport uses to select which part of its content to display. As the user /// viewport uses to select which part of its content to display. As the user
/// scrolls the viewport, this value changes, which changes the content that /// scrolls the viewport, this value changes, which changes the content that
/// is displayed. /// is displayed.
///
/// Must not be null.
ViewportOffset get offset => _offset; ViewportOffset get offset => _offset;
ViewportOffset _offset; ViewportOffset _offset;
set offset(ViewportOffset value) { set offset(ViewportOffset value) {
...@@ -264,7 +262,7 @@ class RenderListWheelViewport ...@@ -264,7 +262,7 @@ class RenderListWheelViewport
/// ///
/// Defaults to an arbitrary but aesthetically reasonable number of 2.0. /// Defaults to an arbitrary but aesthetically reasonable number of 2.0.
/// ///
/// Must not be null and must be positive. /// Must be a positive number.
/// {@endtemplate} /// {@endtemplate}
double get diameterRatio => _diameterRatio; double get diameterRatio => _diameterRatio;
double _diameterRatio; double _diameterRatio;
...@@ -293,7 +291,7 @@ class RenderListWheelViewport ...@@ -293,7 +291,7 @@ class RenderListWheelViewport
/// A larger number brings the vanishing point closer and a smaller number /// A larger number brings the vanishing point closer and a smaller number
/// pushes the vanishing point further. /// pushes the vanishing point further.
/// ///
/// Must not be null and must be positive. /// Must be a positive number.
/// {@endtemplate} /// {@endtemplate}
double get perspective => _perspective; double get perspective => _perspective;
double _perspective; double _perspective;
...@@ -402,7 +400,7 @@ class RenderListWheelViewport ...@@ -402,7 +400,7 @@ class RenderListWheelViewport
/// The size of the children along the main axis. Children [RenderBox]es will /// The size of the children along the main axis. Children [RenderBox]es will
/// be given the [BoxConstraints] of this exact size. /// be given the [BoxConstraints] of this exact size.
/// ///
/// Must not be null and must be positive. /// Must be a positive number.
/// {@endtemplate} /// {@endtemplate}
double get itemExtent => _itemExtent; double get itemExtent => _itemExtent;
double _itemExtent; double _itemExtent;
...@@ -432,7 +430,7 @@ class RenderListWheelViewport ...@@ -432,7 +430,7 @@ class RenderListWheelViewport
/// Changing this value will change the number of children built and shown /// Changing this value will change the number of children built and shown
/// inside the wheel. /// inside the wheel.
/// ///
/// Must not be null and must be positive. /// Must be a positive number.
/// {@endtemplate} /// {@endtemplate}
/// ///
/// Defaults to 1. /// Defaults to 1.
...@@ -454,9 +452,9 @@ class RenderListWheelViewport ...@@ -454,9 +452,9 @@ class RenderListWheelViewport
/// If false, every child will be painted. However the [Scrollable] is still /// If false, every child will be painted. However the [Scrollable] is still
/// the size of the viewport and detects gestures inside only. /// the size of the viewport and detects gestures inside only.
/// ///
/// Defaults to false. Must not be null. Cannot be true if [clipBehavior] /// Defaults to false. Cannot be true if [clipBehavior] is not [Clip.none]
/// is not [Clip.none] since children outside the viewport will be clipped, and /// since children outside the viewport will be clipped, and therefore cannot
/// therefore cannot render children outside the viewport. /// render children outside the viewport.
/// {@endtemplate} /// {@endtemplate}
bool get renderChildrenOutsideViewport => _renderChildrenOutsideViewport; bool get renderChildrenOutsideViewport => _renderChildrenOutsideViewport;
bool _renderChildrenOutsideViewport; bool _renderChildrenOutsideViewport;
...@@ -475,7 +473,7 @@ class RenderListWheelViewport ...@@ -475,7 +473,7 @@ class RenderListWheelViewport
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.hardEdge], and must not be null. /// Defaults to [Clip.hardEdge].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
......
...@@ -812,8 +812,6 @@ abstract class Constraints { ...@@ -812,8 +812,6 @@ abstract class Constraints {
/// Signature for a function that is called for each [RenderObject]. /// Signature for a function that is called for each [RenderObject].
/// ///
/// Used by [RenderObject.visitChildren] and [RenderObject.visitChildrenForSemantics]. /// Used by [RenderObject.visitChildren] and [RenderObject.visitChildrenForSemantics].
///
/// The `child` argument must not be null.
typedef RenderObjectVisitor = void Function(RenderObject child); typedef RenderObjectVisitor = void Function(RenderObject child);
/// Signature for a function that is called during layout. /// Signature for a function that is called during layout.
......
...@@ -255,9 +255,6 @@ mixin RenderInlineChildrenContainerDefaults on RenderBox, ContainerRenderObjectM ...@@ -255,9 +255,6 @@ mixin RenderInlineChildrenContainerDefaults on RenderBox, ContainerRenderObjectM
class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBox, TextParentData>, RenderInlineChildrenContainerDefaults, RelayoutWhenSystemFontsChangeMixin { class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBox, TextParentData>, RenderInlineChildrenContainerDefaults, RelayoutWhenSystemFontsChangeMixin {
/// Creates a paragraph render object. /// Creates a paragraph render object.
/// ///
/// The [text], [textAlign], [textDirection], [overflow], [softWrap], and
/// [textScaler] arguments must not be null.
///
/// The [maxLines] property may be null (and indeed defaults to null), but if /// The [maxLines] property may be null (and indeed defaults to null), but if
/// it is not null, it must be greater than zero. /// it is not null, it must be greater than zero.
RenderParagraph(InlineSpan text, { RenderParagraph(InlineSpan text, {
...@@ -463,8 +460,6 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo ...@@ -463,8 +460,6 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo
/// and the Hebrew phrase to its right, while in a [TextDirection.rtl] /// and the Hebrew phrase to its right, while in a [TextDirection.rtl]
/// context, the English phrase will be on the right and the Hebrew phrase on /// context, the English phrase will be on the right and the Hebrew phrase on
/// its left. /// its left.
///
/// This must not be null.
TextDirection get textDirection => _textPainter.textDirection!; TextDirection get textDirection => _textPainter.textDirection!;
set textDirection(TextDirection value) { set textDirection(TextDirection value) {
if (_textPainter.textDirection == value) { if (_textPainter.textDirection == value) {
...@@ -941,8 +936,7 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo ...@@ -941,8 +936,7 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo
/// ///
/// The [boxHeightStyle] and [boxWidthStyle] arguments may be used to select /// The [boxHeightStyle] and [boxWidthStyle] arguments may be used to select
/// the shape of the [TextBox]es. These properties default to /// the shape of the [TextBox]es. These properties default to
/// [ui.BoxHeightStyle.tight] and [ui.BoxWidthStyle.tight] respectively and /// [ui.BoxHeightStyle.tight] and [ui.BoxWidthStyle.tight] respectively.
/// must not be null.
/// ///
/// A given selection might have more than one rect if the [RenderParagraph] /// A given selection might have more than one rect if the [RenderParagraph]
/// contains multiple [InlineSpan]s or bidirectional text, because logically /// contains multiple [InlineSpan]s or bidirectional text, because logically
......
...@@ -59,9 +59,6 @@ enum PerformanceOverlayOption { ...@@ -59,9 +59,6 @@ enum PerformanceOverlayOption {
/// to true. /// to true.
class RenderPerformanceOverlay extends RenderBox { class RenderPerformanceOverlay extends RenderBox {
/// Creates a performance overlay render object. /// Creates a performance overlay render object.
///
/// The [optionsMask], [rasterizerThreshold], [checkerboardRasterCacheImages],
/// and [checkerboardOffscreenLayers] arguments must not be null.
RenderPerformanceOverlay({ RenderPerformanceOverlay({
int optionsMask = 0, int optionsMask = 0,
int rasterizerThreshold = 0, int rasterizerThreshold = 0,
......
...@@ -122,7 +122,7 @@ class RenderAndroidView extends PlatformViewRenderBox { ...@@ -122,7 +122,7 @@ class RenderAndroidView extends PlatformViewRenderBox {
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.hardEdge], and must not be null. /// Defaults to [Clip.hardEdge].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
...@@ -404,8 +404,6 @@ abstract class RenderDarwinPlatformView<T extends DarwinPlatformViewController> ...@@ -404,8 +404,6 @@ abstract class RenderDarwinPlatformView<T extends DarwinPlatformViewController>
/// * [PlatformViewsService], which is a service for controlling platform views. /// * [PlatformViewsService], which is a service for controlling platform views.
class RenderUiKitView extends RenderDarwinPlatformView<UiKitViewController> { class RenderUiKitView extends RenderDarwinPlatformView<UiKitViewController> {
/// Creates a render object for an iOS UIView. /// Creates a render object for an iOS UIView.
///
/// The `viewId`, `hitTestBehavior`, and `gestureRecognizers` parameters must not be null.
RenderUiKitView({ RenderUiKitView({
required super.viewController, required super.viewController,
required super.hitTestBehavior, required super.hitTestBehavior,
...@@ -655,8 +653,6 @@ class _PlatformViewGestureRecognizer extends OneSequenceGestureRecognizer { ...@@ -655,8 +653,6 @@ class _PlatformViewGestureRecognizer extends OneSequenceGestureRecognizer {
/// integrates it with the gesture arenas system and adds relevant semantic nodes to the semantics tree. /// integrates it with the gesture arenas system and adds relevant semantic nodes to the semantics tree.
class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin { class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
/// Creating a render object for a [PlatformViewSurface]. /// Creating a render object for a [PlatformViewSurface].
///
/// The `controller` parameter must not be null.
PlatformViewRenderBox({ PlatformViewRenderBox({
required PlatformViewController controller, required PlatformViewController controller,
required PlatformViewHitTestBehavior hitTestBehavior, required PlatformViewHitTestBehavior hitTestBehavior,
...@@ -670,7 +666,7 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin { ...@@ -670,7 +666,7 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
/// The controller for this render object. /// The controller for this render object.
PlatformViewController get controller => _controller; PlatformViewController get controller => _controller;
PlatformViewController _controller; PlatformViewController _controller;
/// This value must not be null, and setting it to a new value will result in a repaint. /// Setting this value to a new value will result in a repaint.
set controller(covariant PlatformViewController controller) { set controller(covariant PlatformViewController controller) {
assert(controller.viewId > -1); assert(controller.viewId > -1);
......
...@@ -118,14 +118,11 @@ class RenderSliverOpacity extends RenderProxySliver { ...@@ -118,14 +118,11 @@ class RenderSliverOpacity extends RenderProxySliver {
/// The fraction to scale the child's alpha value. /// The fraction to scale the child's alpha value.
/// ///
/// An opacity of 1.0 is fully opaque. An opacity of 0.0 is fully transparent /// An opacity of one is fully opaque. An opacity of zero is fully transparent
/// (i.e. invisible). /// (i.e. invisible).
/// ///
/// The opacity must not be null. /// Values one and zero are painted with a fast path. Other values require
/// /// painting the child into an intermediate buffer, which is expensive.
/// Values 1.0 and 0.0 are painted with a fast path. Other values
/// require painting the child into an intermediate buffer, which is
/// expensive.
double get opacity => _opacity; double get opacity => _opacity;
double _opacity; double _opacity;
set opacity(double value) { set opacity(double value) {
...@@ -215,8 +212,6 @@ class RenderSliverOpacity extends RenderProxySliver { ...@@ -215,8 +212,6 @@ class RenderSliverOpacity extends RenderProxySliver {
/// {@macro flutter.widgets.IgnorePointer.ignoringSemantics} /// {@macro flutter.widgets.IgnorePointer.ignoringSemantics}
class RenderSliverIgnorePointer extends RenderProxySliver { class RenderSliverIgnorePointer extends RenderProxySliver {
/// Creates a render object that is invisible to hit testing. /// Creates a render object that is invisible to hit testing.
///
/// The [ignoring] argument must not be null.
RenderSliverIgnorePointer({ RenderSliverIgnorePointer({
RenderSliver? sliver, RenderSliver? sliver,
bool ignoring = true, bool ignoring = true,
...@@ -410,8 +405,6 @@ class RenderSliverOffstage extends RenderProxySliver { ...@@ -410,8 +405,6 @@ class RenderSliverOffstage extends RenderProxySliver {
/// rather than a [double] to control the opacity. /// rather than a [double] to control the opacity.
class RenderSliverAnimatedOpacity extends RenderProxySliver with RenderAnimatedOpacityMixin<RenderSliver> { class RenderSliverAnimatedOpacity extends RenderProxySliver with RenderAnimatedOpacityMixin<RenderSliver> {
/// Creates a partially transparent render object. /// Creates a partially transparent render object.
///
/// The [opacity] argument must not be null.
RenderSliverAnimatedOpacity({ RenderSliverAnimatedOpacity({
required Animation<double> opacity, required Animation<double> opacity,
bool alwaysIncludeSemantics = false, bool alwaysIncludeSemantics = false,
...@@ -431,7 +424,7 @@ class RenderSliverAnimatedOpacity extends RenderProxySliver with RenderAnimatedO ...@@ -431,7 +424,7 @@ class RenderSliverAnimatedOpacity extends RenderProxySliver with RenderAnimatedO
class RenderSliverConstrainedCrossAxis extends RenderProxySliver { class RenderSliverConstrainedCrossAxis extends RenderProxySliver {
/// Creates a render object that constrains the cross axis extent of its sliver child. /// Creates a render object that constrains the cross axis extent of its sliver child.
/// ///
/// The [maxExtent] parameter must not be null and must be nonnegative. /// The [maxExtent] parameter must be nonnegative.
RenderSliverConstrainedCrossAxis({ RenderSliverConstrainedCrossAxis({
required double maxExtent required double maxExtent
}) : _maxExtent = maxExtent, }) : _maxExtent = maxExtent,
......
...@@ -19,8 +19,6 @@ const double _kQuarterTurnsInRadians = math.pi / 2.0; ...@@ -19,8 +19,6 @@ const double _kQuarterTurnsInRadians = math.pi / 2.0;
/// rotated box consumes only as much space as required by the rotated child. /// rotated box consumes only as much space as required by the rotated child.
class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderBox> { class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderBox> {
/// Creates a rotated render box. /// Creates a rotated render box.
///
/// The [quarterTurns] argument must not be null.
RenderRotatedBox({ RenderRotatedBox({
required int quarterTurns, required int quarterTurns,
RenderBox? child, RenderBox? child,
......
...@@ -421,8 +421,6 @@ class SelectionEdgeUpdateEvent extends SelectionEvent { ...@@ -421,8 +421,6 @@ class SelectionEdgeUpdateEvent extends SelectionEvent {
/// [isEnd], according to the [granularity]. /// [isEnd], according to the [granularity].
class GranularlyExtendSelectionEvent extends SelectionEvent { class GranularlyExtendSelectionEvent extends SelectionEvent {
/// Creates a [GranularlyExtendSelectionEvent]. /// Creates a [GranularlyExtendSelectionEvent].
///
/// All parameters are required and must not be null.
const GranularlyExtendSelectionEvent({ const GranularlyExtendSelectionEvent({
required this.forward, required this.forward,
required this.isEnd, required this.isEnd,
...@@ -499,8 +497,6 @@ enum SelectionExtendDirection { ...@@ -499,8 +497,6 @@ enum SelectionExtendDirection {
/// move to when moving to across lines. /// move to when moving to across lines.
class DirectionallyExtendSelectionEvent extends SelectionEvent { class DirectionallyExtendSelectionEvent extends SelectionEvent {
/// Creates a [DirectionallyExtendSelectionEvent]. /// Creates a [DirectionallyExtendSelectionEvent].
///
/// All parameters are required and must not be null.
const DirectionallyExtendSelectionEvent({ const DirectionallyExtendSelectionEvent({
required this.dx, required this.dx,
required this.isEnd, required this.isEnd,
...@@ -706,8 +702,6 @@ class SelectionGeometry { ...@@ -706,8 +702,6 @@ class SelectionGeometry {
@immutable @immutable
class SelectionPoint with Diagnosticable { class SelectionPoint with Diagnosticable {
/// Creates a selection point object. /// Creates a selection point object.
///
/// All properties must not be null.
const SelectionPoint({ const SelectionPoint({
required this.localPosition, required this.localPosition,
required this.lineHeight, required this.lineHeight,
......
...@@ -102,7 +102,7 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi ...@@ -102,7 +102,7 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi
class RenderPadding extends RenderShiftedBox { class RenderPadding extends RenderShiftedBox {
/// Creates a render object that insets its child. /// Creates a render object that insets its child.
/// ///
/// The [padding] argument must not be null and must have non-negative insets. /// The [padding] argument must have non-negative insets.
RenderPadding({ RenderPadding({
required EdgeInsetsGeometry padding, required EdgeInsetsGeometry padding,
TextDirection? textDirection, TextDirection? textDirection,
...@@ -267,8 +267,6 @@ class RenderPadding extends RenderShiftedBox { ...@@ -267,8 +267,6 @@ class RenderPadding extends RenderShiftedBox {
abstract class RenderAligningShiftedBox extends RenderShiftedBox { abstract class RenderAligningShiftedBox extends RenderShiftedBox {
/// Initializes member variables for subclasses. /// Initializes member variables for subclasses.
/// ///
/// The [alignment] argument must not be null.
///
/// The [textDirection] must be non-null if the [alignment] is /// The [textDirection] must be non-null if the [alignment] is
/// direction-sensitive. /// direction-sensitive.
RenderAligningShiftedBox({ RenderAligningShiftedBox({
...@@ -308,8 +306,6 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox { ...@@ -308,8 +306,6 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
AlignmentGeometry get alignment => _alignment; AlignmentGeometry get alignment => _alignment;
AlignmentGeometry _alignment; AlignmentGeometry _alignment;
/// Sets the alignment to a new value, and triggers a layout update. /// Sets the alignment to a new value, and triggers a layout update.
///
/// The new alignment must not be null.
set alignment(AlignmentGeometry value) { set alignment(AlignmentGeometry value) {
if (_alignment == value) { if (_alignment == value) {
return; return;
...@@ -685,8 +681,6 @@ class RenderConstrainedOverflowBox extends RenderAligningShiftedBox { ...@@ -685,8 +681,6 @@ class RenderConstrainedOverflowBox extends RenderAligningShiftedBox {
class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugOverflowIndicatorMixin { class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugOverflowIndicatorMixin {
/// Creates a [RenderBox] that sizes itself to the child and modifies the /// Creates a [RenderBox] that sizes itself to the child and modifies the
/// [constraints] before passing it down to that child. /// [constraints] before passing it down to that child.
///
/// The [alignment] and [clipBehavior] must not be null.
RenderConstraintsTransformBox({ RenderConstraintsTransformBox({
required super.alignment, required super.alignment,
required super.textDirection, required super.textDirection,
...@@ -877,8 +871,6 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO ...@@ -877,8 +871,6 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO
class RenderSizedOverflowBox extends RenderAligningShiftedBox { class RenderSizedOverflowBox extends RenderAligningShiftedBox {
/// Creates a render box of a given size that lets its child overflow. /// Creates a render box of a given size that lets its child overflow.
/// ///
/// The [requestedSize] and [alignment] arguments must not be null.
///
/// The [textDirection] argument must not be null if the [alignment] is /// The [textDirection] argument must not be null if the [alignment] is
/// direction-sensitive. /// direction-sensitive.
RenderSizedOverflowBox({ RenderSizedOverflowBox({
...@@ -959,8 +951,6 @@ class RenderFractionallySizedOverflowBox extends RenderAligningShiftedBox { ...@@ -959,8 +951,6 @@ class RenderFractionallySizedOverflowBox extends RenderAligningShiftedBox {
/// If non-null, the [widthFactor] and [heightFactor] arguments must be /// If non-null, the [widthFactor] and [heightFactor] arguments must be
/// non-negative. /// non-negative.
/// ///
/// The [alignment] must not be null.
///
/// The [textDirection] must be non-null if the [alignment] is /// The [textDirection] must be non-null if the [alignment] is
/// direction-sensitive. /// direction-sensitive.
RenderFractionallySizedOverflowBox({ RenderFractionallySizedOverflowBox({
...@@ -1313,8 +1303,6 @@ class RenderCustomSingleChildLayoutBox extends RenderShiftedBox { ...@@ -1313,8 +1303,6 @@ class RenderCustomSingleChildLayoutBox extends RenderShiftedBox {
/// and the bottom of the box. /// and the bottom of the box.
class RenderBaseline extends RenderShiftedBox { class RenderBaseline extends RenderShiftedBox {
/// Creates a [RenderBaseline] object. /// Creates a [RenderBaseline] object.
///
/// The [baseline] and [baselineType] arguments must not be null.
RenderBaseline({ RenderBaseline({
RenderBox? child, RenderBox? child,
required double baseline, required double baseline,
......
...@@ -183,8 +183,6 @@ ScrollDirection applyGrowthDirectionToScrollDirection(ScrollDirection scrollDire ...@@ -183,8 +183,6 @@ ScrollDirection applyGrowthDirectionToScrollDirection(ScrollDirection scrollDire
/// offset. /// offset.
class SliverConstraints extends Constraints { class SliverConstraints extends Constraints {
/// Creates sliver constraints with the given information. /// Creates sliver constraints with the given information.
///
/// All of the argument must not be null.
const SliverConstraints({ const SliverConstraints({
required this.axisDirection, required this.axisDirection,
required this.growthDirection, required this.growthDirection,
...@@ -620,8 +618,6 @@ class SliverGeometry with Diagnosticable { ...@@ -620,8 +618,6 @@ class SliverGeometry with Diagnosticable {
/// [paintExtent]. If the [hitTestExtent] argument is null, [hitTestExtent] /// [paintExtent]. If the [hitTestExtent] argument is null, [hitTestExtent]
/// defaults to the [paintExtent]. If [visible] is null, [visible] defaults to /// defaults to the [paintExtent]. If [visible] is null, [visible] defaults to
/// whether [paintExtent] is greater than zero. /// whether [paintExtent] is greater than zero.
///
/// The other arguments must not be null.
const SliverGeometry({ const SliverGeometry({
this.scrollExtent = 0.0, this.scrollExtent = 0.0,
this.paintExtent = 0.0, this.paintExtent = 0.0,
...@@ -997,8 +993,6 @@ class SliverHitTestResult extends HitTestResult { ...@@ -997,8 +993,6 @@ class SliverHitTestResult extends HitTestResult {
/// [AxisDirection] of the target sliver. /// [AxisDirection] of the target sliver.
class SliverHitTestEntry extends HitTestEntry<RenderSliver> { class SliverHitTestEntry extends HitTestEntry<RenderSliver> {
/// Creates a sliver hit test entry. /// Creates a sliver hit test entry.
///
/// The [mainAxisPosition] and [crossAxisPosition] arguments must not be null.
SliverHitTestEntry( SliverHitTestEntry(
super.target, { super.target, {
required this.mainAxisPosition, required this.mainAxisPosition,
......
...@@ -27,8 +27,6 @@ import 'sliver_fixed_extent_list.dart'; ...@@ -27,8 +27,6 @@ import 'sliver_fixed_extent_list.dart';
class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor { class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor {
/// Creates a sliver that contains multiple box children that each fill the /// Creates a sliver that contains multiple box children that each fill the
/// viewport. /// viewport.
///
/// The [childManager] argument must not be null.
RenderSliverFillViewport({ RenderSliverFillViewport({
required super.childManager, required super.childManager,
double viewportFraction = 1.0, double viewportFraction = 1.0,
......
...@@ -38,8 +38,6 @@ import 'sliver_multi_box_adaptor.dart'; ...@@ -38,8 +38,6 @@ import 'sliver_multi_box_adaptor.dart';
abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAdaptor { abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAdaptor {
/// Creates a sliver that contains multiple box children that have the same /// Creates a sliver that contains multiple box children that have the same
/// extent in the main axis. /// extent in the main axis.
///
/// The [childManager] argument must not be null.
RenderSliverFixedExtentBoxAdaptor({ RenderSliverFixedExtentBoxAdaptor({
required super.childManager, required super.childManager,
}); });
...@@ -411,8 +409,6 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda ...@@ -411,8 +409,6 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
class RenderSliverFixedExtentList extends RenderSliverFixedExtentBoxAdaptor { class RenderSliverFixedExtentList extends RenderSliverFixedExtentBoxAdaptor {
/// Creates a sliver that contains multiple box children that have a given /// Creates a sliver that contains multiple box children that have a given
/// extent in the main axis. /// extent in the main axis.
///
/// The [childManager] argument must not be null.
RenderSliverFixedExtentList({ RenderSliverFixedExtentList({
required super.childManager, required super.childManager,
required double itemExtent, required double itemExtent,
......
...@@ -165,8 +165,8 @@ abstract class SliverGridLayout { ...@@ -165,8 +165,8 @@ abstract class SliverGridLayout {
class SliverGridRegularTileLayout extends SliverGridLayout { class SliverGridRegularTileLayout extends SliverGridLayout {
/// Creates a layout that uses equally sized and spaced tiles. /// Creates a layout that uses equally sized and spaced tiles.
/// ///
/// All of the arguments must not be null and must not be negative. The /// All of the arguments must not be negative. The `crossAxisCount` argument
/// `crossAxisCount` argument must be greater than zero. /// must be greater than zero.
const SliverGridRegularTileLayout({ const SliverGridRegularTileLayout({
required this.crossAxisCount, required this.crossAxisCount,
required this.mainAxisStride, required this.mainAxisStride,
...@@ -336,7 +336,6 @@ class SliverGridDelegateWithFixedCrossAxisCount extends SliverGridDelegate { ...@@ -336,7 +336,6 @@ class SliverGridDelegateWithFixedCrossAxisCount extends SliverGridDelegate {
/// Creates a delegate that makes grid layouts with a fixed number of tiles in /// Creates a delegate that makes grid layouts with a fixed number of tiles in
/// the cross axis. /// the cross axis.
/// ///
/// All of the arguments except [mainAxisExtent] must not be null.
/// The `mainAxisSpacing`, `mainAxisExtent` and `crossAxisSpacing` arguments /// The `mainAxisSpacing`, `mainAxisExtent` and `crossAxisSpacing` arguments
/// must not be negative. The `crossAxisCount` and `childAspectRatio` /// must not be negative. The `crossAxisCount` and `childAspectRatio`
/// arguments must be greater than zero. /// arguments must be greater than zero.
...@@ -435,7 +434,6 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate { ...@@ -435,7 +434,6 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate {
/// Creates a delegate that makes grid layouts with tiles that have a maximum /// Creates a delegate that makes grid layouts with tiles that have a maximum
/// cross-axis extent. /// cross-axis extent.
/// ///
/// All of the arguments except [mainAxisExtent] must not be null.
/// The [maxCrossAxisExtent], [mainAxisExtent], [mainAxisSpacing], /// The [maxCrossAxisExtent], [mainAxisExtent], [mainAxisSpacing],
/// and [crossAxisSpacing] arguments must not be negative. /// and [crossAxisSpacing] arguments must not be negative.
/// The [childAspectRatio] argument must be greater than zero. /// The [childAspectRatio] argument must be greater than zero.
...@@ -549,8 +547,6 @@ class SliverGridParentData extends SliverMultiBoxAdaptorParentData { ...@@ -549,8 +547,6 @@ class SliverGridParentData extends SliverMultiBoxAdaptorParentData {
class RenderSliverGrid extends RenderSliverMultiBoxAdaptor { class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
/// Creates a sliver that contains multiple box children that whose size and /// Creates a sliver that contains multiple box children that whose size and
/// position are determined by a delegate. /// position are determined by a delegate.
///
/// The [childManager] and [gridDelegate] arguments must not be null.
RenderSliverGrid({ RenderSliverGrid({
required super.childManager, required super.childManager,
required SliverGridDelegate gridDelegate, required SliverGridDelegate gridDelegate,
......
...@@ -36,8 +36,6 @@ import 'sliver_multi_box_adaptor.dart'; ...@@ -36,8 +36,6 @@ import 'sliver_multi_box_adaptor.dart';
class RenderSliverList extends RenderSliverMultiBoxAdaptor { class RenderSliverList extends RenderSliverMultiBoxAdaptor {
/// Creates a sliver that places multiple box children in a linear array along /// Creates a sliver that places multiple box children in a linear array along
/// the main axis. /// the main axis.
///
/// The [childManager] argument must not be null.
RenderSliverList({ RenderSliverList({
required super.childManager, required super.childManager,
}); });
......
...@@ -184,8 +184,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -184,8 +184,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
RenderSliverHelpers, RenderSliverWithKeepAliveMixin { RenderSliverHelpers, RenderSliverWithKeepAliveMixin {
/// Creates a sliver with multiple box children. /// Creates a sliver with multiple box children.
///
/// The [childManager] argument must not be null.
RenderSliverMultiBoxAdaptor({ RenderSliverMultiBoxAdaptor({
required RenderSliverBoxChildManager childManager, required RenderSliverBoxChildManager childManager,
}) : _childManager = childManager { }) : _childManager = childManager {
......
...@@ -298,7 +298,7 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -298,7 +298,7 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
class RenderSliverPadding extends RenderSliverEdgeInsetsPadding { class RenderSliverPadding extends RenderSliverEdgeInsetsPadding {
/// Creates a render object that insets its child in a viewport. /// Creates a render object that insets its child in a viewport.
/// ///
/// The [padding] argument must not be null and must have non-negative insets. /// The [padding] argument must have non-negative insets.
RenderSliverPadding({ RenderSliverPadding({
required EdgeInsetsGeometry padding, required EdgeInsetsGeometry padding,
TextDirection? textDirection, TextDirection? textDirection,
......
...@@ -18,13 +18,9 @@ import 'object.dart'; ...@@ -18,13 +18,9 @@ import 'object.dart';
/// container, this class has no width and height members. To determine the /// container, this class has no width and height members. To determine the
/// width or height of the rectangle, convert it to a [Rect] using [toRect()] /// width or height of the rectangle, convert it to a [Rect] using [toRect()]
/// (passing the container's own Rect), and then examine that object. /// (passing the container's own Rect), and then examine that object.
///
/// The fields [left], [right], [bottom], and [top] must not be null.
@immutable @immutable
class RelativeRect { class RelativeRect {
/// Creates a RelativeRect with the given values. /// Creates a RelativeRect with the given values.
///
/// The arguments must not be null.
const RelativeRect.fromLTRB(this.left, this.top, this.right, this.bottom); const RelativeRect.fromLTRB(this.left, this.top, this.right, this.bottom);
/// Creates a RelativeRect from a Rect and a Size. The Rect (first argument) /// Creates a RelativeRect from a Rect and a Size. The Rect (first argument)
......
...@@ -132,8 +132,6 @@ class IntrinsicColumnWidth extends TableColumnWidth { ...@@ -132,8 +132,6 @@ class IntrinsicColumnWidth extends TableColumnWidth {
/// This is the cheapest way to size a column. /// This is the cheapest way to size a column.
class FixedColumnWidth extends TableColumnWidth { class FixedColumnWidth extends TableColumnWidth {
/// Creates a column width based on a fixed number of logical pixels. /// Creates a column width based on a fixed number of logical pixels.
///
/// The [value] argument must not be null.
const FixedColumnWidth(this.value); const FixedColumnWidth(this.value);
/// The width the column should occupy in logical pixels. /// The width the column should occupy in logical pixels.
...@@ -159,8 +157,6 @@ class FixedColumnWidth extends TableColumnWidth { ...@@ -159,8 +157,6 @@ class FixedColumnWidth extends TableColumnWidth {
class FractionColumnWidth extends TableColumnWidth { class FractionColumnWidth extends TableColumnWidth {
/// Creates a column width based on a fraction of the table's constraints' /// Creates a column width based on a fraction of the table's constraints'
/// maxWidth. /// maxWidth.
///
/// The [value] argument must not be null.
const FractionColumnWidth(this.value); const FractionColumnWidth(this.value);
/// The fraction of the table's constraints' maxWidth that this column should /// The fraction of the table's constraints' maxWidth that this column should
...@@ -197,8 +193,6 @@ class FractionColumnWidth extends TableColumnWidth { ...@@ -197,8 +193,6 @@ class FractionColumnWidth extends TableColumnWidth {
class FlexColumnWidth extends TableColumnWidth { class FlexColumnWidth extends TableColumnWidth {
/// Creates a column width based on a fraction of the remaining space once all /// Creates a column width based on a fraction of the remaining space once all
/// the other columns have been laid out. /// the other columns have been laid out.
///
/// The [value] argument must not be null.
const FlexColumnWidth([this.value = 1.0]); const FlexColumnWidth([this.value = 1.0]);
/// The fraction of the remaining space once all the other columns have /// The fraction of the remaining space once all the other columns have
...@@ -369,8 +363,6 @@ class RenderTable extends RenderBox { ...@@ -369,8 +363,6 @@ class RenderTable extends RenderBox {
/// * `children` must either be null or contain lists of all the same length. /// * `children` must either be null or contain lists of all the same length.
/// if `children` is not null, then `rows` must be null. /// if `children` is not null, then `rows` must be null.
/// * [columnWidths] may be null, in which case it defaults to an empty map. /// * [columnWidths] may be null, in which case it defaults to an empty map.
/// * [defaultColumnWidth] must not be null.
/// * [configuration] must not be null (but has a default value).
RenderTable({ RenderTable({
int? columns, int? columns,
int? rows, int? rows,
......
...@@ -204,9 +204,6 @@ class TableBorder { ...@@ -204,9 +204,6 @@ class TableBorder {
required Iterable<double> rows, required Iterable<double> rows,
required Iterable<double> columns, required Iterable<double> columns,
}) { }) {
// properties can't be null
// arguments can't be null
assert(rows.isEmpty || (rows.first >= 0.0 && rows.last <= rect.height)); assert(rows.isEmpty || (rows.first >= 0.0 && rows.last <= rect.height));
assert(columns.isEmpty || (columns.first >= 0.0 && columns.last <= rect.width)); assert(columns.isEmpty || (columns.first >= 0.0 && columns.last <= rect.width));
......
...@@ -386,7 +386,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix ...@@ -386,7 +386,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.hardEdge], and must not be null. /// Defaults to [Clip.hardEdge].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
...@@ -1138,7 +1138,6 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix ...@@ -1138,7 +1138,6 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
/// in the viewport after it has been revealed. See [RevealedOffset.rect] /// in the viewport after it has been revealed. See [RevealedOffset.rect]
/// for a full definition of this [Rect]. /// for a full definition of this [Rect].
/// ///
/// The parameters `viewport` and `offset` are required and cannot be null.
/// If `descendant` is null, this is a no-op and `rect` is returned. /// If `descendant` is null, this is a no-op and `rect` is returned.
/// ///
/// If both `descendant` and `rect` are null, null is returned because there is /// If both `descendant` and `rect` are null, null is returned because there is
......
...@@ -327,7 +327,7 @@ class RenderWrap extends RenderBox ...@@ -327,7 +327,7 @@ class RenderWrap extends RenderBox
/// {@macro flutter.material.Material.clipBehavior} /// {@macro flutter.material.Material.clipBehavior}
/// ///
/// Defaults to [Clip.none], and must not be null. /// Defaults to [Clip.none].
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.none; Clip _clipBehavior = Clip.none;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment