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