Unverified Commit c70df378 authored by nt4f04uNd's avatar nt4f04uNd Committed by GitHub

Change hitTest signatures to be non-nullable (#87792)

parent 0082ff97
...@@ -545,7 +545,7 @@ class _RenderInputPadding extends RenderShiftedBox { ...@@ -545,7 +545,7 @@ class _RenderInputPadding extends RenderShiftedBox {
return result.addWithRawTransform( return result.addWithRawTransform(
transform: MatrixUtils.forceToPoint(center), transform: MatrixUtils.forceToPoint(center),
position: center, position: center,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
assert(position == center); assert(position == center);
return child!.hitTest(result, position: center); return child!.hitTest(result, position: center);
}, },
......
...@@ -505,7 +505,7 @@ class _RenderInputPadding extends RenderShiftedBox { ...@@ -505,7 +505,7 @@ class _RenderInputPadding extends RenderShiftedBox {
return result.addWithRawTransform( return result.addWithRawTransform(
transform: MatrixUtils.forceToPoint(center), transform: MatrixUtils.forceToPoint(center),
position: center, position: center,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
assert(position == center); assert(position == center);
return child!.hitTest(result, position: center); return child!.hitTest(result, position: center);
}, },
......
...@@ -1997,7 +1997,7 @@ class _RenderChipRedirectingHitDetection extends RenderConstrainedBox { ...@@ -1997,7 +1997,7 @@ class _RenderChipRedirectingHitDetection extends RenderConstrainedBox {
return result.addWithRawTransform( return result.addWithRawTransform(
transform: MatrixUtils.forceToPoint(offset), transform: MatrixUtils.forceToPoint(offset),
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
assert(position == offset); assert(position == offset);
return child!.hitTest(result, position: offset); return child!.hitTest(result, position: offset);
}, },
...@@ -2535,7 +2535,7 @@ class _RenderChip extends RenderBox { ...@@ -2535,7 +2535,7 @@ class _RenderChip extends RenderBox {
return result.addWithRawTransform( return result.addWithRawTransform(
transform: MatrixUtils.forceToPoint(center), transform: MatrixUtils.forceToPoint(center),
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
assert(position == center); assert(position == center);
return hitTestChild.hitTest(result, position: center); return hitTestChild.hitTest(result, position: center);
}, },
......
...@@ -2769,9 +2769,9 @@ mixin RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataTyp ...@@ -2769,9 +2769,9 @@ mixin RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataTyp
final bool isHit = result.addWithPaintOffset( final bool isHit = result.addWithPaintOffset(
offset: childParentData.offset, offset: childParentData.offset,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? transformed) { hitTest: (BoxHitTestResult result, Offset transformed) {
assert(transformed == position - childParentData.offset); assert(transformed == position - childParentData.offset);
return child!.hitTest(result, position: transformed!); return child!.hitTest(result, position: transformed);
}, },
); );
if (isHit) if (isHit)
......
...@@ -1697,13 +1697,13 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, ...@@ -1697,13 +1697,13 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
final bool isHit = result.addWithPaintTransform( final bool isHit = result.addWithPaintTransform(
transform: transform, transform: transform,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? transformed) { hitTest: (BoxHitTestResult result, Offset transformed) {
assert(() { assert(() {
final Offset manualPosition = (position - textParentData.offset) / textParentData.scale!; final Offset manualPosition = (position - textParentData.offset) / textParentData.scale!;
return (transformed!.dx - manualPosition.dx).abs() < precisionErrorTolerance return (transformed.dx - manualPosition.dx).abs() < precisionErrorTolerance
&& (transformed.dy - manualPosition.dy).abs() < precisionErrorTolerance; && (transformed.dy - manualPosition.dy).abs() < precisionErrorTolerance;
}()); }());
return child!.hitTest(result, position: transformed!); return child!.hitTest(result, position: transformed);
}, },
); );
if (isHit) { if (isHit) {
......
...@@ -426,8 +426,8 @@ class RenderFlow extends RenderBox ...@@ -426,8 +426,8 @@ class RenderFlow extends RenderBox
final bool absorbed = result.addWithPaintTransform( final bool absorbed = result.addWithPaintTransform(
transform: transform, transform: transform,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
return child.hitTest(result, position: position!); return child.hitTest(result, position: position);
}, },
); );
if (absorbed) if (absorbed)
......
...@@ -465,13 +465,13 @@ class RenderParagraph extends RenderBox ...@@ -465,13 +465,13 @@ class RenderParagraph extends RenderBox
final bool isHit = result.addWithPaintTransform( final bool isHit = result.addWithPaintTransform(
transform: transform, transform: transform,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? transformed) { hitTest: (BoxHitTestResult result, Offset transformed) {
assert(() { assert(() {
final Offset manualPosition = (position - textParentData.offset) / textParentData.scale!; final Offset manualPosition = (position - textParentData.offset) / textParentData.scale!;
return (transformed!.dx - manualPosition.dx).abs() < precisionErrorTolerance return (transformed.dx - manualPosition.dx).abs() < precisionErrorTolerance
&& (transformed.dy - manualPosition.dy).abs() < precisionErrorTolerance; && (transformed.dy - manualPosition.dy).abs() < precisionErrorTolerance;
}()); }());
return child!.hitTest(result, position: transformed!); return child!.hitTest(result, position: transformed);
}, },
); );
if (isHit) { if (isHit) {
......
...@@ -2370,8 +2370,8 @@ class RenderTransform extends RenderProxyBox { ...@@ -2370,8 +2370,8 @@ class RenderTransform extends RenderProxyBox {
return result.addWithPaintTransform( return result.addWithPaintTransform(
transform: transformHitTests ? _effectiveTransform : null, transform: transformHitTests ? _effectiveTransform : null,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
return super.hitTestChildren(result, position: position!); return super.hitTestChildren(result, position: position);
}, },
); );
} }
...@@ -2665,8 +2665,8 @@ class RenderFittedBox extends RenderProxyBox { ...@@ -2665,8 +2665,8 @@ class RenderFittedBox extends RenderProxyBox {
return result.addWithPaintTransform( return result.addWithPaintTransform(
transform: _transform, transform: _transform,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
return super.hitTestChildren(result, position: position!); return super.hitTestChildren(result, position: position);
}, },
); );
} }
...@@ -2751,8 +2751,8 @@ class RenderFractionalTranslation extends RenderProxyBox { ...@@ -2751,8 +2751,8 @@ class RenderFractionalTranslation extends RenderProxyBox {
? Offset(translation.dx * size.width, translation.dy * size.height) ? Offset(translation.dx * size.width, translation.dy * size.height)
: null, : null,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
return super.hitTestChildren(result, position: position!); return super.hitTestChildren(result, position: position);
}, },
); );
} }
...@@ -5283,8 +5283,8 @@ class RenderFollowerLayer extends RenderProxyBox { ...@@ -5283,8 +5283,8 @@ class RenderFollowerLayer extends RenderProxyBox {
return result.addWithPaintTransform( return result.addWithPaintTransform(
transform: getCurrentTransform(), transform: getCurrentTransform(),
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
return super.hitTestChildren(result, position: position!); return super.hitTestChildren(result, position: position);
}, },
); );
} }
......
...@@ -104,8 +104,8 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB ...@@ -104,8 +104,8 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB
return result.addWithPaintTransform( return result.addWithPaintTransform(
transform: _paintTransform, transform: _paintTransform,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? position) { hitTest: (BoxHitTestResult result, Offset position) {
return child!.hitTest(result, position: position!); return child!.hitTest(result, position: position);
}, },
); );
} }
......
...@@ -87,9 +87,9 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi ...@@ -87,9 +87,9 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi
return result.addWithPaintOffset( return result.addWithPaintOffset(
offset: childParentData.offset, offset: childParentData.offset,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? transformed) { hitTest: (BoxHitTestResult result, Offset transformed) {
assert(transformed == position - childParentData.offset); assert(transformed == position - childParentData.offset);
return child!.hitTest(result, position: transformed!); return child!.hitTest(result, position: transformed);
}, },
); );
} }
......
...@@ -728,9 +728,9 @@ class RenderIndexedStack extends RenderStack { ...@@ -728,9 +728,9 @@ class RenderIndexedStack extends RenderStack {
return result.addWithPaintOffset( return result.addWithPaintOffset(
offset: childParentData.offset, offset: childParentData.offset,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? transformed) { hitTest: (BoxHitTestResult result, Offset transformed) {
assert(transformed == position - childParentData.offset); assert(transformed == position - childParentData.offset);
return child.hitTest(result, position: transformed!); return child.hitTest(result, position: transformed);
}, },
); );
} }
......
...@@ -1160,9 +1160,9 @@ class RenderTable extends RenderBox { ...@@ -1160,9 +1160,9 @@ class RenderTable extends RenderBox {
final bool isHit = result.addWithPaintOffset( final bool isHit = result.addWithPaintOffset(
offset: childParentData.offset, offset: childParentData.offset,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? transformed) { hitTest: (BoxHitTestResult result, Offset transformed) {
assert(transformed == position - childParentData.offset); assert(transformed == position - childParentData.offset);
return child.hitTest(result, position: transformed!); return child.hitTest(result, position: transformed);
}, },
); );
if (isHit) if (isHit)
......
...@@ -768,9 +768,9 @@ class _RenderTheatre extends RenderBox with ContainerRenderObjectMixin<RenderBox ...@@ -768,9 +768,9 @@ class _RenderTheatre extends RenderBox with ContainerRenderObjectMixin<RenderBox
final bool isHit = result.addWithPaintOffset( final bool isHit = result.addWithPaintOffset(
offset: childParentData.offset, offset: childParentData.offset,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? transformed) { hitTest: (BoxHitTestResult result, Offset transformed) {
assert(transformed == position - childParentData.offset); assert(transformed == position - childParentData.offset);
return child!.hitTest(result, position: transformed!); return child!.hitTest(result, position: transformed);
}, },
); );
if (isHit) if (isHit)
......
...@@ -585,9 +585,9 @@ class _RenderSingleChildViewport extends RenderBox with RenderObjectWithChildMix ...@@ -585,9 +585,9 @@ class _RenderSingleChildViewport extends RenderBox with RenderObjectWithChildMix
return result.addWithPaintOffset( return result.addWithPaintOffset(
offset: _paintOffset, offset: _paintOffset,
position: position, position: position,
hitTest: (BoxHitTestResult result, Offset? transformed) { hitTest: (BoxHitTestResult result, Offset transformed) {
assert(transformed == position + -_paintOffset); assert(transformed == position + -_paintOffset);
return child!.hitTest(result, position: transformed!); return child!.hitTest(result, position: transformed);
}, },
); );
} }
......
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