Unverified Commit 9837eb6f authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Remove unnecessary null checks in flutter/rendering (#118923)

parent bae4c1d2
...@@ -82,11 +82,7 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { ...@@ -82,11 +82,7 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
super.textDirection, super.textDirection,
super.child, super.child,
Clip clipBehavior = Clip.hardEdge, Clip clipBehavior = Clip.hardEdge,
}) : assert(vsync != null), }) : _vsync = vsync,
assert(duration != null),
assert(curve != null),
assert(clipBehavior != null),
_vsync = vsync,
_clipBehavior = clipBehavior { _clipBehavior = clipBehavior {
_controller = AnimationController( _controller = AnimationController(
vsync: vsync, vsync: vsync,
...@@ -119,7 +115,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { ...@@ -119,7 +115,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
/// The duration of the animation. /// The duration of the animation.
Duration get duration => _controller.duration!; Duration get duration => _controller.duration!;
set duration(Duration value) { set duration(Duration value) {
assert(value != null);
if (value == _controller.duration) { if (value == _controller.duration) {
return; return;
} }
...@@ -138,7 +133,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { ...@@ -138,7 +133,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
/// The curve of the animation. /// The curve of the animation.
Curve get curve => _animation.curve; Curve get curve => _animation.curve;
set curve(Curve value) { set curve(Curve value) {
assert(value != null);
if (value == _animation.curve) { if (value == _animation.curve) {
return; return;
} }
...@@ -151,7 +145,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { ...@@ -151,7 +145,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsPaint(); markNeedsPaint();
...@@ -169,7 +162,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { ...@@ -169,7 +162,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
TickerProvider get vsync => _vsync; TickerProvider get vsync => _vsync;
TickerProvider _vsync; TickerProvider _vsync;
set vsync(TickerProvider value) { set vsync(TickerProvider value) {
assert(value != null);
if (value == _vsync) { if (value == _vsync) {
return; return;
} }
...@@ -218,7 +210,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { ...@@ -218,7 +210,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
child!.layout(constraints, parentUsesSize: true); child!.layout(constraints, parentUsesSize: true);
assert(_state != null);
switch (_state) { switch (_state) {
case RenderAnimatedSizeState.start: case RenderAnimatedSizeState.start:
_layoutStart(); _layoutStart();
...@@ -253,7 +244,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { ...@@ -253,7 +244,6 @@ class RenderAnimatedSize extends RenderAligningShiftedBox {
// size without modifying global state. See performLayout for comments // size without modifying global state. See performLayout for comments
// explaining the rational behind the implementation. // explaining the rational behind the implementation.
final Size childSize = child!.getDryLayout(constraints); final Size childSize = child!.getDryLayout(constraints);
assert(_state != null);
switch (_state) { switch (_state) {
case RenderAnimatedSizeState.start: case RenderAnimatedSizeState.start:
return constraints.constrain(childSize); return constraints.constrain(childSize);
......
...@@ -43,7 +43,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture ...@@ -43,7 +43,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
..onSemanticsAction = _handleSemanticsAction; ..onSemanticsAction = _handleSemanticsAction;
initRenderView(); initRenderView();
_handleSemanticsEnabledChanged(); _handleSemanticsEnabledChanged();
assert(renderView != null);
addPersistentFrameCallback(_handlePersistentFrameCallback); addPersistentFrameCallback(_handlePersistentFrameCallback);
initMouseTracker(); initMouseTracker();
if (kIsWeb) { if (kIsWeb) {
...@@ -234,7 +233,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture ...@@ -234,7 +233,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
/// Sets the given [RenderView] object (which must not be null), and its tree, to /// Sets the given [RenderView] object (which must not be null), and its tree, to
/// be the new render tree to display. The previous tree, if any, is detached. /// be the new render tree to display. The previous tree, if any, is detached.
set renderView(RenderView value) { set renderView(RenderView value) {
assert(value != null);
_pipelineOwner.rootNode = value; _pipelineOwner.rootNode = value;
} }
...@@ -244,7 +242,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture ...@@ -244,7 +242,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
@protected @protected
@visibleForTesting @visibleForTesting
void handleMetricsChanged() { void handleMetricsChanged() {
assert(renderView != null);
renderView.configuration = createViewConfiguration(); renderView.configuration = createViewConfiguration();
if (renderView.child != null) { if (renderView.child != null) {
scheduleForcedFrame(); scheduleForcedFrame();
...@@ -512,7 +509,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture ...@@ -512,7 +509,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
// When editing the above, also update widgets/binding.dart's copy. // When editing the above, also update widgets/binding.dart's copy.
@protected @protected
void drawFrame() { void drawFrame() {
assert(renderView != null);
pipelineOwner.flushLayout(); pipelineOwner.flushLayout();
pipelineOwner.flushCompositingBits(); pipelineOwner.flushCompositingBits();
pipelineOwner.flushPaint(); pipelineOwner.flushPaint();
...@@ -544,9 +540,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture ...@@ -544,9 +540,6 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
@override @override
void hitTest(HitTestResult result, Offset position) { void hitTest(HitTestResult result, Offset position) {
assert(renderView != null);
assert(result != null);
assert(position != null);
renderView.hitTest(result, position: position); renderView.hitTest(result, position: position);
super.hitTest(result, position); super.hitTest(result, position);
} }
...@@ -620,7 +613,6 @@ class RenderingFlutterBinding extends BindingBase with GestureBinding, Scheduler ...@@ -620,7 +613,6 @@ class RenderingFlutterBinding extends BindingBase with GestureBinding, Scheduler
/// This binding does not automatically schedule any frames. Callers are /// This binding does not automatically schedule any frames. Callers are
/// responsible for deciding when to first call [scheduleFrame]. /// responsible for deciding when to first call [scheduleFrame].
RenderingFlutterBinding({ RenderBox? root }) { RenderingFlutterBinding({ RenderBox? root }) {
assert(renderView != null);
renderView.child = root; renderView.child = root;
} }
......
...@@ -96,10 +96,7 @@ class BoxConstraints extends Constraints { ...@@ -96,10 +96,7 @@ class BoxConstraints extends Constraints {
this.maxWidth = double.infinity, this.maxWidth = double.infinity,
this.minHeight = 0.0, this.minHeight = 0.0,
this.maxHeight = double.infinity, this.maxHeight = double.infinity,
}) : assert(minWidth != null), });
assert(maxWidth != null),
assert(minHeight != null),
assert(maxHeight != null);
/// Creates box constraints that is respected only by the given size. /// Creates box constraints that is respected only by the given size.
BoxConstraints.tight(Size size) BoxConstraints.tight(Size size)
...@@ -190,7 +187,6 @@ class BoxConstraints extends Constraints { ...@@ -190,7 +187,6 @@ class BoxConstraints extends Constraints {
/// Returns new box constraints that are smaller by the given edge dimensions. /// Returns new box constraints that are smaller by the given edge dimensions.
BoxConstraints deflate(EdgeInsets edges) { BoxConstraints deflate(EdgeInsets edges) {
assert(edges != null);
assert(debugAssertIsValid()); assert(debugAssertIsValid());
final double horizontal = edges.horizontal; final double horizontal = edges.horizontal;
final double vertical = edges.vertical; final double vertical = edges.vertical;
...@@ -472,7 +468,6 @@ class BoxConstraints extends Constraints { ...@@ -472,7 +468,6 @@ class BoxConstraints extends Constraints {
/// ///
/// {@macro dart.ui.shadow.lerp} /// {@macro dart.ui.shadow.lerp}
static BoxConstraints? lerp(BoxConstraints? a, BoxConstraints? b, double t) { static BoxConstraints? lerp(BoxConstraints? a, BoxConstraints? b, double t) {
assert(t != null);
if (a == null && b == null) { if (a == null && b == null) {
return null; return null;
} }
...@@ -762,8 +757,6 @@ class BoxHitTestResult extends HitTestResult { ...@@ -762,8 +757,6 @@ class BoxHitTestResult extends HitTestResult {
required Offset position, required Offset position,
required BoxHitTest hitTest, required BoxHitTest hitTest,
}) { }) {
assert(position != null);
assert(hitTest != null);
if (transform != null) { if (transform != null) {
transform = Matrix4.tryInvert(PointerEvent.removePerspectiveTransform(transform)); transform = Matrix4.tryInvert(PointerEvent.removePerspectiveTransform(transform));
if (transform == null) { if (transform == null) {
...@@ -801,8 +794,6 @@ class BoxHitTestResult extends HitTestResult { ...@@ -801,8 +794,6 @@ class BoxHitTestResult extends HitTestResult {
required Offset position, required Offset position,
required BoxHitTest hitTest, required BoxHitTest hitTest,
}) { }) {
assert(position != null);
assert(hitTest != null);
final Offset transformedPosition = offset == null ? position : position - offset; final Offset transformedPosition = offset == null ? position : position - offset;
if (offset != null) { if (offset != null) {
pushOffset(-offset); pushOffset(-offset);
...@@ -838,9 +829,6 @@ class BoxHitTestResult extends HitTestResult { ...@@ -838,9 +829,6 @@ class BoxHitTestResult extends HitTestResult {
required Offset position, required Offset position,
required BoxHitTest hitTest, required BoxHitTest hitTest,
}) { }) {
assert(position != null);
assert(hitTest != null);
assert(position != null);
final Offset transformedPosition = transform == null ? final Offset transformedPosition = transform == null ?
position : MatrixUtils.transformPoint(transform, position); position : MatrixUtils.transformPoint(transform, position);
if (transform != null) { if (transform != null) {
...@@ -887,7 +875,6 @@ class BoxHitTestResult extends HitTestResult { ...@@ -887,7 +875,6 @@ class BoxHitTestResult extends HitTestResult {
Matrix4? rawTransform, Matrix4? rawTransform,
required BoxHitTestWithOutOfBandPosition hitTest, required BoxHitTestWithOutOfBandPosition hitTest,
}) { }) {
assert(hitTest != null);
assert( assert(
(paintOffset == null && paintTransform == null && rawTransform != null) || (paintOffset == null && paintTransform == null && rawTransform != null) ||
(paintOffset == null && paintTransform != null && rawTransform == null) || (paintOffset == null && paintTransform != null && rawTransform == null) ||
...@@ -915,8 +902,7 @@ class BoxHitTestEntry extends HitTestEntry<RenderBox> { ...@@ -915,8 +902,7 @@ class BoxHitTestEntry extends HitTestEntry<RenderBox> {
/// Creates a box hit test entry. /// Creates a box hit test entry.
/// ///
/// The [localPosition] argument must not be null. /// The [localPosition] argument must not be null.
BoxHitTestEntry(super.target, this.localPosition) BoxHitTestEntry(super.target, this.localPosition);
: assert(localPosition != null);
/// The position of the hit test in the local coordinates of [target]. /// The position of the hit test in the local coordinates of [target].
final Offset localPosition; final Offset localPosition;
...@@ -1452,13 +1438,6 @@ abstract class RenderBox extends RenderObject { ...@@ -1452,13 +1438,6 @@ abstract class RenderBox extends RenderObject {
@mustCallSuper @mustCallSuper
double getMinIntrinsicWidth(double height) { double getMinIntrinsicWidth(double height) {
assert(() { assert(() {
if (height == null) {
throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('The height argument to getMinIntrinsicWidth was null.'),
ErrorDescription('The argument to getMinIntrinsicWidth must not be negative or null.'),
ErrorHint('If you do not have a specific height in mind, then pass double.infinity instead.'),
]);
}
if (height < 0.0) { if (height < 0.0) {
throw FlutterError.fromParts(<DiagnosticsNode>[ throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('The height argument to getMinIntrinsicWidth was negative.'), ErrorSummary('The height argument to getMinIntrinsicWidth was negative.'),
...@@ -1601,13 +1580,6 @@ abstract class RenderBox extends RenderObject { ...@@ -1601,13 +1580,6 @@ abstract class RenderBox extends RenderObject {
@mustCallSuper @mustCallSuper
double getMaxIntrinsicWidth(double height) { double getMaxIntrinsicWidth(double height) {
assert(() { assert(() {
if (height == null) {
throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('The height argument to getMaxIntrinsicWidth was null.'),
ErrorDescription('The argument to getMaxIntrinsicWidth must not be negative or null.'),
ErrorHint('If you do not have a specific height in mind, then pass double.infinity instead.'),
]);
}
if (height < 0.0) { if (height < 0.0) {
throw FlutterError.fromParts(<DiagnosticsNode>[ throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('The height argument to getMaxIntrinsicWidth was negative.'), ErrorSummary('The height argument to getMaxIntrinsicWidth was negative.'),
...@@ -1684,13 +1656,6 @@ abstract class RenderBox extends RenderObject { ...@@ -1684,13 +1656,6 @@ abstract class RenderBox extends RenderObject {
@mustCallSuper @mustCallSuper
double getMinIntrinsicHeight(double width) { double getMinIntrinsicHeight(double width) {
assert(() { assert(() {
if (width == null) {
throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('The width argument to getMinIntrinsicHeight was null.'),
ErrorDescription('The argument to getMinIntrinsicHeight must not be negative or null.'),
ErrorHint('If you do not have a specific width in mind, then pass double.infinity instead.'),
]);
}
if (width < 0.0) { if (width < 0.0) {
throw FlutterError.fromParts(<DiagnosticsNode>[ throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('The width argument to getMinIntrinsicHeight was negative.'), ErrorSummary('The width argument to getMinIntrinsicHeight was negative.'),
...@@ -1766,13 +1731,6 @@ abstract class RenderBox extends RenderObject { ...@@ -1766,13 +1731,6 @@ abstract class RenderBox extends RenderObject {
@mustCallSuper @mustCallSuper
double getMaxIntrinsicHeight(double width) { double getMaxIntrinsicHeight(double width) {
assert(() { assert(() {
if (width == null) {
throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('The width argument to getMaxIntrinsicHeight was null.'),
ErrorDescription('The argument to getMaxIntrinsicHeight must not be negative or null.'),
ErrorHint('If you do not have a specific width in mind, then pass double.infinity instead.'),
]);
}
if (width < 0.0) { if (width < 0.0) {
throw FlutterError.fromParts(<DiagnosticsNode>[ throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('The width argument to getMaxIntrinsicHeight was negative.'), ErrorSummary('The width argument to getMaxIntrinsicHeight was negative.'),
...@@ -2253,7 +2211,6 @@ abstract class RenderBox extends RenderObject { ...@@ -2253,7 +2211,6 @@ abstract class RenderBox extends RenderObject {
@override @override
void debugAssertDoesMeetConstraints() { void debugAssertDoesMeetConstraints() {
assert(constraints != null);
assert(() { assert(() {
if (!hasSize) { if (!hasSize) {
final DiagnosticsNode contract; final DiagnosticsNode contract;
...@@ -2582,7 +2539,6 @@ abstract class RenderBox extends RenderObject { ...@@ -2582,7 +2539,6 @@ abstract class RenderBox extends RenderObject {
/// child's [parentData] in the [BoxParentData.offset] field. /// child's [parentData] in the [BoxParentData.offset] field.
@override @override
void applyPaintTransform(RenderObject child, Matrix4 transform) { void applyPaintTransform(RenderObject child, Matrix4 transform) {
assert(child != null);
assert(child.parent == this); assert(child.parent == this);
assert(() { assert(() {
if (child.parentData is! BoxParentData) { if (child.parentData is! BoxParentData) {
......
...@@ -187,11 +187,6 @@ abstract class MultiChildLayoutDelegate { ...@@ -187,11 +187,6 @@ abstract class MultiChildLayoutDelegate {
'There is no child with the id "$childId".', 'There is no child with the id "$childId".',
); );
} }
if (offset == null) {
throw FlutterError(
'The $this custom multichild layout delegate provided a null position for the child with id "$childId".',
);
}
return true; return true;
}()); }());
final MultiChildLayoutParentData childParentData = child!.parentData! as MultiChildLayoutParentData; final MultiChildLayoutParentData childParentData = child!.parentData! as MultiChildLayoutParentData;
...@@ -311,8 +306,7 @@ class RenderCustomMultiChildLayoutBox extends RenderBox ...@@ -311,8 +306,7 @@ class RenderCustomMultiChildLayoutBox extends RenderBox
RenderCustomMultiChildLayoutBox({ RenderCustomMultiChildLayoutBox({
List<RenderBox>? children, List<RenderBox>? children,
required MultiChildLayoutDelegate delegate, required MultiChildLayoutDelegate delegate,
}) : assert(delegate != null), }) : _delegate = delegate {
_delegate = delegate {
addAll(children); addAll(children);
} }
...@@ -327,7 +321,6 @@ class RenderCustomMultiChildLayoutBox extends RenderBox ...@@ -327,7 +321,6 @@ class RenderCustomMultiChildLayoutBox extends RenderBox
MultiChildLayoutDelegate get delegate => _delegate; MultiChildLayoutDelegate get delegate => _delegate;
MultiChildLayoutDelegate _delegate; MultiChildLayoutDelegate _delegate;
set delegate(MultiChildLayoutDelegate newDelegate) { set delegate(MultiChildLayoutDelegate newDelegate) {
assert(newDelegate != null);
if (_delegate == newDelegate) { if (_delegate == newDelegate) {
return; return;
} }
......
...@@ -294,8 +294,7 @@ class CustomPainterSemantics { ...@@ -294,8 +294,7 @@ class CustomPainterSemantics {
required this.properties, required this.properties,
this.transform, this.transform,
this.tags, this.tags,
}) : assert(rect != null), });
assert(properties != null);
/// Identifies this object in a list of siblings. /// Identifies this object in a list of siblings.
/// ///
...@@ -371,8 +370,7 @@ class RenderCustomPaint extends RenderProxyBox { ...@@ -371,8 +370,7 @@ class RenderCustomPaint extends RenderProxyBox {
this.isComplex = false, this.isComplex = false,
this.willChange = false, this.willChange = false,
RenderBox? child, RenderBox? child,
}) : assert(preferredSize != null), }) : _painter = painter,
_painter = painter,
_foregroundPainter = foregroundPainter, _foregroundPainter = foregroundPainter,
_preferredSize = preferredSize, _preferredSize = preferredSize,
super(child); super(child);
...@@ -467,7 +465,6 @@ class RenderCustomPaint extends RenderProxyBox { ...@@ -467,7 +465,6 @@ class RenderCustomPaint extends RenderProxyBox {
Size get preferredSize => _preferredSize; Size get preferredSize => _preferredSize;
Size _preferredSize; Size _preferredSize;
set preferredSize(Size value) { set preferredSize(Size value) {
assert(value != null);
if (preferredSize == value) { if (preferredSize == value) {
return; return;
} }
......
...@@ -199,7 +199,6 @@ enum CrossAxisAlignment { ...@@ -199,7 +199,6 @@ enum CrossAxisAlignment {
} }
bool? _startIsTopLeft(Axis direction, TextDirection? textDirection, VerticalDirection? verticalDirection) { bool? _startIsTopLeft(Axis direction, TextDirection? textDirection, VerticalDirection? verticalDirection) {
assert(direction != null);
// If the relevant value of textDirection or verticalDirection is null, this returns null too. // If the relevant value of textDirection or verticalDirection is null, this returns null too.
switch (direction) { switch (direction) {
case Axis.horizontal: case Axis.horizontal:
...@@ -289,12 +288,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -289,12 +288,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
VerticalDirection verticalDirection = VerticalDirection.down, VerticalDirection verticalDirection = VerticalDirection.down,
TextBaseline? textBaseline, TextBaseline? textBaseline,
Clip clipBehavior = Clip.none, Clip clipBehavior = Clip.none,
}) : assert(direction != null), }) : _direction = direction,
assert(mainAxisAlignment != null),
assert(mainAxisSize != null),
assert(crossAxisAlignment != null),
assert(clipBehavior != null),
_direction = direction,
_mainAxisAlignment = mainAxisAlignment, _mainAxisAlignment = mainAxisAlignment,
_mainAxisSize = mainAxisSize, _mainAxisSize = mainAxisSize,
_crossAxisAlignment = crossAxisAlignment, _crossAxisAlignment = crossAxisAlignment,
...@@ -309,7 +303,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -309,7 +303,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
Axis get direction => _direction; Axis get direction => _direction;
Axis _direction; Axis _direction;
set direction(Axis value) { set direction(Axis value) {
assert(value != null);
if (_direction != value) { if (_direction != value) {
_direction = value; _direction = value;
markNeedsLayout(); markNeedsLayout();
...@@ -328,7 +321,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -328,7 +321,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
MainAxisAlignment get mainAxisAlignment => _mainAxisAlignment; MainAxisAlignment get mainAxisAlignment => _mainAxisAlignment;
MainAxisAlignment _mainAxisAlignment; MainAxisAlignment _mainAxisAlignment;
set mainAxisAlignment(MainAxisAlignment value) { set mainAxisAlignment(MainAxisAlignment value) {
assert(value != null);
if (_mainAxisAlignment != value) { if (_mainAxisAlignment != value) {
_mainAxisAlignment = value; _mainAxisAlignment = value;
markNeedsLayout(); markNeedsLayout();
...@@ -348,7 +340,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -348,7 +340,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
MainAxisSize get mainAxisSize => _mainAxisSize; MainAxisSize get mainAxisSize => _mainAxisSize;
MainAxisSize _mainAxisSize; MainAxisSize _mainAxisSize;
set mainAxisSize(MainAxisSize value) { set mainAxisSize(MainAxisSize value) {
assert(value != null);
if (_mainAxisSize != value) { if (_mainAxisSize != value) {
_mainAxisSize = value; _mainAxisSize = value;
markNeedsLayout(); markNeedsLayout();
...@@ -367,7 +358,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -367,7 +358,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
CrossAxisAlignment get crossAxisAlignment => _crossAxisAlignment; CrossAxisAlignment get crossAxisAlignment => _crossAxisAlignment;
CrossAxisAlignment _crossAxisAlignment; CrossAxisAlignment _crossAxisAlignment;
set crossAxisAlignment(CrossAxisAlignment value) { set crossAxisAlignment(CrossAxisAlignment value) {
assert(value != null);
if (_crossAxisAlignment != value) { if (_crossAxisAlignment != value) {
_crossAxisAlignment = value; _crossAxisAlignment = value;
markNeedsLayout(); markNeedsLayout();
...@@ -444,8 +434,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -444,8 +434,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
} }
bool get _debugHasNecessaryDirections { bool get _debugHasNecessaryDirections {
assert(direction != null);
assert(crossAxisAlignment != null);
if (firstChild != null && lastChild != firstChild) { if (firstChild != null && lastChild != firstChild) {
// i.e. there's more than one child // i.e. there's more than one child
switch (direction) { switch (direction) {
...@@ -453,7 +441,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -453,7 +441,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
assert(textDirection != null, 'Horizontal $runtimeType with multiple children has a null textDirection, so the layout order is undefined.'); assert(textDirection != null, 'Horizontal $runtimeType with multiple children has a null textDirection, so the layout order is undefined.');
break; break;
case Axis.vertical: case Axis.vertical:
assert(verticalDirection != null, 'Vertical $runtimeType with multiple children has a null verticalDirection, so the layout order is undefined.');
break; break;
} }
} }
...@@ -464,7 +451,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -464,7 +451,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
assert(textDirection != null, 'Horizontal $runtimeType with $mainAxisAlignment has a null textDirection, so the alignment cannot be resolved.'); assert(textDirection != null, 'Horizontal $runtimeType with $mainAxisAlignment has a null textDirection, so the alignment cannot be resolved.');
break; break;
case Axis.vertical: case Axis.vertical:
assert(verticalDirection != null, 'Vertical $runtimeType with $mainAxisAlignment has a null verticalDirection, so the alignment cannot be resolved.');
break; break;
} }
} }
...@@ -472,7 +458,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -472,7 +458,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
crossAxisAlignment == CrossAxisAlignment.end) { crossAxisAlignment == CrossAxisAlignment.end) {
switch (direction) { switch (direction) {
case Axis.horizontal: case Axis.horizontal:
assert(verticalDirection != null, 'Horizontal $runtimeType with $crossAxisAlignment has a null verticalDirection, so the alignment cannot be resolved.');
break; break;
case Axis.vertical: case Axis.vertical:
assert(textDirection != null, 'Vertical $runtimeType with $crossAxisAlignment has a null textDirection, so the alignment cannot be resolved.'); assert(textDirection != null, 'Vertical $runtimeType with $crossAxisAlignment has a null textDirection, so the alignment cannot be resolved.');
...@@ -494,7 +479,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -494,7 +479,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.none; Clip _clipBehavior = Clip.none;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsPaint(); markNeedsPaint();
...@@ -795,7 +779,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -795,7 +779,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
_LayoutSizes _computeSizes({required BoxConstraints constraints, required ChildLayouter layoutChild}) { _LayoutSizes _computeSizes({required BoxConstraints constraints, required ChildLayouter layoutChild}) {
assert(_debugHasNecessaryDirections); assert(_debugHasNecessaryDirections);
assert(constraints != null);
// Determine used flex factor, size inflexible items, calculate free space. // Determine used flex factor, size inflexible items, calculate free space.
int totalFlex = 0; int totalFlex = 0;
...@@ -861,7 +844,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -861,7 +844,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
minChildExtent = 0.0; minChildExtent = 0.0;
break; break;
} }
assert(minChildExtent != null);
final BoxConstraints innerConstraints; final BoxConstraints innerConstraints;
if (crossAxisAlignment == CrossAxisAlignment.stretch) { if (crossAxisAlignment == CrossAxisAlignment.stretch) {
switch (_direction) { switch (_direction) {
......
...@@ -183,9 +183,7 @@ class RenderFlow extends RenderBox ...@@ -183,9 +183,7 @@ class RenderFlow extends RenderBox
List<RenderBox>? children, List<RenderBox>? children,
required FlowDelegate delegate, required FlowDelegate delegate,
Clip clipBehavior = Clip.hardEdge, Clip clipBehavior = Clip.hardEdge,
}) : assert(delegate != null), }) : _delegate = delegate,
assert(clipBehavior != null),
_delegate = delegate,
_clipBehavior = clipBehavior { _clipBehavior = clipBehavior {
addAll(children); addAll(children);
} }
...@@ -209,7 +207,6 @@ class RenderFlow extends RenderBox ...@@ -209,7 +207,6 @@ class RenderFlow extends RenderBox
/// to determine whether the new delegate requires this object to update its /// to determine whether the new delegate requires this object to update its
/// layout or painting. /// layout or painting.
set delegate(FlowDelegate newDelegate) { set delegate(FlowDelegate newDelegate) {
assert(newDelegate != null);
if (_delegate == newDelegate) { if (_delegate == newDelegate) {
return; return;
} }
...@@ -234,7 +231,6 @@ class RenderFlow extends RenderBox ...@@ -234,7 +231,6 @@ class RenderFlow extends RenderBox
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsPaint(); markNeedsPaint();
......
...@@ -44,13 +44,7 @@ class RenderImage extends RenderBox { ...@@ -44,13 +44,7 @@ class RenderImage extends RenderBox {
bool invertColors = false, bool invertColors = false,
bool isAntiAlias = false, bool isAntiAlias = false,
FilterQuality filterQuality = FilterQuality.low, FilterQuality filterQuality = FilterQuality.low,
}) : assert(scale != null), }) : _image = image,
assert(repeat != null),
assert(alignment != null),
assert(filterQuality != null),
assert(matchTextDirection != null),
assert(isAntiAlias != null),
_image = image,
_width = width, _width = width,
_height = height, _height = height,
_scale = scale, _scale = scale,
...@@ -144,7 +138,6 @@ class RenderImage extends RenderBox { ...@@ -144,7 +138,6 @@ class RenderImage extends RenderBox {
double get scale => _scale; double get scale => _scale;
double _scale; double _scale;
set scale(double value) { set scale(double value) {
assert(value != null);
if (value == _scale) { if (value == _scale) {
return; return;
} }
...@@ -200,7 +193,6 @@ class RenderImage extends RenderBox { ...@@ -200,7 +193,6 @@ class RenderImage extends RenderBox {
FilterQuality get filterQuality => _filterQuality; FilterQuality get filterQuality => _filterQuality;
FilterQuality _filterQuality; FilterQuality _filterQuality;
set filterQuality(FilterQuality value) { set filterQuality(FilterQuality value) {
assert(value != null);
if (value == _filterQuality) { if (value == _filterQuality) {
return; return;
} }
...@@ -249,7 +241,6 @@ class RenderImage extends RenderBox { ...@@ -249,7 +241,6 @@ class RenderImage extends RenderBox {
AlignmentGeometry get alignment => _alignment; AlignmentGeometry get alignment => _alignment;
AlignmentGeometry _alignment; AlignmentGeometry _alignment;
set alignment(AlignmentGeometry value) { set alignment(AlignmentGeometry value) {
assert(value != null);
if (value == _alignment) { if (value == _alignment) {
return; return;
} }
...@@ -261,7 +252,6 @@ class RenderImage extends RenderBox { ...@@ -261,7 +252,6 @@ class RenderImage extends RenderBox {
ImageRepeat get repeat => _repeat; ImageRepeat get repeat => _repeat;
ImageRepeat _repeat; ImageRepeat _repeat;
set repeat(ImageRepeat value) { set repeat(ImageRepeat value) {
assert(value != null);
if (value == _repeat) { if (value == _repeat) {
return; return;
} }
...@@ -318,7 +308,6 @@ class RenderImage extends RenderBox { ...@@ -318,7 +308,6 @@ class RenderImage extends RenderBox {
bool get matchTextDirection => _matchTextDirection; bool get matchTextDirection => _matchTextDirection;
bool _matchTextDirection; bool _matchTextDirection;
set matchTextDirection(bool value) { set matchTextDirection(bool value) {
assert(value != null);
if (value == _matchTextDirection) { if (value == _matchTextDirection) {
return; return;
} }
...@@ -350,7 +339,6 @@ class RenderImage extends RenderBox { ...@@ -350,7 +339,6 @@ class RenderImage extends RenderBox {
if (_isAntiAlias == value) { if (_isAntiAlias == value) {
return; return;
} }
assert(value != null);
_isAntiAlias = value; _isAntiAlias = value;
markNeedsPaint(); markNeedsPaint();
} }
......
...@@ -24,7 +24,7 @@ class AnnotationEntry<T> { ...@@ -24,7 +24,7 @@ class AnnotationEntry<T> {
const AnnotationEntry({ const AnnotationEntry({
required this.annotation, required this.annotation,
required this.localPosition, required this.localPosition,
}) : assert(localPosition != null); });
/// The annotation object that is found. /// The annotation object that is found.
final T annotation; final T annotation;
...@@ -891,8 +891,7 @@ class TextureLayer extends Layer { ...@@ -891,8 +891,7 @@ class TextureLayer extends Layer {
required this.textureId, required this.textureId,
this.freeze = false, this.freeze = false,
this.filterQuality = ui.FilterQuality.low, this.filterQuality = ui.FilterQuality.low,
}) : assert(rect != null), });
assert(textureId != null);
/// Bounding rectangle of this layer. /// Bounding rectangle of this layer.
final Rect rect; final Rect rect;
...@@ -939,8 +938,7 @@ class PlatformViewLayer extends Layer { ...@@ -939,8 +938,7 @@ class PlatformViewLayer extends Layer {
PlatformViewLayer({ PlatformViewLayer({
required this.rect, required this.rect,
required this.viewId, required this.viewId,
}) : assert(rect != null), });
assert(viewId != null);
/// Bounding rectangle of this layer in the global coordinate space. /// Bounding rectangle of this layer in the global coordinate space.
final Rect rect; final Rect rect;
...@@ -1027,7 +1025,6 @@ class PerformanceOverlayLayer extends Layer { ...@@ -1027,7 +1025,6 @@ class PerformanceOverlayLayer extends Layer {
@override @override
void addToScene(ui.SceneBuilder builder) { void addToScene(ui.SceneBuilder builder) {
assert(optionsMask != null);
builder.addPerformanceOverlay(optionsMask, overlayRect); builder.addPerformanceOverlay(optionsMask, overlayRect);
builder.setRasterizerTracingThreshold(rasterizerThreshold); builder.setRasterizerTracingThreshold(rasterizerThreshold);
builder.setCheckerboardRasterCacheImages(checkerboardRasterCacheImages); builder.setCheckerboardRasterCacheImages(checkerboardRasterCacheImages);
...@@ -1255,7 +1252,6 @@ class ContainerLayer extends Layer { ...@@ -1255,7 +1252,6 @@ class ContainerLayer extends Layer {
child._nextSibling = null; child._nextSibling = null;
assert(child.attached == attached); assert(child.attached == attached);
dropChild(child); dropChild(child);
assert(child._parentHandle != null);
child._parentHandle.layer = null; child._parentHandle.layer = null;
child = next; child = next;
} }
...@@ -1318,7 +1314,6 @@ class ContainerLayer extends Layer { ...@@ -1318,7 +1314,6 @@ class ContainerLayer extends Layer {
/// position. /// position.
void applyTransform(Layer? child, Matrix4 transform) { void applyTransform(Layer? child, Matrix4 transform) {
assert(child != null); assert(child != null);
assert(transform != null);
} }
/// Returns the descendants of this layer in depth first order. /// Returns the descendants of this layer in depth first order.
...@@ -1399,7 +1394,6 @@ class OffsetLayer extends ContainerLayer { ...@@ -1399,7 +1394,6 @@ class OffsetLayer extends ContainerLayer {
@override @override
void applyTransform(Layer? child, Matrix4 transform) { void applyTransform(Layer? child, Matrix4 transform) {
assert(child != null); assert(child != null);
assert(transform != null);
transform.translate(offset.dx, offset.dy); transform.translate(offset.dx, offset.dy);
} }
...@@ -1426,8 +1420,6 @@ class OffsetLayer extends ContainerLayer { ...@@ -1426,8 +1420,6 @@ class OffsetLayer extends ContainerLayer {
} }
ui.Scene _createSceneForImage(Rect bounds, { double pixelRatio = 1.0 }) { ui.Scene _createSceneForImage(Rect bounds, { double pixelRatio = 1.0 }) {
assert(bounds != null);
assert(pixelRatio != null);
final ui.SceneBuilder builder = ui.SceneBuilder(); final ui.SceneBuilder builder = ui.SceneBuilder();
final Matrix4 transform = Matrix4.diagonal3Values(pixelRatio, pixelRatio, 1); final Matrix4 transform = Matrix4.diagonal3Values(pixelRatio, pixelRatio, 1);
transform.translate(-(bounds.left + offset.dx), -(bounds.top + offset.dy)); transform.translate(-(bounds.left + offset.dx), -(bounds.top + offset.dy));
...@@ -1521,7 +1513,6 @@ class ClipRectLayer extends ContainerLayer { ...@@ -1521,7 +1513,6 @@ class ClipRectLayer extends ContainerLayer {
Clip clipBehavior = Clip.hardEdge, Clip clipBehavior = Clip.hardEdge,
}) : _clipRect = clipRect, }) : _clipRect = clipRect,
_clipBehavior = clipBehavior, _clipBehavior = clipBehavior,
assert(clipBehavior != null),
assert(clipBehavior != Clip.none); assert(clipBehavior != Clip.none);
/// The rectangle to clip in the parent's coordinate system. /// The rectangle to clip in the parent's coordinate system.
...@@ -1550,7 +1541,6 @@ class ClipRectLayer extends ContainerLayer { ...@@ -1550,7 +1541,6 @@ class ClipRectLayer extends ContainerLayer {
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior; Clip _clipBehavior;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
assert(value != Clip.none); assert(value != Clip.none);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
...@@ -1569,7 +1559,6 @@ class ClipRectLayer extends ContainerLayer { ...@@ -1569,7 +1559,6 @@ class ClipRectLayer extends ContainerLayer {
@override @override
void addToScene(ui.SceneBuilder builder) { void addToScene(ui.SceneBuilder builder) {
assert(clipRect != null); assert(clipRect != null);
assert(clipBehavior != null);
bool enabled = true; bool enabled = true;
assert(() { assert(() {
enabled = !debugDisableClipLayers; enabled = !debugDisableClipLayers;
...@@ -1613,7 +1602,6 @@ class ClipRRectLayer extends ContainerLayer { ...@@ -1613,7 +1602,6 @@ class ClipRRectLayer extends ContainerLayer {
Clip clipBehavior = Clip.antiAlias, Clip clipBehavior = Clip.antiAlias,
}) : _clipRRect = clipRRect, }) : _clipRRect = clipRRect,
_clipBehavior = clipBehavior, _clipBehavior = clipBehavior,
assert(clipBehavior != null),
assert(clipBehavior != Clip.none); assert(clipBehavior != Clip.none);
/// The rounded-rect to clip in the parent's coordinate system. /// The rounded-rect to clip in the parent's coordinate system.
...@@ -1638,7 +1626,6 @@ class ClipRRectLayer extends ContainerLayer { ...@@ -1638,7 +1626,6 @@ class ClipRRectLayer extends ContainerLayer {
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior; Clip _clipBehavior;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
assert(value != Clip.none); assert(value != Clip.none);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
...@@ -1657,7 +1644,6 @@ class ClipRRectLayer extends ContainerLayer { ...@@ -1657,7 +1644,6 @@ class ClipRRectLayer extends ContainerLayer {
@override @override
void addToScene(ui.SceneBuilder builder) { void addToScene(ui.SceneBuilder builder) {
assert(clipRRect != null); assert(clipRRect != null);
assert(clipBehavior != null);
bool enabled = true; bool enabled = true;
assert(() { assert(() {
enabled = !debugDisableClipLayers; enabled = !debugDisableClipLayers;
...@@ -1701,7 +1687,6 @@ class ClipPathLayer extends ContainerLayer { ...@@ -1701,7 +1687,6 @@ class ClipPathLayer extends ContainerLayer {
Clip clipBehavior = Clip.antiAlias, Clip clipBehavior = Clip.antiAlias,
}) : _clipPath = clipPath, }) : _clipPath = clipPath,
_clipBehavior = clipBehavior, _clipBehavior = clipBehavior,
assert(clipBehavior != null),
assert(clipBehavior != Clip.none); assert(clipBehavior != Clip.none);
/// The path to clip in the parent's coordinate system. /// The path to clip in the parent's coordinate system.
...@@ -1726,7 +1711,6 @@ class ClipPathLayer extends ContainerLayer { ...@@ -1726,7 +1711,6 @@ class ClipPathLayer extends ContainerLayer {
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior; Clip _clipBehavior;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
assert(value != Clip.none); assert(value != Clip.none);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
...@@ -1745,7 +1729,6 @@ class ClipPathLayer extends ContainerLayer { ...@@ -1745,7 +1729,6 @@ class ClipPathLayer extends ContainerLayer {
@override @override
void addToScene(ui.SceneBuilder builder) { void addToScene(ui.SceneBuilder builder) {
assert(clipPath != null); assert(clipPath != null);
assert(clipBehavior != null);
bool enabled = true; bool enabled = true;
assert(() { assert(() {
enabled = !debugDisableClipLayers; enabled = !debugDisableClipLayers;
...@@ -1940,7 +1923,6 @@ class TransformLayer extends OffsetLayer { ...@@ -1940,7 +1923,6 @@ class TransformLayer extends OffsetLayer {
@override @override
void applyTransform(Layer? child, Matrix4 transform) { void applyTransform(Layer? child, Matrix4 transform) {
assert(child != null); assert(child != null);
assert(transform != null);
assert(_lastEffectiveTransform != null || this.transform != null); assert(_lastEffectiveTransform != null || this.transform != null);
if (_lastEffectiveTransform == null) { if (_lastEffectiveTransform == null) {
transform.multiply(this.transform!); transform.multiply(this.transform!);
...@@ -2250,7 +2232,6 @@ class PhysicalModelLayer extends ContainerLayer { ...@@ -2250,7 +2232,6 @@ class PhysicalModelLayer extends ContainerLayer {
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior; Clip _clipBehavior;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsAddToScene(); markNeedsAddToScene();
...@@ -2310,7 +2291,6 @@ class PhysicalModelLayer extends ContainerLayer { ...@@ -2310,7 +2291,6 @@ class PhysicalModelLayer extends ContainerLayer {
@override @override
void addToScene(ui.SceneBuilder builder) { void addToScene(ui.SceneBuilder builder) {
assert(clipPath != null); assert(clipPath != null);
assert(clipBehavior != null);
assert(elevation != null); assert(elevation != null);
assert(color != null); assert(color != null);
assert(shadowColor != null); assert(shadowColor != null);
...@@ -2437,7 +2417,7 @@ class LeaderLayer extends ContainerLayer { ...@@ -2437,7 +2417,7 @@ class LeaderLayer extends ContainerLayer {
/// ///
/// 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.
LeaderLayer({ required LayerLink link, Offset offset = Offset.zero }) : assert(link != null), _link = link, _offset = offset; LeaderLayer({ required LayerLink link, Offset offset = Offset.zero }) : _link = link, _offset = offset;
/// The object with which this layer should register. /// The object with which this layer should register.
/// ///
...@@ -2446,7 +2426,6 @@ class LeaderLayer extends ContainerLayer { ...@@ -2446,7 +2426,6 @@ class LeaderLayer extends ContainerLayer {
LayerLink get link => _link; LayerLink get link => _link;
LayerLink _link; LayerLink _link;
set link(LayerLink value) { set link(LayerLink value) {
assert(value != null);
if (_link == value) { if (_link == value) {
return; return;
} }
...@@ -2467,7 +2446,6 @@ class LeaderLayer extends ContainerLayer { ...@@ -2467,7 +2446,6 @@ class LeaderLayer extends ContainerLayer {
Offset get offset => _offset; Offset get offset => _offset;
Offset _offset; Offset _offset;
set offset(Offset value) { set offset(Offset value) {
assert(value != null);
if (value == _offset) { if (value == _offset) {
return; return;
} }
...@@ -2496,7 +2474,6 @@ class LeaderLayer extends ContainerLayer { ...@@ -2496,7 +2474,6 @@ class LeaderLayer extends ContainerLayer {
@override @override
void addToScene(ui.SceneBuilder builder) { void addToScene(ui.SceneBuilder builder) {
assert(offset != null);
if (offset != Offset.zero) { if (offset != Offset.zero) {
engineLayer = builder.pushTransform( engineLayer = builder.pushTransform(
Matrix4.translationValues(offset.dx, offset.dy, 0.0).storage, Matrix4.translationValues(offset.dx, offset.dy, 0.0).storage,
...@@ -2551,23 +2528,18 @@ class FollowerLayer extends ContainerLayer { ...@@ -2551,23 +2528,18 @@ class FollowerLayer extends ContainerLayer {
/// 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({
required LayerLink link, required this.link,
this.showWhenUnlinked = true, this.showWhenUnlinked = true,
this.unlinkedOffset = Offset.zero, this.unlinkedOffset = Offset.zero,
this.linkedOffset = Offset.zero, this.linkedOffset = Offset.zero,
}) : assert(link != null), _link = link; });
/// The link to the [LeaderLayer]. /// The link to the [LeaderLayer].
/// ///
/// The same object should be provided to a [LeaderLayer] that is earlier in /// The same object should be provided to a [LeaderLayer] that is earlier in
/// the layer tree. When this layer is composited, it will apply a transform /// the layer tree. When this layer is composited, it will apply a transform
/// that moves its children to match the position of the [LeaderLayer]. /// that moves its children to match the position of the [LeaderLayer].
LayerLink get link => _link; LayerLink link;
set link(LayerLink value) {
assert(value != null);
_link = value;
}
LayerLink _link;
/// Whether to show the layer's contents when the [link] does not point to a /// Whether to show the layer's contents when the [link] does not point to a
/// [LeaderLayer]. /// [LeaderLayer].
...@@ -2631,7 +2603,7 @@ class FollowerLayer extends ContainerLayer { ...@@ -2631,7 +2603,7 @@ class FollowerLayer extends ContainerLayer {
@override @override
bool findAnnotations<S extends Object>(AnnotationResult<S> result, Offset localPosition, { required bool onlyFirst }) { bool findAnnotations<S extends Object>(AnnotationResult<S> result, Offset localPosition, { required bool onlyFirst }) {
if (_link.leader == null) { if (link.leader == null) {
if (showWhenUnlinked!) { if (showWhenUnlinked!) {
return super.findAnnotations(result, localPosition - unlinkedOffset!, onlyFirst: onlyFirst); return super.findAnnotations(result, localPosition - unlinkedOffset!, onlyFirst: onlyFirst);
} }
...@@ -2740,9 +2712,8 @@ class FollowerLayer extends ContainerLayer { ...@@ -2740,9 +2712,8 @@ class FollowerLayer extends ContainerLayer {
/// Populate [_lastTransform] given the current state of the tree. /// Populate [_lastTransform] given the current state of the tree.
void _establishTransform() { void _establishTransform() {
assert(link != null);
_lastTransform = null; _lastTransform = null;
final LeaderLayer? leader = _link.leader; final LeaderLayer? leader = link.leader;
// Check to see if we are linked. // Check to see if we are linked.
if (leader == null) { if (leader == null) {
return; return;
...@@ -2806,9 +2777,8 @@ class FollowerLayer extends ContainerLayer { ...@@ -2806,9 +2777,8 @@ class FollowerLayer extends ContainerLayer {
@override @override
void addToScene(ui.SceneBuilder builder) { void addToScene(ui.SceneBuilder builder) {
assert(link != null);
assert(showWhenUnlinked != null); assert(showWhenUnlinked != null);
if (_link.leader == null && !showWhenUnlinked!) { if (link.leader == null && !showWhenUnlinked!) {
_lastTransform = null; _lastTransform = null;
_lastOffset = null; _lastOffset = null;
_inverseDirty = true; _inverseDirty = true;
...@@ -2840,7 +2810,6 @@ class FollowerLayer extends ContainerLayer { ...@@ -2840,7 +2810,6 @@ class FollowerLayer extends ContainerLayer {
@override @override
void applyTransform(Layer? child, Matrix4 transform) { void applyTransform(Layer? child, Matrix4 transform) {
assert(child != null); assert(child != null);
assert(transform != null);
if (_lastTransform != null) { if (_lastTransform != null) {
transform.multiply(_lastTransform!); transform.multiply(_lastTransform!);
} else { } else {
...@@ -2886,9 +2855,7 @@ class AnnotatedRegionLayer<T extends Object> extends ContainerLayer { ...@@ -2886,9 +2855,7 @@ class AnnotatedRegionLayer<T extends Object> extends ContainerLayer {
this.size, this.size,
Offset? offset, Offset? offset,
this.opaque = false, this.opaque = false,
}) : assert(value != null), }) : offset = offset ?? Offset.zero;
assert(opaque != null),
offset = offset ?? Offset.zero;
/// The annotated object, which is added to the result if all restrictions are /// The annotated object, which is added to the result if all restrictions are
/// met. /// met.
......
...@@ -32,8 +32,7 @@ class RenderListBody extends RenderBox ...@@ -32,8 +32,7 @@ class RenderListBody extends RenderBox
RenderListBody({ RenderListBody({
List<RenderBox>? children, List<RenderBox>? children,
AxisDirection axisDirection = AxisDirection.down, AxisDirection axisDirection = AxisDirection.down,
}) : assert(axisDirection != null), }) : _axisDirection = axisDirection {
_axisDirection = axisDirection {
addAll(children); addAll(children);
} }
...@@ -51,7 +50,6 @@ class RenderListBody extends RenderBox ...@@ -51,7 +50,6 @@ class RenderListBody extends RenderBox
AxisDirection get axisDirection => _axisDirection; AxisDirection get axisDirection => _axisDirection;
AxisDirection _axisDirection; AxisDirection _axisDirection;
set axisDirection(AxisDirection value) { set axisDirection(AxisDirection value) {
assert(value != null);
if (_axisDirection == value) { if (_axisDirection == value) {
return; return;
} }
...@@ -259,7 +257,6 @@ class RenderListBody extends RenderBox ...@@ -259,7 +257,6 @@ class RenderListBody extends RenderBox
@override @override
double computeMinIntrinsicWidth(double height) { double computeMinIntrinsicWidth(double height) {
assert(mainAxis != null);
switch (mainAxis) { switch (mainAxis) {
case Axis.horizontal: case Axis.horizontal:
return _getIntrinsicMainAxis((RenderBox child) => child.getMinIntrinsicWidth(height)); return _getIntrinsicMainAxis((RenderBox child) => child.getMinIntrinsicWidth(height));
...@@ -270,7 +267,6 @@ class RenderListBody extends RenderBox ...@@ -270,7 +267,6 @@ class RenderListBody extends RenderBox
@override @override
double computeMaxIntrinsicWidth(double height) { double computeMaxIntrinsicWidth(double height) {
assert(mainAxis != null);
switch (mainAxis) { switch (mainAxis) {
case Axis.horizontal: case Axis.horizontal:
return _getIntrinsicMainAxis((RenderBox child) => child.getMaxIntrinsicWidth(height)); return _getIntrinsicMainAxis((RenderBox child) => child.getMaxIntrinsicWidth(height));
...@@ -281,7 +277,6 @@ class RenderListBody extends RenderBox ...@@ -281,7 +277,6 @@ class RenderListBody extends RenderBox
@override @override
double computeMinIntrinsicHeight(double width) { double computeMinIntrinsicHeight(double width) {
assert(mainAxis != null);
switch (mainAxis) { switch (mainAxis) {
case Axis.horizontal: case Axis.horizontal:
return _getIntrinsicMainAxis((RenderBox child) => child.getMinIntrinsicHeight(width)); return _getIntrinsicMainAxis((RenderBox child) => child.getMinIntrinsicHeight(width));
...@@ -292,7 +287,6 @@ class RenderListBody extends RenderBox ...@@ -292,7 +287,6 @@ class RenderListBody extends RenderBox
@override @override
double computeMaxIntrinsicHeight(double width) { double computeMaxIntrinsicHeight(double width) {
assert(mainAxis != null);
switch (mainAxis) { switch (mainAxis) {
case Axis.horizontal: case Axis.horizontal:
return _getIntrinsicMainAxis((RenderBox child) => child.getMaxIntrinsicHeight(width)); return _getIntrinsicMainAxis((RenderBox child) => child.getMaxIntrinsicHeight(width));
......
...@@ -149,25 +149,13 @@ class RenderListWheelViewport ...@@ -149,25 +149,13 @@ class RenderListWheelViewport
bool renderChildrenOutsideViewport = false, bool renderChildrenOutsideViewport = false,
Clip clipBehavior = Clip.none, Clip clipBehavior = Clip.none,
List<RenderBox>? children, List<RenderBox>? children,
}) : assert(childManager != null), }) : assert(diameterRatio > 0, diameterRatioZeroMessage),
assert(offset != null),
assert(diameterRatio != null),
assert(diameterRatio > 0, diameterRatioZeroMessage),
assert(perspective != null),
assert(perspective > 0), assert(perspective > 0),
assert(perspective <= 0.01, perspectiveTooHighMessage), assert(perspective <= 0.01, perspectiveTooHighMessage),
assert(offAxisFraction != null),
assert(useMagnifier != null),
assert(magnification != null),
assert(magnification > 0), assert(magnification > 0),
assert(overAndUnderCenterOpacity != null),
assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1), assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1),
assert(itemExtent != null),
assert(squeeze != null),
assert(squeeze > 0), assert(squeeze > 0),
assert(itemExtent > 0), assert(itemExtent > 0),
assert(renderChildrenOutsideViewport != null),
assert(clipBehavior != null),
assert( assert(
!renderChildrenOutsideViewport || clipBehavior == Clip.none, !renderChildrenOutsideViewport || clipBehavior == Clip.none,
clipBehaviorAndRenderChildrenOutsideViewportConflict, clipBehaviorAndRenderChildrenOutsideViewportConflict,
...@@ -225,7 +213,6 @@ class RenderListWheelViewport ...@@ -225,7 +213,6 @@ class RenderListWheelViewport
ViewportOffset get offset => _offset; ViewportOffset get offset => _offset;
ViewportOffset _offset; ViewportOffset _offset;
set offset(ViewportOffset value) { set offset(ViewportOffset value) {
assert(value != null);
if (value == _offset) { if (value == _offset) {
return; return;
} }
...@@ -270,7 +257,6 @@ class RenderListWheelViewport ...@@ -270,7 +257,6 @@ class RenderListWheelViewport
double get diameterRatio => _diameterRatio; double get diameterRatio => _diameterRatio;
double _diameterRatio; double _diameterRatio;
set diameterRatio(double value) { set diameterRatio(double value) {
assert(value != null);
assert( assert(
value > 0, value > 0,
diameterRatioZeroMessage, diameterRatioZeroMessage,
...@@ -300,7 +286,6 @@ class RenderListWheelViewport ...@@ -300,7 +286,6 @@ class RenderListWheelViewport
double get perspective => _perspective; double get perspective => _perspective;
double _perspective; double _perspective;
set perspective(double value) { set perspective(double value) {
assert(value != null);
assert(value > 0); assert(value > 0);
assert( assert(
value <= 0.01, value <= 0.01,
...@@ -342,7 +327,6 @@ class RenderListWheelViewport ...@@ -342,7 +327,6 @@ class RenderListWheelViewport
double get offAxisFraction => _offAxisFraction; double get offAxisFraction => _offAxisFraction;
double _offAxisFraction = 0.0; double _offAxisFraction = 0.0;
set offAxisFraction(double value) { set offAxisFraction(double value) {
assert(value != null);
if (value == _offAxisFraction) { if (value == _offAxisFraction) {
return; return;
} }
...@@ -356,7 +340,6 @@ class RenderListWheelViewport ...@@ -356,7 +340,6 @@ class RenderListWheelViewport
bool get useMagnifier => _useMagnifier; bool get useMagnifier => _useMagnifier;
bool _useMagnifier = false; bool _useMagnifier = false;
set useMagnifier(bool value) { set useMagnifier(bool value) {
assert(value != null);
if (value == _useMagnifier) { if (value == _useMagnifier) {
return; return;
} }
...@@ -376,7 +359,6 @@ class RenderListWheelViewport ...@@ -376,7 +359,6 @@ class RenderListWheelViewport
double get magnification => _magnification; double get magnification => _magnification;
double _magnification = 1.0; double _magnification = 1.0;
set magnification(double value) { set magnification(double value) {
assert(value != null);
assert(value > 0); assert(value > 0);
if (value == _magnification) { if (value == _magnification) {
return; return;
...@@ -396,7 +378,6 @@ class RenderListWheelViewport ...@@ -396,7 +378,6 @@ class RenderListWheelViewport
double get overAndUnderCenterOpacity => _overAndUnderCenterOpacity; double get overAndUnderCenterOpacity => _overAndUnderCenterOpacity;
double _overAndUnderCenterOpacity = 1.0; double _overAndUnderCenterOpacity = 1.0;
set overAndUnderCenterOpacity(double value) { set overAndUnderCenterOpacity(double value) {
assert(value != null);
assert(value >= 0 && value <= 1); assert(value >= 0 && value <= 1);
if (value == _overAndUnderCenterOpacity) { if (value == _overAndUnderCenterOpacity) {
return; return;
...@@ -414,7 +395,6 @@ class RenderListWheelViewport ...@@ -414,7 +395,6 @@ class RenderListWheelViewport
double get itemExtent => _itemExtent; double get itemExtent => _itemExtent;
double _itemExtent; double _itemExtent;
set itemExtent(double value) { set itemExtent(double value) {
assert(value != null);
assert(value > 0); assert(value > 0);
if (value == _itemExtent) { if (value == _itemExtent) {
return; return;
...@@ -447,7 +427,6 @@ class RenderListWheelViewport ...@@ -447,7 +427,6 @@ class RenderListWheelViewport
double get squeeze => _squeeze; double get squeeze => _squeeze;
double _squeeze; double _squeeze;
set squeeze(double value) { set squeeze(double value) {
assert(value != null);
assert(value > 0); assert(value > 0);
if (value == _squeeze) { if (value == _squeeze) {
return; return;
...@@ -470,7 +449,6 @@ class RenderListWheelViewport ...@@ -470,7 +449,6 @@ class RenderListWheelViewport
bool get renderChildrenOutsideViewport => _renderChildrenOutsideViewport; bool get renderChildrenOutsideViewport => _renderChildrenOutsideViewport;
bool _renderChildrenOutsideViewport; bool _renderChildrenOutsideViewport;
set renderChildrenOutsideViewport(bool value) { set renderChildrenOutsideViewport(bool value) {
assert(value != null);
assert( assert(
!renderChildrenOutsideViewport || clipBehavior == Clip.none, !renderChildrenOutsideViewport || clipBehavior == Clip.none,
clipBehaviorAndRenderChildrenOutsideViewportConflict, clipBehaviorAndRenderChildrenOutsideViewportConflict,
...@@ -489,7 +467,6 @@ class RenderListWheelViewport ...@@ -489,7 +467,6 @@ class RenderListWheelViewport
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsPaint(); markNeedsPaint();
...@@ -636,7 +613,6 @@ class RenderListWheelViewport ...@@ -636,7 +613,6 @@ class RenderListWheelViewport
/// ///
/// This relies on the [childManager] maintaining [ListWheelParentData.index]. /// This relies on the [childManager] maintaining [ListWheelParentData.index].
int indexOf(RenderBox child) { int indexOf(RenderBox child) {
assert(child != null);
final ListWheelParentData childParentData = child.parentData! as ListWheelParentData; final ListWheelParentData childParentData = child.parentData! as ListWheelParentData;
assert(childParentData.index != null); assert(childParentData.index != null);
return childParentData.index!; return childParentData.index!;
......
...@@ -30,8 +30,7 @@ typedef MouseDetectorAnnotationFinder = HitTestResult Function(Offset offset); ...@@ -30,8 +30,7 @@ typedef MouseDetectorAnnotationFinder = HitTestResult Function(Offset offset);
class _MouseState { class _MouseState {
_MouseState({ _MouseState({
required PointerEvent initialEvent, required PointerEvent initialEvent,
}) : assert(initialEvent != null), }) : _latestEvent = initialEvent;
_latestEvent = initialEvent;
// The list of annotations that contains this device. // The list of annotations that contains this device.
// //
...@@ -40,7 +39,6 @@ class _MouseState { ...@@ -40,7 +39,6 @@ class _MouseState {
LinkedHashMap<MouseTrackerAnnotation, Matrix4> _annotations = LinkedHashMap<MouseTrackerAnnotation, Matrix4>(); LinkedHashMap<MouseTrackerAnnotation, Matrix4> _annotations = LinkedHashMap<MouseTrackerAnnotation, Matrix4>();
LinkedHashMap<MouseTrackerAnnotation, Matrix4> replaceAnnotations(LinkedHashMap<MouseTrackerAnnotation, Matrix4> value) { LinkedHashMap<MouseTrackerAnnotation, Matrix4> replaceAnnotations(LinkedHashMap<MouseTrackerAnnotation, Matrix4> value) {
assert(value != null);
final LinkedHashMap<MouseTrackerAnnotation, Matrix4> previous = _annotations; final LinkedHashMap<MouseTrackerAnnotation, Matrix4> previous = _annotations;
_annotations = value; _annotations = value;
return previous; return previous;
...@@ -51,7 +49,6 @@ class _MouseState { ...@@ -51,7 +49,6 @@ class _MouseState {
PointerEvent _latestEvent; PointerEvent _latestEvent;
PointerEvent replaceLatestEvent(PointerEvent value) { PointerEvent replaceLatestEvent(PointerEvent value) {
assert(value != null);
assert(value.device == _latestEvent.device); assert(value.device == _latestEvent.device);
final PointerEvent previous = _latestEvent; final PointerEvent previous = _latestEvent;
_latestEvent = value; _latestEvent = value;
...@@ -83,10 +80,7 @@ class _MouseTrackerUpdateDetails with Diagnosticable { ...@@ -83,10 +80,7 @@ class _MouseTrackerUpdateDetails with Diagnosticable {
required this.lastAnnotations, required this.lastAnnotations,
required this.nextAnnotations, required this.nextAnnotations,
required PointerEvent this.previousEvent, required PointerEvent this.previousEvent,
}) : assert(previousEvent != null), }) : triggeringEvent = null;
assert(lastAnnotations != null),
assert(nextAnnotations != null),
triggeringEvent = null;
/// When device update is triggered by a pointer event. /// When device update is triggered by a pointer event.
/// ///
...@@ -97,9 +91,7 @@ class _MouseTrackerUpdateDetails with Diagnosticable { ...@@ -97,9 +91,7 @@ class _MouseTrackerUpdateDetails with Diagnosticable {
required this.nextAnnotations, required this.nextAnnotations,
this.previousEvent, this.previousEvent,
required PointerEvent this.triggeringEvent, required PointerEvent this.triggeringEvent,
}) : assert(triggeringEvent != null), });
assert(lastAnnotations != null),
assert(nextAnnotations != null);
/// The annotations that the device is hovering before the update. /// The annotations that the device is hovering before the update.
/// ///
...@@ -129,7 +121,6 @@ class _MouseTrackerUpdateDetails with Diagnosticable { ...@@ -129,7 +121,6 @@ class _MouseTrackerUpdateDetails with Diagnosticable {
/// The pointing device of this update. /// The pointing device of this update.
int get device { int get device {
final int result = (previousEvent ?? triggeringEvent)!.device; final int result = (previousEvent ?? triggeringEvent)!.device;
assert(result != null);
return result; return result;
} }
...@@ -138,7 +129,6 @@ class _MouseTrackerUpdateDetails with Diagnosticable { ...@@ -138,7 +129,6 @@ class _MouseTrackerUpdateDetails with Diagnosticable {
/// The [latestEvent] is never null. /// The [latestEvent] is never null.
PointerEvent get latestEvent { PointerEvent get latestEvent {
final PointerEvent result = triggeringEvent ?? previousEvent!; final PointerEvent result = triggeringEvent ?? previousEvent!;
assert(result != null);
return result; return result;
} }
...@@ -219,7 +209,6 @@ class MouseTracker extends ChangeNotifier { ...@@ -219,7 +209,6 @@ class MouseTracker extends ChangeNotifier {
if (state == null) { if (state == null) {
return true; return true;
} }
assert(event != null);
final PointerEvent lastEvent = state.latestEvent; final PointerEvent lastEvent = state.latestEvent;
assert(event.device == lastEvent.device); assert(event.device == lastEvent.device);
// An Added can only follow a Removed, and a Removed can only be followed // An Added can only follow a Removed, and a Removed can only be followed
...@@ -236,7 +225,6 @@ class MouseTracker extends ChangeNotifier { ...@@ -236,7 +225,6 @@ class MouseTracker extends ChangeNotifier {
} }
LinkedHashMap<MouseTrackerAnnotation, Matrix4> _hitTestResultToAnnotations(HitTestResult result) { LinkedHashMap<MouseTrackerAnnotation, Matrix4> _hitTestResultToAnnotations(HitTestResult result) {
assert(result != null);
final LinkedHashMap<MouseTrackerAnnotation, Matrix4> annotations = LinkedHashMap<MouseTrackerAnnotation, Matrix4>(); final LinkedHashMap<MouseTrackerAnnotation, Matrix4> annotations = LinkedHashMap<MouseTrackerAnnotation, Matrix4>();
for (final HitTestEntry entry in result.path) { for (final HitTestEntry entry in result.path) {
final Object target = entry.target; final Object target = entry.target;
...@@ -253,8 +241,6 @@ class MouseTracker extends ChangeNotifier { ...@@ -253,8 +241,6 @@ class MouseTracker extends ChangeNotifier {
// If the device is not connected or not a mouse, an empty map is returned // If the device is not connected or not a mouse, an empty map is returned
// without calling `hitTest`. // without calling `hitTest`.
LinkedHashMap<MouseTrackerAnnotation, Matrix4> _findAnnotations(_MouseState state, MouseDetectorAnnotationFinder hitTest) { LinkedHashMap<MouseTrackerAnnotation, Matrix4> _findAnnotations(_MouseState state, MouseDetectorAnnotationFinder hitTest) {
assert(state != null);
assert(hitTest != null);
final Offset globalPosition = state.latestEvent.position; final Offset globalPosition = state.latestEvent.position;
final int device = state.device; final int device = state.device;
if (!_mouseStates.containsKey(device)) { if (!_mouseStates.containsKey(device)) {
......
...@@ -83,9 +83,7 @@ class PaintingContext extends ClipContext { ...@@ -83,9 +83,7 @@ class PaintingContext extends ClipContext {
/// Typically only called by [PaintingContext.repaintCompositedChild] /// Typically only called by [PaintingContext.repaintCompositedChild]
/// and [pushLayer]. /// and [pushLayer].
@protected @protected
PaintingContext(this._containerLayer, this.estimatedBounds) PaintingContext(this._containerLayer, this.estimatedBounds);
: assert(_containerLayer != null),
assert(estimatedBounds != null);
final ContainerLayer _containerLayer; final ContainerLayer _containerLayer;
...@@ -462,7 +460,6 @@ class PaintingContext extends ClipContext { ...@@ -462,7 +460,6 @@ class PaintingContext extends ClipContext {
/// * [addLayer], for pushing a layer without painting further contents /// * [addLayer], for pushing a layer without painting further contents
/// within it. /// within it.
void pushLayer(ContainerLayer childLayer, PaintingContextCallback painter, Offset offset, { Rect? childPaintBounds }) { void pushLayer(ContainerLayer childLayer, PaintingContextCallback painter, Offset offset, { Rect? childPaintBounds }) {
assert(painter != null);
// If a layer is being reused, it may already contain children. We remove // If a layer is being reused, it may already contain children. We remove
// them so that `painter` can add children that are relevant for this frame. // them so that `painter` can add children that are relevant for this frame.
if (childLayer.hasChildren) { if (childLayer.hasChildren) {
...@@ -560,7 +557,6 @@ class PaintingContext extends ClipContext { ...@@ -560,7 +557,6 @@ class PaintingContext extends ClipContext {
/// ///
/// {@macro flutter.rendering.PaintingContext.pushClipRect.oldLayer} /// {@macro flutter.rendering.PaintingContext.pushClipRect.oldLayer}
ClipRRectLayer? pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias, ClipRRectLayer? oldLayer }) { ClipRRectLayer? pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias, ClipRRectLayer? oldLayer }) {
assert(clipBehavior != null);
if (clipBehavior == Clip.none) { if (clipBehavior == Clip.none) {
painter(this, offset); painter(this, offset);
return null; return null;
...@@ -600,7 +596,6 @@ class PaintingContext extends ClipContext { ...@@ -600,7 +596,6 @@ class PaintingContext extends ClipContext {
/// ///
/// {@macro flutter.rendering.PaintingContext.pushClipRect.oldLayer} /// {@macro flutter.rendering.PaintingContext.pushClipRect.oldLayer}
ClipPathLayer? pushClipPath(bool needsCompositing, Offset offset, Rect bounds, Path clipPath, PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias, ClipPathLayer? oldLayer }) { ClipPathLayer? pushClipPath(bool needsCompositing, Offset offset, Rect bounds, Path clipPath, PaintingContextCallback painter, { Clip clipBehavior = Clip.antiAlias, ClipPathLayer? oldLayer }) {
assert(clipBehavior != null);
if (clipBehavior == Clip.none) { if (clipBehavior == Clip.none) {
painter(this, offset); painter(this, offset);
return null; return null;
...@@ -637,7 +632,6 @@ class PaintingContext extends ClipContext { ...@@ -637,7 +632,6 @@ class PaintingContext extends ClipContext {
/// ancestor render objects that this render object will include a composited /// ancestor render objects that this render object will include a composited
/// layer, which, for example, causes them to use composited clips. /// layer, which, for example, causes them to use composited clips.
ColorFilterLayer pushColorFilter(Offset offset, ColorFilter colorFilter, PaintingContextCallback painter, { ColorFilterLayer? oldLayer }) { ColorFilterLayer pushColorFilter(Offset offset, ColorFilter colorFilter, PaintingContextCallback painter, { ColorFilterLayer? oldLayer }) {
assert(colorFilter != null);
final ColorFilterLayer layer = oldLayer ?? ColorFilterLayer(); final ColorFilterLayer layer = oldLayer ?? ColorFilterLayer();
layer.colorFilter = colorFilter; layer.colorFilter = colorFilter;
pushLayer(layer, painter, offset); pushLayer(layer, painter, offset);
...@@ -831,8 +825,7 @@ typedef LayoutCallback<T extends Constraints> = void Function(T constraints); ...@@ -831,8 +825,7 @@ typedef LayoutCallback<T extends Constraints> = void Function(T constraints);
/// You can obtain the [PipelineOwner] using the [RenderObject.owner] property. /// You can obtain the [PipelineOwner] using the [RenderObject.owner] property.
class SemanticsHandle { class SemanticsHandle {
SemanticsHandle._(PipelineOwner owner, this.listener) SemanticsHandle._(PipelineOwner owner, this.listener)
: assert(owner != null), : _owner = owner {
_owner = owner {
if (listener != null) { if (listener != null) {
_owner.semanticsOwner!.addListener(listener!); _owner.semanticsOwner!.addListener(listener!);
} }
...@@ -1510,7 +1503,6 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1510,7 +1503,6 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
@override @override
void adoptChild(RenderObject child) { void adoptChild(RenderObject child) {
assert(_debugCanPerformMutations); assert(_debugCanPerformMutations);
assert(child != null);
setupParentData(child); setupParentData(child);
markNeedsLayout(); markNeedsLayout();
markNeedsCompositingBitsUpdate(); markNeedsCompositingBitsUpdate();
...@@ -1525,7 +1517,6 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -1525,7 +1517,6 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
@override @override
void dropChild(RenderObject child) { void dropChild(RenderObject child) {
assert(_debugCanPerformMutations); assert(_debugCanPerformMutations);
assert(child != null);
assert(child.parentData != null); assert(child.parentData != null);
child._cleanRelayoutBoundary(); child._cleanRelayoutBoundary();
child.parentData!.detach(); child.parentData!.detach();
...@@ -2079,7 +2070,6 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2079,7 +2070,6 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
arguments: debugTimelineArguments, arguments: debugTimelineArguments,
); );
} }
assert(constraints != null);
assert(constraints.debugAssertIsValid( assert(constraints.debugAssertIsValid(
isAppliedConstraint: true, isAppliedConstraint: true,
informationCollector: () { informationCollector: () {
...@@ -3249,7 +3239,6 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -3249,7 +3239,6 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
_SemanticsFragment _getSemanticsForParent({ _SemanticsFragment _getSemanticsForParent({
required bool mergeIntoParent, required bool mergeIntoParent,
}) { }) {
assert(mergeIntoParent != null);
assert(!_needsLayout, 'Updated layout information required for $this to calculate semantics.'); assert(!_needsLayout, 'Updated layout information required for $this to calculate semantics.');
final SemanticsConfiguration config = _semanticsConfiguration; final SemanticsConfiguration config = _semanticsConfiguration;
...@@ -3975,7 +3964,6 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType ...@@ -3975,7 +3964,6 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
/// The previous child before the given child in the child list. /// The previous child before the given child in the child list.
ChildType? childBefore(ChildType child) { ChildType? childBefore(ChildType child) {
assert(child != null);
assert(child.parent == this); assert(child.parent == this);
final ParentDataType childParentData = child.parentData! as ParentDataType; final ParentDataType childParentData = child.parentData! as ParentDataType;
return childParentData.previousSibling; return childParentData.previousSibling;
...@@ -3983,7 +3971,6 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType ...@@ -3983,7 +3971,6 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
/// The next child after the given child in the child list. /// The next child after the given child in the child list.
ChildType? childAfter(ChildType child) { ChildType? childAfter(ChildType child) {
assert(child != null);
assert(child.parent == this); assert(child.parent == this);
final ParentDataType childParentData = child.parentData! as ParentDataType; final ParentDataType childParentData = child.parentData! as ParentDataType;
return childParentData.nextSibling; return childParentData.nextSibling;
...@@ -4088,7 +4075,7 @@ mixin RelayoutWhenSystemFontsChangeMixin on RenderObject { ...@@ -4088,7 +4075,7 @@ mixin RelayoutWhenSystemFontsChangeMixin on RenderObject {
abstract class _SemanticsFragment { abstract class _SemanticsFragment {
_SemanticsFragment({ _SemanticsFragment({
required this.dropsSemanticsOfPreviousSiblings, required this.dropsSemanticsOfPreviousSiblings,
}) : assert (dropsSemanticsOfPreviousSiblings != null); });
/// Incorporate the fragments of children into this fragment. /// Incorporate the fragments of children into this fragment.
void addAll(Iterable<_InterestingSemanticsFragment> fragments); void addAll(Iterable<_InterestingSemanticsFragment> fragments);
...@@ -4139,8 +4126,7 @@ abstract class _InterestingSemanticsFragment extends _SemanticsFragment { ...@@ -4139,8 +4126,7 @@ abstract class _InterestingSemanticsFragment extends _SemanticsFragment {
_InterestingSemanticsFragment({ _InterestingSemanticsFragment({
required RenderObject owner, required RenderObject owner,
required super.dropsSemanticsOfPreviousSiblings, required super.dropsSemanticsOfPreviousSiblings,
}) : assert(owner != null), }) : _ancestorChain = <RenderObject>[owner];
_ancestorChain = <RenderObject>[owner];
/// The [RenderObject] that owns this fragment (and any new [SemanticsNode] /// The [RenderObject] that owns this fragment (and any new [SemanticsNode]
/// introduced by it). /// introduced by it).
...@@ -4322,9 +4308,7 @@ class _SwitchableSemanticsFragment extends _InterestingSemanticsFragment { ...@@ -4322,9 +4308,7 @@ class _SwitchableSemanticsFragment extends _InterestingSemanticsFragment {
required super.dropsSemanticsOfPreviousSiblings, required super.dropsSemanticsOfPreviousSiblings,
}) : _siblingMergeGroups = siblingMergeGroups, }) : _siblingMergeGroups = siblingMergeGroups,
_mergeIntoParent = mergeIntoParent, _mergeIntoParent = mergeIntoParent,
_config = config, _config = config;
assert(mergeIntoParent != null),
assert(config != null);
final bool _mergeIntoParent; final bool _mergeIntoParent;
SemanticsConfiguration _config; SemanticsConfiguration _config;
...@@ -4679,7 +4663,6 @@ class _SemanticsGeometry { ...@@ -4679,7 +4663,6 @@ class _SemanticsGeometry {
/// From parent to child coordinate system. /// From parent to child coordinate system.
static Rect? _transformRect(Rect? rect, Matrix4 transform) { static Rect? _transformRect(Rect? rect, Matrix4 transform) {
assert(transform != null);
if (rect == null) { if (rect == null) {
return null; return null;
} }
...@@ -4700,18 +4683,12 @@ class _SemanticsGeometry { ...@@ -4700,18 +4683,12 @@ class _SemanticsGeometry {
Matrix4 transform, Matrix4 transform,
Matrix4 clipRectTransform, Matrix4 clipRectTransform,
) { ) {
assert(ancestor != null);
assert(child != null);
assert(transform != null);
assert(clipRectTransform != null);
assert(clipRectTransform.isIdentity()); assert(clipRectTransform.isIdentity());
RenderObject intermediateParent = child.parent! as RenderObject; RenderObject intermediateParent = child.parent! as RenderObject;
assert(intermediateParent != null);
while (intermediateParent != ancestor) { while (intermediateParent != ancestor) {
intermediateParent.applyPaintTransform(child, transform); intermediateParent.applyPaintTransform(child, transform);
intermediateParent = intermediateParent.parent! as RenderObject; intermediateParent = intermediateParent.parent! as RenderObject;
child = child.parent! as RenderObject; child = child.parent! as RenderObject;
assert(intermediateParent != null);
} }
ancestor.applyPaintTransform(child, transform); ancestor.applyPaintTransform(child, transform);
ancestor.applyPaintTransform(child, clipRectTransform); ancestor.applyPaintTransform(child, clipRectTransform);
...@@ -4757,8 +4734,7 @@ class DiagnosticsDebugCreator extends DiagnosticsProperty<Object> { ...@@ -4757,8 +4734,7 @@ class DiagnosticsDebugCreator extends DiagnosticsProperty<Object> {
/// Create a [DiagnosticsProperty] with its [value] initialized to input /// Create a [DiagnosticsProperty] with its [value] initialized to input
/// [RenderObject.debugCreator]. /// [RenderObject.debugCreator].
DiagnosticsDebugCreator(Object value) DiagnosticsDebugCreator(Object value)
: assert(value != null), : super(
super(
'debugCreator', 'debugCreator',
value, value,
level: DiagnosticLevel.hidden, level: DiagnosticLevel.hidden,
......
...@@ -88,15 +88,8 @@ class RenderParagraph extends RenderBox ...@@ -88,15 +88,8 @@ class RenderParagraph extends RenderBox
List<RenderBox>? children, List<RenderBox>? children,
Color? selectionColor, Color? selectionColor,
SelectionRegistrar? registrar, SelectionRegistrar? registrar,
}) : assert(text != null), }) : assert(text.debugAssertIsValid()),
assert(text.debugAssertIsValid()),
assert(textAlign != null),
assert(textDirection != null),
assert(softWrap != null),
assert(overflow != null),
assert(textScaleFactor != null),
assert(maxLines == null || maxLines > 0), assert(maxLines == null || maxLines > 0),
assert(textWidthBasis != null),
_softWrap = softWrap, _softWrap = softWrap,
_overflow = overflow, _overflow = overflow,
_selectionColor = selectionColor, _selectionColor = selectionColor,
...@@ -132,7 +125,6 @@ class RenderParagraph extends RenderBox ...@@ -132,7 +125,6 @@ class RenderParagraph extends RenderBox
/// The text to display. /// The text to display.
InlineSpan get text => _textPainter.text!; InlineSpan get text => _textPainter.text!;
set text(InlineSpan value) { set text(InlineSpan value) {
assert(value != null);
switch (_textPainter.text!.compareTo(value)) { switch (_textPainter.text!.compareTo(value)) {
case RenderComparison.identical: case RenderComparison.identical:
return; return;
...@@ -279,7 +271,6 @@ class RenderParagraph extends RenderBox ...@@ -279,7 +271,6 @@ class RenderParagraph extends RenderBox
/// How the text should be aligned horizontally. /// How the text should be aligned horizontally.
TextAlign get textAlign => _textPainter.textAlign; TextAlign get textAlign => _textPainter.textAlign;
set textAlign(TextAlign value) { set textAlign(TextAlign value) {
assert(value != null);
if (_textPainter.textAlign == value) { if (_textPainter.textAlign == value) {
return; return;
} }
...@@ -302,7 +293,6 @@ class RenderParagraph extends RenderBox ...@@ -302,7 +293,6 @@ class RenderParagraph extends RenderBox
/// This must not be null. /// This must not be null.
TextDirection get textDirection => _textPainter.textDirection!; TextDirection get textDirection => _textPainter.textDirection!;
set textDirection(TextDirection value) { set textDirection(TextDirection value) {
assert(value != null);
if (_textPainter.textDirection == value) { if (_textPainter.textDirection == value) {
return; return;
} }
...@@ -320,7 +310,6 @@ class RenderParagraph extends RenderBox ...@@ -320,7 +310,6 @@ class RenderParagraph extends RenderBox
bool get softWrap => _softWrap; bool get softWrap => _softWrap;
bool _softWrap; bool _softWrap;
set softWrap(bool value) { set softWrap(bool value) {
assert(value != null);
if (_softWrap == value) { if (_softWrap == value) {
return; return;
} }
...@@ -332,7 +321,6 @@ class RenderParagraph extends RenderBox ...@@ -332,7 +321,6 @@ class RenderParagraph extends RenderBox
TextOverflow get overflow => _overflow; TextOverflow get overflow => _overflow;
TextOverflow _overflow; TextOverflow _overflow;
set overflow(TextOverflow value) { set overflow(TextOverflow value) {
assert(value != null);
if (_overflow == value) { if (_overflow == value) {
return; return;
} }
...@@ -347,7 +335,6 @@ class RenderParagraph extends RenderBox ...@@ -347,7 +335,6 @@ class RenderParagraph extends RenderBox
/// the specified font size. /// the specified font size.
double get textScaleFactor => _textPainter.textScaleFactor; double get textScaleFactor => _textPainter.textScaleFactor;
set textScaleFactor(double value) { set textScaleFactor(double value) {
assert(value != null);
if (_textPainter.textScaleFactor == value) { if (_textPainter.textScaleFactor == value) {
return; return;
} }
...@@ -405,7 +392,6 @@ class RenderParagraph extends RenderBox ...@@ -405,7 +392,6 @@ class RenderParagraph extends RenderBox
/// {@macro flutter.painting.textPainter.textWidthBasis} /// {@macro flutter.painting.textPainter.textWidthBasis}
TextWidthBasis get textWidthBasis => _textPainter.textWidthBasis; TextWidthBasis get textWidthBasis => _textPainter.textWidthBasis;
set textWidthBasis(TextWidthBasis value) { set textWidthBasis(TextWidthBasis value) {
assert(value != null);
if (_textPainter.textWidthBasis == value) { if (_textPainter.textWidthBasis == value) {
return; return;
} }
...@@ -490,7 +476,6 @@ class RenderParagraph extends RenderBox ...@@ -490,7 +476,6 @@ class RenderParagraph extends RenderBox
@override @override
double computeDistanceToActualBaseline(TextBaseline baseline) { double computeDistanceToActualBaseline(TextBaseline baseline) {
assert(!debugNeedsLayout); assert(!debugNeedsLayout);
assert(constraints != null);
assert(constraints.debugAssertIsValid()); assert(constraints.debugAssertIsValid());
_layoutTextWithConstraints(constraints); _layoutTextWithConstraints(constraints);
// TODO(garyq): Since our metric for ideographic baseline is currently // TODO(garyq): Since our metric for ideographic baseline is currently
...@@ -813,7 +798,6 @@ class RenderParagraph extends RenderBox ...@@ -813,7 +798,6 @@ class RenderParagraph extends RenderBox
_overflowShader = null; _overflowShader = null;
break; break;
case TextOverflow.fade: case TextOverflow.fade:
assert(textDirection != null);
_needsClipping = true; _needsClipping = true;
final TextPainter fadeSizePainter = TextPainter( final TextPainter fadeSizePainter = TextPainter(
text: TextSpan(style: _textPainter.text!.style, text: '\u2026'), text: TextSpan(style: _textPainter.text!.style, text: '\u2026'),
...@@ -975,8 +959,6 @@ class RenderParagraph extends RenderBox ...@@ -975,8 +959,6 @@ class RenderParagraph extends RenderBox
ui.BoxWidthStyle boxWidthStyle = ui.BoxWidthStyle.tight, ui.BoxWidthStyle boxWidthStyle = ui.BoxWidthStyle.tight,
}) { }) {
assert(!debugNeedsLayout); assert(!debugNeedsLayout);
assert(boxHeightStyle != null);
assert(boxWidthStyle != null);
_layoutTextWithConstraints(constraints); _layoutTextWithConstraints(constraints);
return _textPainter.getBoxesForSelection( return _textPainter.getBoxesForSelection(
selection, selection,
......
...@@ -67,11 +67,7 @@ class RenderPerformanceOverlay extends RenderBox { ...@@ -67,11 +67,7 @@ class RenderPerformanceOverlay extends RenderBox {
int rasterizerThreshold = 0, int rasterizerThreshold = 0,
bool checkerboardRasterCacheImages = false, bool checkerboardRasterCacheImages = false,
bool checkerboardOffscreenLayers = false, bool checkerboardOffscreenLayers = false,
}) : assert(optionsMask != null), }) : _optionsMask = optionsMask,
assert(rasterizerThreshold != null),
assert(checkerboardRasterCacheImages != null),
assert(checkerboardOffscreenLayers != null),
_optionsMask = optionsMask,
_rasterizerThreshold = rasterizerThreshold, _rasterizerThreshold = rasterizerThreshold,
_checkerboardRasterCacheImages = checkerboardRasterCacheImages, _checkerboardRasterCacheImages = checkerboardRasterCacheImages,
_checkerboardOffscreenLayers = checkerboardOffscreenLayers; _checkerboardOffscreenLayers = checkerboardOffscreenLayers;
...@@ -81,7 +77,6 @@ class RenderPerformanceOverlay extends RenderBox { ...@@ -81,7 +77,6 @@ class RenderPerformanceOverlay extends RenderBox {
int get optionsMask => _optionsMask; int get optionsMask => _optionsMask;
int _optionsMask; int _optionsMask;
set optionsMask(int value) { set optionsMask(int value) {
assert(value != null);
if (value == _optionsMask) { if (value == _optionsMask) {
return; return;
} }
...@@ -95,7 +90,6 @@ class RenderPerformanceOverlay extends RenderBox { ...@@ -95,7 +90,6 @@ class RenderPerformanceOverlay extends RenderBox {
int get rasterizerThreshold => _rasterizerThreshold; int get rasterizerThreshold => _rasterizerThreshold;
int _rasterizerThreshold; int _rasterizerThreshold;
set rasterizerThreshold(int value) { set rasterizerThreshold(int value) {
assert(value != null);
if (value == _rasterizerThreshold) { if (value == _rasterizerThreshold) {
return; return;
} }
...@@ -107,7 +101,6 @@ class RenderPerformanceOverlay extends RenderBox { ...@@ -107,7 +101,6 @@ class RenderPerformanceOverlay extends RenderBox {
bool get checkerboardRasterCacheImages => _checkerboardRasterCacheImages; bool get checkerboardRasterCacheImages => _checkerboardRasterCacheImages;
bool _checkerboardRasterCacheImages; bool _checkerboardRasterCacheImages;
set checkerboardRasterCacheImages(bool value) { set checkerboardRasterCacheImages(bool value) {
assert(value != null);
if (value == _checkerboardRasterCacheImages) { if (value == _checkerboardRasterCacheImages) {
return; return;
} }
...@@ -119,7 +112,6 @@ class RenderPerformanceOverlay extends RenderBox { ...@@ -119,7 +112,6 @@ class RenderPerformanceOverlay extends RenderBox {
bool get checkerboardOffscreenLayers => _checkerboardOffscreenLayers; bool get checkerboardOffscreenLayers => _checkerboardOffscreenLayers;
bool _checkerboardOffscreenLayers; bool _checkerboardOffscreenLayers;
set checkerboardOffscreenLayers(bool value) { set checkerboardOffscreenLayers(bool value) {
assert(value != null);
if (value == _checkerboardOffscreenLayers) { if (value == _checkerboardOffscreenLayers) {
return; return;
} }
......
...@@ -80,11 +80,7 @@ class RenderAndroidView extends PlatformViewRenderBox { ...@@ -80,11 +80,7 @@ class RenderAndroidView extends PlatformViewRenderBox {
required PlatformViewHitTestBehavior hitTestBehavior, required PlatformViewHitTestBehavior hitTestBehavior,
required Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers, required Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers,
Clip clipBehavior = Clip.hardEdge, Clip clipBehavior = Clip.hardEdge,
}) : assert(viewController != null), }) : _viewController = viewController,
assert(hitTestBehavior != null),
assert(gestureRecognizers != null),
assert(clipBehavior != null),
_viewController = viewController,
_clipBehavior = clipBehavior, _clipBehavior = clipBehavior,
super(controller: viewController, hitTestBehavior: hitTestBehavior, gestureRecognizers: gestureRecognizers) { super(controller: viewController, hitTestBehavior: hitTestBehavior, gestureRecognizers: gestureRecognizers) {
_viewController.pointTransformer = (Offset offset) => globalToLocal(offset); _viewController.pointTransformer = (Offset offset) => globalToLocal(offset);
...@@ -110,8 +106,6 @@ class RenderAndroidView extends PlatformViewRenderBox { ...@@ -110,8 +106,6 @@ class RenderAndroidView extends PlatformViewRenderBox {
@override @override
set controller(AndroidViewController controller) { set controller(AndroidViewController controller) {
assert(!_isDisposed); assert(!_isDisposed);
assert(_viewController != null);
assert(controller != null);
if (_viewController == controller) { if (_viewController == controller) {
return; return;
} }
...@@ -132,7 +126,6 @@ class RenderAndroidView extends PlatformViewRenderBox { ...@@ -132,7 +126,6 @@ class RenderAndroidView extends PlatformViewRenderBox {
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsPaint(); markNeedsPaint();
...@@ -299,10 +292,7 @@ class RenderUiKitView extends RenderBox { ...@@ -299,10 +292,7 @@ class RenderUiKitView extends RenderBox {
required UiKitViewController viewController, required UiKitViewController viewController,
required this.hitTestBehavior, required this.hitTestBehavior,
required Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers, required Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers,
}) : assert(viewController != null), }) : _viewController = viewController {
assert(hitTestBehavior != null),
assert(gestureRecognizers != null),
_viewController = viewController {
updateGestureRecognizers(gestureRecognizers); updateGestureRecognizers(gestureRecognizers);
} }
...@@ -314,7 +304,6 @@ class RenderUiKitView extends RenderBox { ...@@ -314,7 +304,6 @@ class RenderUiKitView extends RenderBox {
UiKitViewController get viewController => _viewController; UiKitViewController get viewController => _viewController;
UiKitViewController _viewController; UiKitViewController _viewController;
set viewController(UiKitViewController value) { set viewController(UiKitViewController value) {
assert(value != null);
if (_viewController == value) { if (_viewController == value) {
return; return;
} }
...@@ -333,7 +322,6 @@ class RenderUiKitView extends RenderBox { ...@@ -333,7 +322,6 @@ class RenderUiKitView extends RenderBox {
/// {@macro flutter.rendering.PlatformViewRenderBox.updateGestureRecognizers} /// {@macro flutter.rendering.PlatformViewRenderBox.updateGestureRecognizers}
void updateGestureRecognizers(Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers) { void updateGestureRecognizers(Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers) {
assert(gestureRecognizers != null);
assert( assert(
_factoriesTypeSet(gestureRecognizers).length == gestureRecognizers.length, _factoriesTypeSet(gestureRecognizers).length == gestureRecognizers.length,
'There were multiple gesture recognizer factories for the same type, there must only be a single ' 'There were multiple gesture recognizer factories for the same type, there must only be a single '
...@@ -632,9 +620,7 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin { ...@@ -632,9 +620,7 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
required PlatformViewController controller, required PlatformViewController controller,
required PlatformViewHitTestBehavior hitTestBehavior, required PlatformViewHitTestBehavior hitTestBehavior,
required Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers, required Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers,
}) : assert(controller != null && controller.viewId != null && controller.viewId > -1), }) : assert(controller.viewId > -1),
assert(hitTestBehavior != null),
assert(gestureRecognizers != null),
_controller = controller { _controller = controller {
this.hitTestBehavior = hitTestBehavior; this.hitTestBehavior = hitTestBehavior;
updateGestureRecognizers(gestureRecognizers); updateGestureRecognizers(gestureRecognizers);
...@@ -645,8 +631,7 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin { ...@@ -645,8 +631,7 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
PlatformViewController _controller; PlatformViewController _controller;
/// This value must not be null, and setting it to a new value will result in a repaint. /// This value must not be null, and setting it to a new value will result in a repaint.
set controller(covariant PlatformViewController controller) { set controller(covariant PlatformViewController controller) {
assert(controller != null); assert(controller.viewId > -1);
assert(controller.viewId != null && controller.viewId > -1);
if (_controller == controller) { if (_controller == controller) {
return; return;
...@@ -695,7 +680,6 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin { ...@@ -695,7 +680,6 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
@override @override
void paint(PaintingContext context, Offset offset) { void paint(PaintingContext context, Offset offset) {
assert(_controller.viewId != null);
context.addLayer(PlatformViewLayer( context.addLayer(PlatformViewLayer(
rect: offset & size, rect: offset & size,
viewId: _controller.viewId, viewId: _controller.viewId,
...@@ -705,7 +689,6 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin { ...@@ -705,7 +689,6 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
@override @override
void describeSemanticsConfiguration(SemanticsConfiguration config) { void describeSemanticsConfiguration(SemanticsConfiguration config) {
super.describeSemanticsConfiguration(config); super.describeSemanticsConfiguration(config);
assert(_controller.viewId != null);
config.isSemanticBoundary = true; config.isSemanticBoundary = true;
config.platformViewId = _controller.viewId; config.platformViewId = _controller.viewId;
} }
...@@ -733,7 +716,6 @@ mixin _PlatformViewGestureMixin on RenderBox implements MouseTrackerAnnotation { ...@@ -733,7 +716,6 @@ mixin _PlatformViewGestureMixin on RenderBox implements MouseTrackerAnnotation {
/// Any active gesture arena the `PlatformView` participates in is rejected when the /// Any active gesture arena the `PlatformView` participates in is rejected when the
/// set of gesture recognizers is changed. /// set of gesture recognizers is changed.
void _updateGestureRecognizersWithCallBack(Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers, _HandlePointerEvent handlePointerEvent) { void _updateGestureRecognizersWithCallBack(Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers, _HandlePointerEvent handlePointerEvent) {
assert(gestureRecognizers != null);
assert( assert(
_factoriesTypeSet(gestureRecognizers).length == gestureRecognizers.length, _factoriesTypeSet(gestureRecognizers).length == gestureRecognizers.length,
'There were multiple gesture recognizer factories for the same type, there must only be a single ' 'There were multiple gesture recognizer factories for the same type, there must only be a single '
......
...@@ -74,14 +74,12 @@ abstract class RenderProxySliver extends RenderSliver with RenderObjectWithChild ...@@ -74,14 +74,12 @@ abstract class RenderProxySliver extends RenderSliver with RenderObjectWithChild
@override @override
double childMainAxisPosition(RenderSliver child) { double childMainAxisPosition(RenderSliver child) {
assert(child != null);
assert(child == this.child); assert(child == this.child);
return 0.0; return 0.0;
} }
@override @override
void applyPaintTransform(RenderObject child, Matrix4 transform) { void applyPaintTransform(RenderObject child, Matrix4 transform) {
assert(child != null);
final SliverPhysicalParentData childParentData = child.parentData! as SliverPhysicalParentData; final SliverPhysicalParentData childParentData = child.parentData! as SliverPhysicalParentData;
childParentData.applyPaintTransform(transform); childParentData.applyPaintTransform(transform);
} }
...@@ -105,8 +103,7 @@ class RenderSliverOpacity extends RenderProxySliver { ...@@ -105,8 +103,7 @@ class RenderSliverOpacity extends RenderProxySliver {
double opacity = 1.0, double opacity = 1.0,
bool alwaysIncludeSemantics = false, bool alwaysIncludeSemantics = false,
RenderSliver? sliver, RenderSliver? sliver,
}) : assert(opacity != null && opacity >= 0.0 && opacity <= 1.0), }) : assert(opacity >= 0.0 && opacity <= 1.0),
assert(alwaysIncludeSemantics != null),
_opacity = opacity, _opacity = opacity,
_alwaysIncludeSemantics = alwaysIncludeSemantics, _alwaysIncludeSemantics = alwaysIncludeSemantics,
_alpha = ui.Color.getAlphaFromOpacity(opacity) { _alpha = ui.Color.getAlphaFromOpacity(opacity) {
...@@ -131,7 +128,6 @@ class RenderSliverOpacity extends RenderProxySliver { ...@@ -131,7 +128,6 @@ class RenderSliverOpacity extends RenderProxySliver {
double get opacity => _opacity; double get opacity => _opacity;
double _opacity; double _opacity;
set opacity(double value) { set opacity(double value) {
assert(value != null);
assert(value >= 0.0 && value <= 1.0); assert(value >= 0.0 && value <= 1.0);
if (_opacity == value) { if (_opacity == value) {
return; return;
...@@ -220,8 +216,7 @@ class RenderSliverIgnorePointer extends RenderProxySliver { ...@@ -220,8 +216,7 @@ class RenderSliverIgnorePointer extends RenderProxySliver {
RenderSliver? sliver, RenderSliver? sliver,
bool ignoring = true, bool ignoring = true,
bool? ignoringSemantics, bool? ignoringSemantics,
}) : assert(ignoring != null), }) : _ignoring = ignoring,
_ignoring = ignoring,
_ignoringSemantics = ignoringSemantics { _ignoringSemantics = ignoringSemantics {
child = sliver; child = sliver;
} }
...@@ -233,7 +228,6 @@ class RenderSliverIgnorePointer extends RenderProxySliver { ...@@ -233,7 +228,6 @@ class RenderSliverIgnorePointer extends RenderProxySliver {
bool get ignoring => _ignoring; bool get ignoring => _ignoring;
bool _ignoring; bool _ignoring;
set ignoring(bool value) { set ignoring(bool value) {
assert(value != null);
if (value == _ignoring) { if (value == _ignoring) {
return; return;
} }
...@@ -297,8 +291,7 @@ class RenderSliverOffstage extends RenderProxySliver { ...@@ -297,8 +291,7 @@ class RenderSliverOffstage extends RenderProxySliver {
RenderSliverOffstage({ RenderSliverOffstage({
bool offstage = true, bool offstage = true,
RenderSliver? sliver, RenderSliver? sliver,
}) : assert(offstage != null), }) : _offstage = offstage {
_offstage = offstage {
child = sliver; child = sliver;
} }
...@@ -313,7 +306,6 @@ class RenderSliverOffstage extends RenderProxySliver { ...@@ -313,7 +306,6 @@ class RenderSliverOffstage extends RenderProxySliver {
bool _offstage; bool _offstage;
set offstage(bool value) { set offstage(bool value) {
assert(value != null);
if (value == _offstage) { if (value == _offstage) {
return; return;
} }
...@@ -401,8 +393,7 @@ class RenderSliverAnimatedOpacity extends RenderProxySliver with RenderAnimatedO ...@@ -401,8 +393,7 @@ class RenderSliverAnimatedOpacity extends RenderProxySliver with RenderAnimatedO
required Animation<double> opacity, required Animation<double> opacity,
bool alwaysIncludeSemantics = false, bool alwaysIncludeSemantics = false,
RenderSliver? sliver, RenderSliver? sliver,
}) : assert(opacity != null), }) {
assert(alwaysIncludeSemantics != null) {
this.opacity = opacity; this.opacity = opacity;
this.alwaysIncludeSemantics = alwaysIncludeSemantics; this.alwaysIncludeSemantics = alwaysIncludeSemantics;
child = sliver; child = sliver;
......
...@@ -24,8 +24,7 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB ...@@ -24,8 +24,7 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB
RenderRotatedBox({ RenderRotatedBox({
required int quarterTurns, required int quarterTurns,
RenderBox? child, RenderBox? child,
}) : assert(quarterTurns != null), }) : _quarterTurns = quarterTurns {
_quarterTurns = quarterTurns {
this.child = child; this.child = child;
} }
...@@ -33,7 +32,6 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB ...@@ -33,7 +32,6 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB
int get quarterTurns => _quarterTurns; int get quarterTurns => _quarterTurns;
int _quarterTurns; int _quarterTurns;
set quarterTurns(int value) { set quarterTurns(int value) {
assert(value != null);
if (_quarterTurns == value) { if (_quarterTurns == value) {
return; return;
} }
......
...@@ -687,9 +687,7 @@ class SelectionPoint { ...@@ -687,9 +687,7 @@ class SelectionPoint {
required this.localPosition, required this.localPosition,
required this.lineHeight, required this.lineHeight,
required this.handleType, required this.handleType,
}) : assert(localPosition != null), });
assert(lineHeight != null),
assert(handleType != null);
/// The position of the selection point in the local coordinates of the /// The position of the selection point in the local coordinates of the
/// containing [Selectable]. /// containing [Selectable].
......
...@@ -107,8 +107,7 @@ class RenderPadding extends RenderShiftedBox { ...@@ -107,8 +107,7 @@ class RenderPadding extends RenderShiftedBox {
required EdgeInsetsGeometry padding, required EdgeInsetsGeometry padding,
TextDirection? textDirection, TextDirection? textDirection,
RenderBox? child, RenderBox? child,
}) : assert(padding != null), }) : assert(padding.isNonNegative),
assert(padding.isNonNegative),
_textDirection = textDirection, _textDirection = textDirection,
_padding = padding, _padding = padding,
super(child); super(child);
...@@ -135,7 +134,6 @@ class RenderPadding extends RenderShiftedBox { ...@@ -135,7 +134,6 @@ class RenderPadding extends RenderShiftedBox {
EdgeInsetsGeometry get padding => _padding; EdgeInsetsGeometry get padding => _padding;
EdgeInsetsGeometry _padding; EdgeInsetsGeometry _padding;
set padding(EdgeInsetsGeometry value) { set padding(EdgeInsetsGeometry value) {
assert(value != null);
assert(value.isNonNegative); assert(value.isNonNegative);
if (_padding == value) { if (_padding == value) {
return; return;
...@@ -277,8 +275,7 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox { ...@@ -277,8 +275,7 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
AlignmentGeometry alignment = Alignment.center, AlignmentGeometry alignment = Alignment.center,
required TextDirection? textDirection, required TextDirection? textDirection,
RenderBox? child, RenderBox? child,
}) : assert(alignment != null), }) : _alignment = alignment,
_alignment = alignment,
_textDirection = textDirection, _textDirection = textDirection,
super(child); super(child);
...@@ -314,7 +311,6 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox { ...@@ -314,7 +311,6 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
/// ///
/// The new alignment must not be null. /// The new alignment must not be null.
set alignment(AlignmentGeometry value) { set alignment(AlignmentGeometry value) {
assert(value != null);
if (_alignment == value) { if (_alignment == value) {
return; return;
} }
...@@ -697,10 +693,7 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO ...@@ -697,10 +693,7 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO
required BoxConstraintsTransform constraintsTransform, required BoxConstraintsTransform constraintsTransform,
super.child, super.child,
Clip clipBehavior = Clip.none, Clip clipBehavior = Clip.none,
}) : assert(alignment != null), }) : _constraintsTransform = constraintsTransform,
assert(clipBehavior != null),
assert(constraintsTransform != null),
_constraintsTransform = constraintsTransform,
_clipBehavior = clipBehavior; _clipBehavior = clipBehavior;
/// {@macro flutter.widgets.constraintsTransform} /// {@macro flutter.widgets.constraintsTransform}
...@@ -729,7 +722,6 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO ...@@ -729,7 +722,6 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior; Clip _clipBehavior;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsPaint(); markNeedsPaint();
...@@ -783,7 +775,6 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO ...@@ -783,7 +775,6 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO
final RenderBox? child = this.child; final RenderBox? child = this.child;
if (child != null) { if (child != null) {
final BoxConstraints childConstraints = constraintsTransform(constraints); final BoxConstraints childConstraints = constraintsTransform(constraints);
assert(childConstraints != null);
assert(childConstraints.isNormalized, '$childConstraints is not normalized'); assert(childConstraints.isNormalized, '$childConstraints is not normalized');
_childConstraints = childConstraints; _childConstraints = childConstraints;
child.layout(childConstraints, parentUsesSize: true); child.layout(childConstraints, parentUsesSize: true);
...@@ -896,14 +887,12 @@ class RenderSizedOverflowBox extends RenderAligningShiftedBox { ...@@ -896,14 +887,12 @@ class RenderSizedOverflowBox extends RenderAligningShiftedBox {
required Size requestedSize, required Size requestedSize,
super.alignment, super.alignment,
super.textDirection, super.textDirection,
}) : assert(requestedSize != null), }) : _requestedSize = requestedSize;
_requestedSize = requestedSize;
/// The size this render box should attempt to be. /// The size this render box should attempt to be.
Size get requestedSize => _requestedSize; Size get requestedSize => _requestedSize;
Size _requestedSize; Size _requestedSize;
set requestedSize(Size value) { set requestedSize(Size value) {
assert(value != null);
if (_requestedSize == value) { if (_requestedSize == value) {
return; return;
} }
...@@ -1212,15 +1201,13 @@ class RenderCustomSingleChildLayoutBox extends RenderShiftedBox { ...@@ -1212,15 +1201,13 @@ class RenderCustomSingleChildLayoutBox extends RenderShiftedBox {
RenderCustomSingleChildLayoutBox({ RenderCustomSingleChildLayoutBox({
RenderBox? child, RenderBox? child,
required SingleChildLayoutDelegate delegate, required SingleChildLayoutDelegate delegate,
}) : assert(delegate != null), }) : _delegate = delegate,
_delegate = delegate,
super(child); super(child);
/// A delegate that controls this object's layout. /// A delegate that controls this object's layout.
SingleChildLayoutDelegate get delegate => _delegate; SingleChildLayoutDelegate get delegate => _delegate;
SingleChildLayoutDelegate _delegate; SingleChildLayoutDelegate _delegate;
set delegate(SingleChildLayoutDelegate newDelegate) { set delegate(SingleChildLayoutDelegate newDelegate) {
assert(newDelegate != null);
if (_delegate == newDelegate) { if (_delegate == newDelegate) {
return; return;
} }
...@@ -1333,9 +1320,7 @@ class RenderBaseline extends RenderShiftedBox { ...@@ -1333,9 +1320,7 @@ class RenderBaseline extends RenderShiftedBox {
RenderBox? child, RenderBox? child,
required double baseline, required double baseline,
required TextBaseline baselineType, required TextBaseline baselineType,
}) : assert(baseline != null), }) : _baseline = baseline,
assert(baselineType != null),
_baseline = baseline,
_baselineType = baselineType, _baselineType = baselineType,
super(child); super(child);
...@@ -1344,7 +1329,6 @@ class RenderBaseline extends RenderShiftedBox { ...@@ -1344,7 +1329,6 @@ class RenderBaseline extends RenderShiftedBox {
double get baseline => _baseline; double get baseline => _baseline;
double _baseline; double _baseline;
set baseline(double value) { set baseline(double value) {
assert(value != null);
if (_baseline == value) { if (_baseline == value) {
return; return;
} }
...@@ -1356,7 +1340,6 @@ class RenderBaseline extends RenderShiftedBox { ...@@ -1356,7 +1340,6 @@ class RenderBaseline extends RenderShiftedBox {
TextBaseline get baselineType => _baselineType; TextBaseline get baselineType => _baselineType;
TextBaseline _baselineType; TextBaseline _baselineType;
set baselineType(TextBaseline value) { set baselineType(TextBaseline value) {
assert(value != null);
if (_baselineType == value) { if (_baselineType == value) {
return; return;
} }
......
...@@ -32,8 +32,7 @@ class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor { ...@@ -32,8 +32,7 @@ class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor {
RenderSliverFillViewport({ RenderSliverFillViewport({
required super.childManager, required super.childManager,
double viewportFraction = 1.0, double viewportFraction = 1.0,
}) : assert(viewportFraction != null), }) : assert(viewportFraction > 0.0),
assert(viewportFraction > 0.0),
_viewportFraction = viewportFraction; _viewportFraction = viewportFraction;
@override @override
...@@ -47,7 +46,6 @@ class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor { ...@@ -47,7 +46,6 @@ class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor {
double get viewportFraction => _viewportFraction; double get viewportFraction => _viewportFraction;
double _viewportFraction; double _viewportFraction;
set viewportFraction(double value) { set viewportFraction(double value) {
assert(value != null);
if (_viewportFraction == value) { if (_viewportFraction == value) {
return; return;
} }
......
...@@ -257,7 +257,6 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda ...@@ -257,7 +257,6 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
child.layout(childConstraints); child.layout(childConstraints);
} }
trailingChildWithLayout = child; trailingChildWithLayout = child;
assert(child != null);
final SliverMultiBoxAdaptorParentData childParentData = child.parentData! as SliverMultiBoxAdaptorParentData; final SliverMultiBoxAdaptorParentData childParentData = child.parentData! as SliverMultiBoxAdaptorParentData;
assert(childParentData.index == index); assert(childParentData.index == index);
childParentData.layoutOffset = indexToLayoutOffset(itemExtent, childParentData.index!); childParentData.layoutOffset = indexToLayoutOffset(itemExtent, childParentData.index!);
...@@ -351,7 +350,6 @@ class RenderSliverFixedExtentList extends RenderSliverFixedExtentBoxAdaptor { ...@@ -351,7 +350,6 @@ class RenderSliverFixedExtentList extends RenderSliverFixedExtentBoxAdaptor {
double get itemExtent => _itemExtent; double get itemExtent => _itemExtent;
double _itemExtent; double _itemExtent;
set itemExtent(double value) { set itemExtent(double value) {
assert(value != null);
if (_itemExtent == value) { if (_itemExtent == value) {
return; return;
} }
......
...@@ -155,12 +155,11 @@ class SliverGridRegularTileLayout extends SliverGridLayout { ...@@ -155,12 +155,11 @@ class SliverGridRegularTileLayout extends SliverGridLayout {
required this.childMainAxisExtent, required this.childMainAxisExtent,
required this.childCrossAxisExtent, required this.childCrossAxisExtent,
required this.reverseCrossAxis, required this.reverseCrossAxis,
}) : assert(crossAxisCount != null && crossAxisCount > 0), }) : assert(crossAxisCount > 0),
assert(mainAxisStride != null && mainAxisStride >= 0), assert(mainAxisStride >= 0),
assert(crossAxisStride != null && crossAxisStride >= 0), assert(crossAxisStride >= 0),
assert(childMainAxisExtent != null && childMainAxisExtent >= 0), assert(childMainAxisExtent >= 0),
assert(childCrossAxisExtent != null && childCrossAxisExtent >= 0), assert(childCrossAxisExtent >= 0);
assert(reverseCrossAxis != null);
/// The number of children in the cross axis. /// The number of children in the cross axis.
final int crossAxisCount; final int crossAxisCount;
...@@ -226,7 +225,6 @@ class SliverGridRegularTileLayout extends SliverGridLayout { ...@@ -226,7 +225,6 @@ class SliverGridRegularTileLayout extends SliverGridLayout {
@override @override
double computeMaxScrollOffset(int childCount) { double computeMaxScrollOffset(int childCount) {
assert(childCount != null);
final int mainAxisCount = ((childCount - 1) ~/ crossAxisCount) + 1; final int mainAxisCount = ((childCount - 1) ~/ crossAxisCount) + 1;
final double mainAxisSpacing = mainAxisStride - childMainAxisExtent; final double mainAxisSpacing = mainAxisStride - childMainAxisExtent;
return mainAxisStride * mainAxisCount - mainAxisSpacing; return mainAxisStride * mainAxisCount - mainAxisSpacing;
...@@ -317,10 +315,10 @@ class SliverGridDelegateWithFixedCrossAxisCount extends SliverGridDelegate { ...@@ -317,10 +315,10 @@ class SliverGridDelegateWithFixedCrossAxisCount extends SliverGridDelegate {
this.crossAxisSpacing = 0.0, this.crossAxisSpacing = 0.0,
this.childAspectRatio = 1.0, this.childAspectRatio = 1.0,
this.mainAxisExtent, this.mainAxisExtent,
}) : assert(crossAxisCount != null && crossAxisCount > 0), }) : assert(crossAxisCount > 0),
assert(mainAxisSpacing != null && mainAxisSpacing >= 0), assert(mainAxisSpacing >= 0),
assert(crossAxisSpacing != null && crossAxisSpacing >= 0), assert(crossAxisSpacing >= 0),
assert(childAspectRatio != null && childAspectRatio > 0); assert(childAspectRatio > 0);
/// The number of children in the cross axis. /// The number of children in the cross axis.
final int crossAxisCount; final int crossAxisCount;
...@@ -416,10 +414,10 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate { ...@@ -416,10 +414,10 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate {
this.crossAxisSpacing = 0.0, this.crossAxisSpacing = 0.0,
this.childAspectRatio = 1.0, this.childAspectRatio = 1.0,
this.mainAxisExtent, this.mainAxisExtent,
}) : assert(maxCrossAxisExtent != null && maxCrossAxisExtent > 0), }) : assert(maxCrossAxisExtent > 0),
assert(mainAxisSpacing != null && mainAxisSpacing >= 0), assert(mainAxisSpacing >= 0),
assert(crossAxisSpacing != null && crossAxisSpacing >= 0), assert(crossAxisSpacing >= 0),
assert(childAspectRatio != null && childAspectRatio > 0); assert(childAspectRatio > 0);
/// The maximum extent of tiles in the cross axis. /// The maximum extent of tiles in the cross axis.
/// ///
...@@ -525,8 +523,7 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor { ...@@ -525,8 +523,7 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
RenderSliverGrid({ RenderSliverGrid({
required super.childManager, required super.childManager,
required SliverGridDelegate gridDelegate, required SliverGridDelegate gridDelegate,
}) : assert(gridDelegate != null), }) : _gridDelegate = gridDelegate;
_gridDelegate = gridDelegate;
@override @override
void setupParentData(RenderObject child) { void setupParentData(RenderObject child) {
...@@ -539,7 +536,6 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor { ...@@ -539,7 +536,6 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
SliverGridDelegate get gridDelegate => _gridDelegate; SliverGridDelegate get gridDelegate => _gridDelegate;
SliverGridDelegate _gridDelegate; SliverGridDelegate _gridDelegate;
set gridDelegate(SliverGridDelegate value) { set gridDelegate(SliverGridDelegate value) {
assert(value != null);
if (_gridDelegate == value) { if (_gridDelegate == value) {
return; return;
} }
...@@ -640,7 +636,6 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor { ...@@ -640,7 +636,6 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
child.layout(childConstraints); child.layout(childConstraints);
} }
trailingChildWithLayout = child; trailingChildWithLayout = child;
assert(child != null);
final SliverGridParentData childParentData = child.parentData! as SliverGridParentData; final SliverGridParentData childParentData = child.parentData! as SliverGridParentData;
childParentData.layoutOffset = gridGeometry.scrollOffset; childParentData.layoutOffset = gridGeometry.scrollOffset;
childParentData.crossAxisOffset = gridGeometry.crossAxisOffset; childParentData.crossAxisOffset = gridGeometry.crossAxisOffset;
......
...@@ -188,8 +188,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -188,8 +188,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
/// The [childManager] argument must not be null. /// The [childManager] argument must not be null.
RenderSliverMultiBoxAdaptor({ RenderSliverMultiBoxAdaptor({
required RenderSliverBoxChildManager childManager, required RenderSliverBoxChildManager childManager,
}) : assert(childManager != null), }) : _childManager = childManager {
_childManager = childManager {
assert(() { assert(() {
_debugDanglingKeepAlives = <RenderBox>[]; _debugDanglingKeepAlives = <RenderBox>[];
return true; return true;
...@@ -229,7 +228,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -229,7 +228,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
bool get debugChildIntegrityEnabled => _debugChildIntegrityEnabled; bool get debugChildIntegrityEnabled => _debugChildIntegrityEnabled;
bool _debugChildIntegrityEnabled = true; bool _debugChildIntegrityEnabled = true;
set debugChildIntegrityEnabled(bool enabled) { set debugChildIntegrityEnabled(bool enabled) {
assert(enabled != null);
assert(() { assert(() {
_debugChildIntegrityEnabled = enabled; _debugChildIntegrityEnabled = enabled;
return _debugVerifyChildOrder() && return _debugVerifyChildOrder() &&
...@@ -536,7 +534,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -536,7 +534,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
/// Returns the index of the given child, as given by the /// Returns the index of the given child, as given by the
/// [SliverMultiBoxAdaptorParentData.index] field of the child's [parentData]. /// [SliverMultiBoxAdaptorParentData.index] field of the child's [parentData].
int indexOf(RenderBox child) { int indexOf(RenderBox child) {
assert(child != null);
final SliverMultiBoxAdaptorParentData childParentData = child.parentData! as SliverMultiBoxAdaptorParentData; final SliverMultiBoxAdaptorParentData childParentData = child.parentData! as SliverMultiBoxAdaptorParentData;
assert(childParentData.index != null); assert(childParentData.index != null);
return childParentData.index!; return childParentData.index!;
...@@ -546,7 +543,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -546,7 +543,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
/// child's [RenderBox.size] property. This is only valid after layout. /// child's [RenderBox.size] property. This is only valid after layout.
@protected @protected
double paintExtentOf(RenderBox child) { double paintExtentOf(RenderBox child) {
assert(child != null);
assert(child.hasSize); assert(child.hasSize);
switch (constraints.axis) { switch (constraints.axis) {
case Axis.horizontal: case Axis.horizontal:
...@@ -576,7 +572,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -576,7 +572,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
@override @override
double? childScrollOffset(RenderObject child) { double? childScrollOffset(RenderObject child) {
assert(child != null);
assert(child.parent == this); assert(child.parent == this);
final SliverMultiBoxAdaptorParentData childParentData = child.parentData! as SliverMultiBoxAdaptorParentData; final SliverMultiBoxAdaptorParentData childParentData = child.parentData! as SliverMultiBoxAdaptorParentData;
return childParentData.layoutOffset; return childParentData.layoutOffset;
...@@ -640,8 +635,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver ...@@ -640,8 +635,6 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
addExtent = true; addExtent = true;
break; break;
} }
assert(mainAxisUnit != null);
assert(addExtent != null);
RenderBox? child = firstChild; RenderBox? child = firstChild;
while (child != null) { while (child != null) {
final double mainAxisDelta = childMainAxisPosition(child); final double mainAxisDelta = childMainAxisPosition(child);
......
...@@ -35,9 +35,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -35,9 +35,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
/// Only valid after layout has started, since before layout the render object /// Only valid after layout has started, since before layout the render object
/// doesn't know what direction it will be laid out in. /// doesn't know what direction it will be laid out in.
double get beforePadding { double get beforePadding {
assert(constraints != null);
assert(constraints.axisDirection != null);
assert(constraints.growthDirection != null);
assert(resolvedPadding != null); assert(resolvedPadding != null);
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) { switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
case AxisDirection.up: case AxisDirection.up:
...@@ -56,9 +53,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -56,9 +53,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
/// Only valid after layout has started, since before layout the render object /// Only valid after layout has started, since before layout the render object
/// doesn't know what direction it will be laid out in. /// doesn't know what direction it will be laid out in.
double get afterPadding { double get afterPadding {
assert(constraints != null);
assert(constraints.axisDirection != null);
assert(constraints.growthDirection != null);
assert(resolvedPadding != null); assert(resolvedPadding != null);
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) { switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
case AxisDirection.up: case AxisDirection.up:
...@@ -79,8 +73,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -79,8 +73,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
/// Only valid after layout has started, since before layout the render object /// Only valid after layout has started, since before layout the render object
/// doesn't know what direction it will be laid out in. /// doesn't know what direction it will be laid out in.
double get mainAxisPadding { double get mainAxisPadding {
assert(constraints != null);
assert(constraints.axis != null);
assert(resolvedPadding != null); assert(resolvedPadding != null);
return resolvedPadding!.along(constraints.axis); return resolvedPadding!.along(constraints.axis);
} }
...@@ -92,8 +84,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -92,8 +84,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
/// Only valid after layout has started, since before layout the render object /// Only valid after layout has started, since before layout the render object
/// doesn't know what direction it will be laid out in. /// doesn't know what direction it will be laid out in.
double get crossAxisPadding { double get crossAxisPadding {
assert(constraints != null);
assert(constraints.axis != null);
assert(resolvedPadding != null); assert(resolvedPadding != null);
switch (constraints.axis) { switch (constraints.axis) {
case Axis.horizontal: case Axis.horizontal:
...@@ -201,8 +191,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -201,8 +191,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
); );
final SliverPhysicalParentData childParentData = child!.parentData! as SliverPhysicalParentData; final SliverPhysicalParentData childParentData = child!.parentData! as SliverPhysicalParentData;
assert(constraints.axisDirection != null);
assert(constraints.growthDirection != null);
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) { switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
case AxisDirection.up: case AxisDirection.up:
childParentData.paintOffset = Offset(resolvedPadding!.left, calculatePaintOffset(constraints, from: resolvedPadding!.bottom + childLayoutGeometry.scrollExtent, to: resolvedPadding!.bottom + childLayoutGeometry.scrollExtent + resolvedPadding!.top)); childParentData.paintOffset = Offset(resolvedPadding!.left, calculatePaintOffset(constraints, from: resolvedPadding!.bottom + childLayoutGeometry.scrollExtent, to: resolvedPadding!.bottom + childLayoutGeometry.scrollExtent + resolvedPadding!.top));
...@@ -217,7 +205,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -217,7 +205,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
childParentData.paintOffset = Offset(calculatePaintOffset(constraints, from: resolvedPadding!.right + childLayoutGeometry.scrollExtent, to: resolvedPadding!.right + childLayoutGeometry.scrollExtent + resolvedPadding!.left), resolvedPadding!.top); childParentData.paintOffset = Offset(calculatePaintOffset(constraints, from: resolvedPadding!.right + childLayoutGeometry.scrollExtent, to: resolvedPadding!.right + childLayoutGeometry.scrollExtent + resolvedPadding!.left), resolvedPadding!.top);
break; break;
} }
assert(childParentData.paintOffset != null);
assert(beforePadding == this.beforePadding); assert(beforePadding == this.beforePadding);
assert(afterPadding == this.afterPadding); assert(afterPadding == this.afterPadding);
assert(mainAxisPadding == this.mainAxisPadding); assert(mainAxisPadding == this.mainAxisPadding);
...@@ -242,18 +229,13 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -242,18 +229,13 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
@override @override
double childMainAxisPosition(RenderSliver child) { double childMainAxisPosition(RenderSliver child) {
assert(child != null);
assert(child == this.child); assert(child == this.child);
return calculatePaintOffset(constraints, from: 0.0, to: beforePadding); return calculatePaintOffset(constraints, from: 0.0, to: beforePadding);
} }
@override @override
double childCrossAxisPosition(RenderSliver child) { double childCrossAxisPosition(RenderSliver child) {
assert(child != null);
assert(child == this.child); assert(child == this.child);
assert(constraints != null);
assert(constraints.axisDirection != null);
assert(constraints.growthDirection != null);
assert(resolvedPadding != null); assert(resolvedPadding != null);
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) { switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
case AxisDirection.up: case AxisDirection.up:
...@@ -273,7 +255,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj ...@@ -273,7 +255,6 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
@override @override
void applyPaintTransform(RenderObject child, Matrix4 transform) { void applyPaintTransform(RenderObject child, Matrix4 transform) {
assert(child != null);
assert(child == this.child); assert(child == this.child);
final SliverPhysicalParentData childParentData = child.parentData! as SliverPhysicalParentData; final SliverPhysicalParentData childParentData = child.parentData! as SliverPhysicalParentData;
childParentData.applyPaintTransform(transform); childParentData.applyPaintTransform(transform);
...@@ -326,8 +307,7 @@ class RenderSliverPadding extends RenderSliverEdgeInsetsPadding { ...@@ -326,8 +307,7 @@ class RenderSliverPadding extends RenderSliverEdgeInsetsPadding {
required EdgeInsetsGeometry padding, required EdgeInsetsGeometry padding,
TextDirection? textDirection, TextDirection? textDirection,
RenderSliver? child, RenderSliver? child,
}) : assert(padding != null), }) : assert(padding.isNonNegative),
assert(padding.isNonNegative),
_padding = padding, _padding = padding,
_textDirection = textDirection { _textDirection = textDirection {
this.child = child; this.child = child;
...@@ -357,7 +337,6 @@ class RenderSliverPadding extends RenderSliverEdgeInsetsPadding { ...@@ -357,7 +337,6 @@ class RenderSliverPadding extends RenderSliverEdgeInsetsPadding {
EdgeInsetsGeometry get padding => _padding; EdgeInsetsGeometry get padding => _padding;
EdgeInsetsGeometry _padding; EdgeInsetsGeometry _padding;
set padding(EdgeInsetsGeometry value) { set padding(EdgeInsetsGeometry value) {
assert(value != null);
assert(padding.isNonNegative); assert(padding.isNonNegative);
if (_padding == value) { if (_padding == value) {
return; return;
......
...@@ -37,7 +37,7 @@ class OverScrollHeaderStretchConfiguration { ...@@ -37,7 +37,7 @@ class OverScrollHeaderStretchConfiguration {
OverScrollHeaderStretchConfiguration({ OverScrollHeaderStretchConfiguration({
this.stretchTriggerOffset = 100.0, this.stretchTriggerOffset = 100.0,
this.onStretchTrigger, this.onStretchTrigger,
}) : assert(stretchTriggerOffset != null); });
/// The offset of overscroll required to trigger the [onStretchTrigger]. /// The offset of overscroll required to trigger the [onStretchTrigger].
final double stretchTriggerOffset; final double stretchTriggerOffset;
...@@ -152,7 +152,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje ...@@ -152,7 +152,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
return 0.0; return 0.0;
} }
assert(child!.hasSize); assert(child!.hasSize);
assert(constraints.axis != null);
switch (constraints.axis) { switch (constraints.axis) {
case Axis.vertical: case Axis.vertical:
return child!.size.height; return child!.size.height;
...@@ -217,7 +216,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje ...@@ -217,7 +216,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
/// The `overlapsContent` argument is passed to [updateChild]. /// The `overlapsContent` argument is passed to [updateChild].
@protected @protected
void layoutChild(double scrollOffset, double maxExtent, { bool overlapsContent = false }) { void layoutChild(double scrollOffset, double maxExtent, { bool overlapsContent = false }) {
assert(maxExtent != null);
final double shrinkOffset = math.min(scrollOffset, maxExtent); final double shrinkOffset = math.min(scrollOffset, maxExtent);
if (_needsUpdateChild || _lastShrinkOffset != shrinkOffset || _lastOverlapsContent != overlapsContent) { if (_needsUpdateChild || _lastShrinkOffset != shrinkOffset || _lastOverlapsContent != overlapsContent) {
invokeLayoutCallback<SliverConstraints>((SliverConstraints constraints) { invokeLayoutCallback<SliverConstraints>((SliverConstraints constraints) {
...@@ -228,7 +226,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje ...@@ -228,7 +226,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
_lastOverlapsContent = overlapsContent; _lastOverlapsContent = overlapsContent;
_needsUpdateChild = false; _needsUpdateChild = false;
} }
assert(minExtent != null);
assert(() { assert(() {
if (minExtent <= maxExtent) { if (minExtent <= maxExtent) {
return true; return true;
...@@ -294,7 +291,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje ...@@ -294,7 +291,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
@override @override
void applyPaintTransform(RenderObject child, Matrix4 transform) { void applyPaintTransform(RenderObject child, Matrix4 transform) {
assert(child != null);
assert(child == this.child); assert(child == this.child);
applyPaintTransformForBoxChild(child as RenderBox, transform); applyPaintTransformForBoxChild(child as RenderBox, transform);
} }
...@@ -302,7 +298,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje ...@@ -302,7 +298,6 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
@override @override
void paint(PaintingContext context, Offset offset) { void paint(PaintingContext context, Offset offset) {
if (child != null && geometry!.visible) { if (child != null && geometry!.visible) {
assert(constraints.axisDirection != null);
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) { switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
case AxisDirection.up: case AxisDirection.up:
offset += Offset(0.0, geometry!.paintExtent - childMainAxisPosition(child!) - childExtent); offset += Offset(0.0, geometry!.paintExtent - childMainAxisPosition(child!) - childExtent);
...@@ -496,8 +491,7 @@ class FloatingHeaderSnapConfiguration { ...@@ -496,8 +491,7 @@ class FloatingHeaderSnapConfiguration {
FloatingHeaderSnapConfiguration({ FloatingHeaderSnapConfiguration({
this.curve = Curves.ease, this.curve = Curves.ease,
this.duration = const Duration(milliseconds: 300), this.duration = const Duration(milliseconds: 300),
}) : assert(curve != null), });
assert(duration != null);
/// The snap animation curve. /// The snap animation curve.
final Curve curve; final Curve curve;
...@@ -607,9 +601,6 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste ...@@ -607,9 +601,6 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste
} }
void _updateAnimation(Duration duration, double endValue, Curve curve) { void _updateAnimation(Duration duration, double endValue, Curve curve) {
assert(duration != null);
assert(endValue != null);
assert(curve != null);
assert( assert(
vsync != null, vsync != null,
'vsync must not be null if the floating header changes size animatedly.', 'vsync must not be null if the floating header changes size animatedly.',
......
...@@ -25,8 +25,7 @@ class RelativeRect { ...@@ -25,8 +25,7 @@ class RelativeRect {
/// Creates a RelativeRect with the given values. /// Creates a RelativeRect with the given values.
/// ///
/// The arguments must not be null. /// 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);
: assert(left != null && top != null && right != null && bottom != null);
/// 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)
/// and the RelativeRect (the output) are in the coordinate space of the /// and the RelativeRect (the output) are in the coordinate space of the
...@@ -166,7 +165,6 @@ class RelativeRect { ...@@ -166,7 +165,6 @@ class RelativeRect {
/// ///
/// {@macro dart.ui.shadow.lerp} /// {@macro dart.ui.shadow.lerp}
static RelativeRect? lerp(RelativeRect? a, RelativeRect? b, double t) { static RelativeRect? lerp(RelativeRect? a, RelativeRect? b, double t) {
assert(t != null);
if (a == null && b == null) { if (a == null && b == null) {
return null; return null;
} }
...@@ -354,10 +352,7 @@ class RenderStack extends RenderBox ...@@ -354,10 +352,7 @@ class RenderStack extends RenderBox
TextDirection? textDirection, TextDirection? textDirection,
StackFit fit = StackFit.loose, StackFit fit = StackFit.loose,
Clip clipBehavior = Clip.hardEdge, Clip clipBehavior = Clip.hardEdge,
}) : assert(alignment != null), }) : _alignment = alignment,
assert(fit != null),
assert(clipBehavior != null),
_alignment = alignment,
_textDirection = textDirection, _textDirection = textDirection,
_fit = fit, _fit = fit,
_clipBehavior = clipBehavior { _clipBehavior = clipBehavior {
...@@ -405,7 +400,6 @@ class RenderStack extends RenderBox ...@@ -405,7 +400,6 @@ class RenderStack extends RenderBox
AlignmentGeometry get alignment => _alignment; AlignmentGeometry get alignment => _alignment;
AlignmentGeometry _alignment; AlignmentGeometry _alignment;
set alignment(AlignmentGeometry value) { set alignment(AlignmentGeometry value) {
assert(value != null);
if (_alignment == value) { if (_alignment == value) {
return; return;
} }
...@@ -435,7 +429,6 @@ class RenderStack extends RenderBox ...@@ -435,7 +429,6 @@ class RenderStack extends RenderBox
StackFit get fit => _fit; StackFit get fit => _fit;
StackFit _fit; StackFit _fit;
set fit(StackFit value) { set fit(StackFit value) {
assert(value != null);
if (_fit != value) { if (_fit != value) {
_fit = value; _fit = value;
markNeedsLayout(); markNeedsLayout();
...@@ -448,7 +441,6 @@ class RenderStack extends RenderBox ...@@ -448,7 +441,6 @@ class RenderStack extends RenderBox
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.hardEdge; Clip _clipBehavior = Clip.hardEdge;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsPaint(); markNeedsPaint();
...@@ -571,7 +563,6 @@ class RenderStack extends RenderBox ...@@ -571,7 +563,6 @@ class RenderStack extends RenderBox
double height = constraints.minHeight; double height = constraints.minHeight;
final BoxConstraints nonPositionedConstraints; final BoxConstraints nonPositionedConstraints;
assert(fit != null);
switch (fit) { switch (fit) {
case StackFit.loose: case StackFit.loose:
nonPositionedConstraints = constraints.loosen(); nonPositionedConstraints = constraints.loosen();
...@@ -583,7 +574,6 @@ class RenderStack extends RenderBox ...@@ -583,7 +574,6 @@ class RenderStack extends RenderBox
nonPositionedConstraints = constraints; nonPositionedConstraints = constraints;
break; break;
} }
assert(nonPositionedConstraints != null);
RenderBox? child = firstChild; RenderBox? child = firstChild;
while (child != null) { while (child != null) {
...@@ -755,7 +745,6 @@ class RenderIndexedStack extends RenderStack { ...@@ -755,7 +745,6 @@ class RenderIndexedStack extends RenderStack {
if (firstChild == null || index == null) { if (firstChild == null || index == null) {
return false; return false;
} }
assert(position != null);
final RenderBox child = _childAtIndex(); final RenderBox child = _childAtIndex();
final StackParentData childParentData = child.parentData! as StackParentData; final StackParentData childParentData = child.parentData! as StackParentData;
return result.addWithPaintOffset( return result.addWithPaintOffset(
......
...@@ -134,7 +134,7 @@ class FixedColumnWidth extends TableColumnWidth { ...@@ -134,7 +134,7 @@ 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. /// The [value] argument must not be null.
const FixedColumnWidth(this.value) : assert(value != null); const FixedColumnWidth(this.value);
/// The width the column should occupy in logical pixels. /// The width the column should occupy in logical pixels.
final double value; final double value;
...@@ -161,7 +161,7 @@ class FractionColumnWidth extends TableColumnWidth { ...@@ -161,7 +161,7 @@ class FractionColumnWidth extends TableColumnWidth {
/// maxWidth. /// maxWidth.
/// ///
/// The [value] argument must not be null. /// The [value] argument must not be null.
const FractionColumnWidth(this.value) : assert(value != null); 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
/// occupy. /// occupy.
...@@ -199,7 +199,7 @@ class FlexColumnWidth extends TableColumnWidth { ...@@ -199,7 +199,7 @@ class FlexColumnWidth extends TableColumnWidth {
/// the other columns have been laid out. /// the other columns have been laid out.
/// ///
/// The [value] argument must not be null. /// The [value] argument must not be null.
const FlexColumnWidth([this.value = 1.0]) : assert(value != null); 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
/// been laid out that this column should occupy. /// been laid out that this column should occupy.
...@@ -388,9 +388,6 @@ class RenderTable extends RenderBox { ...@@ -388,9 +388,6 @@ class RenderTable extends RenderBox {
}) : assert(columns == null || columns >= 0), }) : assert(columns == null || columns >= 0),
assert(rows == null || rows >= 0), assert(rows == null || rows >= 0),
assert(rows == null || children == null), assert(rows == null || children == null),
assert(defaultColumnWidth != null),
assert(textDirection != null),
assert(configuration != null),
_textDirection = textDirection, _textDirection = textDirection,
_columns = columns ?? (children != null && children.isNotEmpty ? children.first.length : 0), _columns = columns ?? (children != null && children.isNotEmpty ? children.first.length : 0),
_rows = rows ?? 0, _rows = rows ?? 0,
...@@ -419,7 +416,6 @@ class RenderTable extends RenderBox { ...@@ -419,7 +416,6 @@ class RenderTable extends RenderBox {
int get columns => _columns; int get columns => _columns;
int _columns; int _columns;
set columns(int value) { set columns(int value) {
assert(value != null);
assert(value >= 0); assert(value >= 0);
if (value == columns) { if (value == columns) {
return; return;
...@@ -454,7 +450,6 @@ class RenderTable extends RenderBox { ...@@ -454,7 +450,6 @@ class RenderTable extends RenderBox {
int get rows => _rows; int get rows => _rows;
int _rows; int _rows;
set rows(int value) { set rows(int value) {
assert(value != null);
assert(value >= 0); assert(value >= 0);
if (value == rows) { if (value == rows) {
return; return;
...@@ -513,7 +508,6 @@ class RenderTable extends RenderBox { ...@@ -513,7 +508,6 @@ class RenderTable extends RenderBox {
TableColumnWidth get defaultColumnWidth => _defaultColumnWidth; TableColumnWidth get defaultColumnWidth => _defaultColumnWidth;
TableColumnWidth _defaultColumnWidth; TableColumnWidth _defaultColumnWidth;
set defaultColumnWidth(TableColumnWidth value) { set defaultColumnWidth(TableColumnWidth value) {
assert(value != null);
if (defaultColumnWidth == value) { if (defaultColumnWidth == value) {
return; return;
} }
...@@ -525,7 +519,6 @@ class RenderTable extends RenderBox { ...@@ -525,7 +519,6 @@ class RenderTable extends RenderBox {
TextDirection get textDirection => _textDirection; TextDirection get textDirection => _textDirection;
TextDirection _textDirection; TextDirection _textDirection;
set textDirection(TextDirection value) { set textDirection(TextDirection value) {
assert(value != null);
if (_textDirection == value) { if (_textDirection == value) {
return; return;
} }
...@@ -573,7 +566,6 @@ class RenderTable extends RenderBox { ...@@ -573,7 +566,6 @@ class RenderTable extends RenderBox {
ImageConfiguration get configuration => _configuration; ImageConfiguration get configuration => _configuration;
ImageConfiguration _configuration; ImageConfiguration _configuration;
set configuration(ImageConfiguration value) { set configuration(ImageConfiguration value) {
assert(value != null);
if (value == _configuration) { if (value == _configuration) {
return; return;
} }
...@@ -585,7 +577,6 @@ class RenderTable extends RenderBox { ...@@ -585,7 +577,6 @@ class RenderTable extends RenderBox {
TableCellVerticalAlignment get defaultVerticalAlignment => _defaultVerticalAlignment; TableCellVerticalAlignment get defaultVerticalAlignment => _defaultVerticalAlignment;
TableCellVerticalAlignment _defaultVerticalAlignment; TableCellVerticalAlignment _defaultVerticalAlignment;
set defaultVerticalAlignment(TableCellVerticalAlignment value) { set defaultVerticalAlignment(TableCellVerticalAlignment value) {
assert(value != null);
if (_defaultVerticalAlignment == value) { if (_defaultVerticalAlignment == value) {
return; return;
} }
...@@ -626,7 +617,7 @@ class RenderTable extends RenderBox { ...@@ -626,7 +617,7 @@ class RenderTable extends RenderBox {
assert(columns >= 0); assert(columns >= 0);
// consider the case of a newly empty table // consider the case of a newly empty table
if (columns == 0 || cells.isEmpty) { if (columns == 0 || cells.isEmpty) {
assert(cells == null || cells.isEmpty); assert(cells.isEmpty);
_columns = columns; _columns = columns;
if (_children.isEmpty) { if (_children.isEmpty) {
assert(_rows == 0); assert(_rows == 0);
...@@ -642,7 +633,6 @@ class RenderTable extends RenderBox { ...@@ -642,7 +633,6 @@ class RenderTable extends RenderBox {
markNeedsLayout(); markNeedsLayout();
return; return;
} }
assert(cells != null);
assert(cells.length % columns == 0); assert(cells.length % columns == 0);
// fill a set with the cells that are moving (it's important not // fill a set with the cells that are moving (it's important not
// to dropChild a child that's remaining with us, because that // to dropChild a child that's remaining with us, because that
...@@ -722,8 +712,6 @@ class RenderTable extends RenderBox { ...@@ -722,8 +712,6 @@ class RenderTable extends RenderBox {
/// does not modify the table. Otherwise, the given child must not already /// does not modify the table. Otherwise, the given child must not already
/// have a parent. /// have a parent.
void setChild(int x, int y, RenderBox? value) { void setChild(int x, int y, RenderBox? value) {
assert(x != null);
assert(y != null);
assert(x >= 0 && x < columns && y >= 0 && y < rows); assert(x >= 0 && x < columns && y >= 0 && y < rows);
assert(_children.length == rows * columns); assert(_children.length == rows * columns);
final int xy = x + y * columns; final int xy = x + y * columns;
...@@ -864,7 +852,6 @@ class RenderTable extends RenderBox { ...@@ -864,7 +852,6 @@ class RenderTable extends RenderBox {
} }
List<double> _computeColumnWidths(BoxConstraints constraints) { List<double> _computeColumnWidths(BoxConstraints constraints) {
assert(constraints != null);
assert(_children.length == rows * columns); assert(_children.length == rows * columns);
// We apply the constraints to the column widths in the order of // We apply the constraints to the column widths in the order of
// least important to most important: // least important to most important:
...@@ -1061,7 +1048,6 @@ class RenderTable extends RenderBox { ...@@ -1061,7 +1048,6 @@ class RenderTable extends RenderBox {
final RenderBox? child = _children[xy]; final RenderBox? child = _children[xy];
if (child != null) { if (child != null) {
final TableCellParentData childParentData = child.parentData! as TableCellParentData; final TableCellParentData childParentData = child.parentData! as TableCellParentData;
assert(childParentData != null);
switch (childParentData.verticalAlignment ?? defaultVerticalAlignment) { switch (childParentData.verticalAlignment ?? defaultVerticalAlignment) {
case TableCellVerticalAlignment.baseline: case TableCellVerticalAlignment.baseline:
assert(debugCannotComputeDryLayout( assert(debugCannotComputeDryLayout(
...@@ -1133,7 +1119,6 @@ class RenderTable extends RenderBox { ...@@ -1133,7 +1119,6 @@ class RenderTable extends RenderBox {
final RenderBox? child = _children[xy]; final RenderBox? child = _children[xy];
if (child != null) { if (child != null) {
final TableCellParentData childParentData = child.parentData! as TableCellParentData; final TableCellParentData childParentData = child.parentData! as TableCellParentData;
assert(childParentData != null);
childParentData.x = x; childParentData.x = x;
childParentData.y = y; childParentData.y = y;
switch (childParentData.verticalAlignment ?? defaultVerticalAlignment) { switch (childParentData.verticalAlignment ?? defaultVerticalAlignment) {
......
...@@ -89,12 +89,6 @@ class TableBorder { ...@@ -89,12 +89,6 @@ class TableBorder {
/// Whether all the sides of the border (outside and inside) are identical. /// Whether all the sides of the border (outside and inside) are identical.
/// Uniform borders are typically more efficient to paint. /// Uniform borders are typically more efficient to paint.
bool get isUniform { bool get isUniform {
assert(top != null);
assert(right != null);
assert(bottom != null);
assert(left != null);
assert(horizontalInside != null);
assert(verticalInside != null);
final Color topColor = top.color; final Color topColor = top.color;
if (right.color != topColor || if (right.color != topColor ||
...@@ -159,7 +153,6 @@ class TableBorder { ...@@ -159,7 +153,6 @@ class TableBorder {
/// ///
/// {@macro dart.ui.shadow.lerp} /// {@macro dart.ui.shadow.lerp}
static TableBorder? lerp(TableBorder? a, TableBorder? b, double t) { static TableBorder? lerp(TableBorder? a, TableBorder? b, double t) {
assert(t != null);
if (a == null && b == null) { if (a == null && b == null) {
return null; return null;
} }
...@@ -212,19 +205,9 @@ class TableBorder { ...@@ -212,19 +205,9 @@ class TableBorder {
required Iterable<double> columns, required Iterable<double> columns,
}) { }) {
// properties can't be null // properties can't be null
assert(top != null);
assert(right != null);
assert(bottom != null);
assert(left != null);
assert(horizontalInside != null);
assert(verticalInside != null);
// arguments can't be null // arguments can't be null
assert(canvas != null);
assert(rect != null);
assert(rows != 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 != null);
assert(columns.isEmpty || (columns.first >= 0.0 && columns.last <= rect.width)); assert(columns.isEmpty || (columns.first >= 0.0 && columns.last <= rect.width));
if (columns.isNotEmpty || rows.isNotEmpty) { if (columns.isNotEmpty || rows.isNotEmpty) {
......
...@@ -40,8 +40,7 @@ class TextureBox extends RenderBox { ...@@ -40,8 +40,7 @@ class TextureBox extends RenderBox {
required int textureId, required int textureId,
bool freeze = false, bool freeze = false,
FilterQuality filterQuality = FilterQuality.low, FilterQuality filterQuality = FilterQuality.low,
}) : assert(textureId != null), }) : _textureId = textureId,
_textureId = textureId,
_freeze = freeze, _freeze = freeze,
_filterQuality = filterQuality; _filterQuality = filterQuality;
...@@ -49,7 +48,6 @@ class TextureBox extends RenderBox { ...@@ -49,7 +48,6 @@ class TextureBox extends RenderBox {
int get textureId => _textureId; int get textureId => _textureId;
int _textureId; int _textureId;
set textureId(int value) { set textureId(int value) {
assert(value != null);
if (value != _textureId) { if (value != _textureId) {
_textureId = value; _textureId = value;
markNeedsPaint(); markNeedsPaint();
...@@ -60,7 +58,6 @@ class TextureBox extends RenderBox { ...@@ -60,7 +58,6 @@ class TextureBox extends RenderBox {
bool get freeze => _freeze; bool get freeze => _freeze;
bool _freeze; bool _freeze;
set freeze(bool value) { set freeze(bool value) {
assert(value != null);
if (value != _freeze) { if (value != _freeze) {
_freeze = value; _freeze = value;
markNeedsPaint(); markNeedsPaint();
...@@ -71,7 +68,6 @@ class TextureBox extends RenderBox { ...@@ -71,7 +68,6 @@ class TextureBox extends RenderBox {
FilterQuality get filterQuality => _filterQuality; FilterQuality get filterQuality => _filterQuality;
FilterQuality _filterQuality; FilterQuality _filterQuality;
set filterQuality(FilterQuality value) { set filterQuality(FilterQuality value) {
assert(value != null);
if (value != _filterQuality) { if (value != _filterQuality) {
_filterQuality = value; _filterQuality = value;
markNeedsPaint(); markNeedsPaint();
......
...@@ -69,8 +69,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox> ...@@ -69,8 +69,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
RenderBox? child, RenderBox? child,
required ViewConfiguration configuration, required ViewConfiguration configuration,
required ui.FlutterView window, required ui.FlutterView window,
}) : assert(configuration != null), }) : _configuration = configuration,
_configuration = configuration,
_window = window { _window = window {
this.child = child; this.child = child;
} }
...@@ -88,7 +87,6 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox> ...@@ -88,7 +87,6 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
/// ///
/// Always call [prepareInitialFrame] before changing the configuration. /// Always call [prepareInitialFrame] before changing the configuration.
set configuration(ViewConfiguration value) { set configuration(ViewConfiguration value) {
assert(value != null);
if (configuration == value) { if (configuration == value) {
return; return;
} }
...@@ -201,7 +199,6 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox> ...@@ -201,7 +199,6 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
/// * [Layer.findAllAnnotations], which is used by this method to find all /// * [Layer.findAllAnnotations], which is used by this method to find all
/// [AnnotatedRegionLayer]s annotated for mouse tracking. /// [AnnotatedRegionLayer]s annotated for mouse tracking.
HitTestResult hitTestMouseTrackers(Offset position) { HitTestResult hitTestMouseTrackers(Offset position) {
assert(position != null);
final BoxHitTestResult result = BoxHitTestResult(); final BoxHitTestResult result = BoxHitTestResult();
hitTest(result, position: position); hitTest(result, position: position);
return result; return result;
......
...@@ -196,7 +196,6 @@ abstract class ViewportOffset extends ChangeNotifier { ...@@ -196,7 +196,6 @@ abstract class ViewportOffset extends ChangeNotifier {
Curve? curve, Curve? curve,
bool? clamp, bool? clamp,
}) { }) {
assert(to != null);
if (duration == null || duration == Duration.zero) { if (duration == null || duration == Duration.zero) {
jumpTo(to); jumpTo(to);
return Future<void>.value(); return Future<void>.value();
......
...@@ -121,14 +121,7 @@ class RenderWrap extends RenderBox ...@@ -121,14 +121,7 @@ class RenderWrap extends RenderBox
TextDirection? textDirection, TextDirection? textDirection,
VerticalDirection verticalDirection = VerticalDirection.down, VerticalDirection verticalDirection = VerticalDirection.down,
Clip clipBehavior = Clip.none, Clip clipBehavior = Clip.none,
}) : assert(direction != null), }) : _direction = direction,
assert(alignment != null),
assert(spacing != null),
assert(runAlignment != null),
assert(runSpacing != null),
assert(crossAxisAlignment != null),
assert(clipBehavior != null),
_direction = direction,
_alignment = alignment, _alignment = alignment,
_spacing = spacing, _spacing = spacing,
_runAlignment = runAlignment, _runAlignment = runAlignment,
...@@ -149,7 +142,6 @@ class RenderWrap extends RenderBox ...@@ -149,7 +142,6 @@ class RenderWrap extends RenderBox
Axis get direction => _direction; Axis get direction => _direction;
Axis _direction; Axis _direction;
set direction (Axis value) { set direction (Axis value) {
assert(value != null);
if (_direction == value) { if (_direction == value) {
return; return;
} }
...@@ -173,7 +165,6 @@ class RenderWrap extends RenderBox ...@@ -173,7 +165,6 @@ class RenderWrap extends RenderBox
WrapAlignment get alignment => _alignment; WrapAlignment get alignment => _alignment;
WrapAlignment _alignment; WrapAlignment _alignment;
set alignment (WrapAlignment value) { set alignment (WrapAlignment value) {
assert(value != null);
if (_alignment == value) { if (_alignment == value) {
return; return;
} }
...@@ -195,7 +186,6 @@ class RenderWrap extends RenderBox ...@@ -195,7 +186,6 @@ class RenderWrap extends RenderBox
double get spacing => _spacing; double get spacing => _spacing;
double _spacing; double _spacing;
set spacing (double value) { set spacing (double value) {
assert(value != null);
if (_spacing == value) { if (_spacing == value) {
return; return;
} }
...@@ -220,7 +210,6 @@ class RenderWrap extends RenderBox ...@@ -220,7 +210,6 @@ class RenderWrap extends RenderBox
WrapAlignment get runAlignment => _runAlignment; WrapAlignment get runAlignment => _runAlignment;
WrapAlignment _runAlignment; WrapAlignment _runAlignment;
set runAlignment (WrapAlignment value) { set runAlignment (WrapAlignment value) {
assert(value != null);
if (_runAlignment == value) { if (_runAlignment == value) {
return; return;
} }
...@@ -241,7 +230,6 @@ class RenderWrap extends RenderBox ...@@ -241,7 +230,6 @@ class RenderWrap extends RenderBox
double get runSpacing => _runSpacing; double get runSpacing => _runSpacing;
double _runSpacing; double _runSpacing;
set runSpacing (double value) { set runSpacing (double value) {
assert(value != null);
if (_runSpacing == value) { if (_runSpacing == value) {
return; return;
} }
...@@ -267,7 +255,6 @@ class RenderWrap extends RenderBox ...@@ -267,7 +255,6 @@ class RenderWrap extends RenderBox
WrapCrossAlignment get crossAxisAlignment => _crossAxisAlignment; WrapCrossAlignment get crossAxisAlignment => _crossAxisAlignment;
WrapCrossAlignment _crossAxisAlignment; WrapCrossAlignment _crossAxisAlignment;
set crossAxisAlignment (WrapCrossAlignment value) { set crossAxisAlignment (WrapCrossAlignment value) {
assert(value != null);
if (_crossAxisAlignment == value) { if (_crossAxisAlignment == value) {
return; return;
} }
...@@ -344,7 +331,6 @@ class RenderWrap extends RenderBox ...@@ -344,7 +331,6 @@ class RenderWrap extends RenderBox
Clip get clipBehavior => _clipBehavior; Clip get clipBehavior => _clipBehavior;
Clip _clipBehavior = Clip.none; Clip _clipBehavior = Clip.none;
set clipBehavior(Clip value) { set clipBehavior(Clip value) {
assert(value != null);
if (value != _clipBehavior) { if (value != _clipBehavior) {
_clipBehavior = value; _clipBehavior = value;
markNeedsPaint(); markNeedsPaint();
...@@ -353,10 +339,6 @@ class RenderWrap extends RenderBox ...@@ -353,10 +339,6 @@ class RenderWrap extends RenderBox
} }
bool get _debugHasNecessaryDirections { bool get _debugHasNecessaryDirections {
assert(direction != null);
assert(alignment != null);
assert(runAlignment != null);
assert(crossAxisAlignment != null);
if (firstChild != null && lastChild != firstChild) { if (firstChild != null && lastChild != firstChild) {
// i.e. there's more than one child // i.e. there's more than one child
switch (direction) { switch (direction) {
...@@ -364,7 +346,6 @@ class RenderWrap extends RenderBox ...@@ -364,7 +346,6 @@ class RenderWrap extends RenderBox
assert(textDirection != null, 'Horizontal $runtimeType with multiple children has a null textDirection, so the layout order is undefined.'); assert(textDirection != null, 'Horizontal $runtimeType with multiple children has a null textDirection, so the layout order is undefined.');
break; break;
case Axis.vertical: case Axis.vertical:
assert(verticalDirection != null, 'Vertical $runtimeType with multiple children has a null verticalDirection, so the layout order is undefined.');
break; break;
} }
} }
...@@ -374,14 +355,12 @@ class RenderWrap extends RenderBox ...@@ -374,14 +355,12 @@ class RenderWrap extends RenderBox
assert(textDirection != null, 'Horizontal $runtimeType with alignment $alignment has a null textDirection, so the alignment cannot be resolved.'); assert(textDirection != null, 'Horizontal $runtimeType with alignment $alignment has a null textDirection, so the alignment cannot be resolved.');
break; break;
case Axis.vertical: case Axis.vertical:
assert(verticalDirection != null, 'Vertical $runtimeType with alignment $alignment has a null verticalDirection, so the alignment cannot be resolved.');
break; break;
} }
} }
if (runAlignment == WrapAlignment.start || runAlignment == WrapAlignment.end) { if (runAlignment == WrapAlignment.start || runAlignment == WrapAlignment.end) {
switch (direction) { switch (direction) {
case Axis.horizontal: case Axis.horizontal:
assert(verticalDirection != null, 'Horizontal $runtimeType with runAlignment $runAlignment has a null verticalDirection, so the alignment cannot be resolved.');
break; break;
case Axis.vertical: case Axis.vertical:
assert(textDirection != null, 'Vertical $runtimeType with runAlignment $runAlignment has a null textDirection, so the alignment cannot be resolved.'); assert(textDirection != null, 'Vertical $runtimeType with runAlignment $runAlignment has a null textDirection, so the alignment cannot be resolved.');
...@@ -391,7 +370,6 @@ class RenderWrap extends RenderBox ...@@ -391,7 +370,6 @@ class RenderWrap extends RenderBox
if (crossAxisAlignment == WrapCrossAlignment.start || crossAxisAlignment == WrapCrossAlignment.end) { if (crossAxisAlignment == WrapCrossAlignment.start || crossAxisAlignment == WrapCrossAlignment.end) {
switch (direction) { switch (direction) {
case Axis.horizontal: case Axis.horizontal:
assert(verticalDirection != null, 'Horizontal $runtimeType with crossAxisAlignment $crossAxisAlignment has a null verticalDirection, so the alignment cannot be resolved.');
break; break;
case Axis.vertical: case Axis.vertical:
assert(textDirection != null, 'Vertical $runtimeType with crossAxisAlignment $crossAxisAlignment has a null textDirection, so the alignment cannot be resolved.'); assert(textDirection != null, 'Vertical $runtimeType with crossAxisAlignment $crossAxisAlignment has a null textDirection, so the alignment cannot be resolved.');
...@@ -610,8 +588,6 @@ class RenderWrap extends RenderBox ...@@ -610,8 +588,6 @@ class RenderWrap extends RenderBox
} }
break; break;
} }
assert(childConstraints != null);
assert(mainAxisLimit != null);
final double spacing = this.spacing; final double spacing = this.spacing;
final double runSpacing = this.runSpacing; final double runSpacing = this.runSpacing;
final List<_RunMetrics> runMetrics = <_RunMetrics>[]; final List<_RunMetrics> runMetrics = <_RunMetrics>[];
......
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