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