implicit-casts:false in flutter/lib/src/rendering (#45720)
* implicit-casts:false in flutter/lib/src/rendering * address review comments
This commit is contained in:
parent
166d422b05
commit
a5f9b3b036
@ -158,7 +158,7 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture
|
|||||||
PipelineOwner _pipelineOwner;
|
PipelineOwner _pipelineOwner;
|
||||||
|
|
||||||
/// The render tree that's attached to the output surface.
|
/// The render tree that's attached to the output surface.
|
||||||
RenderView get renderView => _pipelineOwner.rootNode;
|
RenderView get renderView => _pipelineOwner.rootNode as RenderView;
|
||||||
/// 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) {
|
||||||
|
@ -210,10 +210,10 @@ class BoxConstraints extends Constraints {
|
|||||||
/// as close as possible to the original constraints.
|
/// as close as possible to the original constraints.
|
||||||
BoxConstraints enforce(BoxConstraints constraints) {
|
BoxConstraints enforce(BoxConstraints constraints) {
|
||||||
return BoxConstraints(
|
return BoxConstraints(
|
||||||
minWidth: minWidth.clamp(constraints.minWidth, constraints.maxWidth),
|
minWidth: minWidth.clamp(constraints.minWidth, constraints.maxWidth) as double,
|
||||||
maxWidth: maxWidth.clamp(constraints.minWidth, constraints.maxWidth),
|
maxWidth: maxWidth.clamp(constraints.minWidth, constraints.maxWidth) as double,
|
||||||
minHeight: minHeight.clamp(constraints.minHeight, constraints.maxHeight),
|
minHeight: minHeight.clamp(constraints.minHeight, constraints.maxHeight) as double,
|
||||||
maxHeight: maxHeight.clamp(constraints.minHeight, constraints.maxHeight),
|
maxHeight: maxHeight.clamp(constraints.minHeight, constraints.maxHeight) as double,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,10 +221,12 @@ class BoxConstraints extends Constraints {
|
|||||||
/// the given width and height as possible while still respecting the original
|
/// the given width and height as possible while still respecting the original
|
||||||
/// box constraints.
|
/// box constraints.
|
||||||
BoxConstraints tighten({ double width, double height }) {
|
BoxConstraints tighten({ double width, double height }) {
|
||||||
return BoxConstraints(minWidth: width == null ? minWidth : width.clamp(minWidth, maxWidth),
|
return BoxConstraints(
|
||||||
maxWidth: width == null ? maxWidth : width.clamp(minWidth, maxWidth),
|
minWidth: width == null ? minWidth : width.clamp(minWidth, maxWidth) as double,
|
||||||
minHeight: height == null ? minHeight : height.clamp(minHeight, maxHeight),
|
maxWidth: width == null ? maxWidth : width.clamp(minWidth, maxWidth) as double,
|
||||||
maxHeight: height == null ? maxHeight : height.clamp(minHeight, maxHeight));
|
minHeight: height == null ? minHeight : height.clamp(minHeight, maxHeight) as double,
|
||||||
|
maxHeight: height == null ? maxHeight : height.clamp(minHeight, maxHeight) as double,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A box constraints with the width and height constraints flipped.
|
/// A box constraints with the width and height constraints flipped.
|
||||||
@ -249,14 +251,14 @@ class BoxConstraints extends Constraints {
|
|||||||
/// possible to the given width.
|
/// possible to the given width.
|
||||||
double constrainWidth([ double width = double.infinity ]) {
|
double constrainWidth([ double width = double.infinity ]) {
|
||||||
assert(debugAssertIsValid());
|
assert(debugAssertIsValid());
|
||||||
return width.clamp(minWidth, maxWidth);
|
return width.clamp(minWidth, maxWidth) as double;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the height that both satisfies the constraints and is as close as
|
/// Returns the height that both satisfies the constraints and is as close as
|
||||||
/// possible to the given height.
|
/// possible to the given height.
|
||||||
double constrainHeight([ double height = double.infinity ]) {
|
double constrainHeight([ double height = double.infinity ]) {
|
||||||
assert(debugAssertIsValid());
|
assert(debugAssertIsValid());
|
||||||
return height.clamp(minHeight, maxHeight);
|
return height.clamp(minHeight, maxHeight) as double;
|
||||||
}
|
}
|
||||||
|
|
||||||
Size _debugPropagateDebugSize(Size size, Size result) {
|
Size _debugPropagateDebugSize(Size size, Size result) {
|
||||||
@ -583,12 +585,12 @@ class BoxConstraints extends Constraints {
|
|||||||
return true;
|
return true;
|
||||||
if (runtimeType != other.runtimeType)
|
if (runtimeType != other.runtimeType)
|
||||||
return false;
|
return false;
|
||||||
final BoxConstraints typedOther = other;
|
assert(other is BoxConstraints && other.debugAssertIsValid());
|
||||||
assert(typedOther.debugAssertIsValid());
|
return other is BoxConstraints
|
||||||
return minWidth == typedOther.minWidth &&
|
&& other.minWidth == minWidth
|
||||||
maxWidth == typedOther.maxWidth &&
|
&& other.maxWidth == maxWidth
|
||||||
minHeight == typedOther.minHeight &&
|
&& other.minHeight == minHeight
|
||||||
maxHeight == typedOther.maxHeight;
|
&& other.maxHeight == maxHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -816,7 +818,7 @@ class BoxHitTestEntry extends HitTestEntry {
|
|||||||
super(target);
|
super(target);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
RenderBox get target => super.target;
|
RenderBox get target => super.target as RenderBox;
|
||||||
|
|
||||||
/// 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;
|
||||||
@ -852,11 +854,9 @@ class _IntrinsicDimensionsCacheEntry {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(dynamic other) {
|
bool operator ==(dynamic other) {
|
||||||
if (other is! _IntrinsicDimensionsCacheEntry)
|
return other is _IntrinsicDimensionsCacheEntry
|
||||||
return false;
|
&& other.dimension == dimension
|
||||||
final _IntrinsicDimensionsCacheEntry typedOther = other;
|
&& other.argument == argument;
|
||||||
return dimension == typedOther.dimension &&
|
|
||||||
argument == typedOther.argument;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -1686,8 +1686,8 @@ abstract class RenderBox extends RenderObject {
|
|||||||
Size get size {
|
Size get size {
|
||||||
assert(hasSize, 'RenderBox was not laid out: ${toString()}');
|
assert(hasSize, 'RenderBox was not laid out: ${toString()}');
|
||||||
assert(() {
|
assert(() {
|
||||||
|
final Size _size = this._size;
|
||||||
if (_size is _DebugSize) {
|
if (_size is _DebugSize) {
|
||||||
final _DebugSize _size = this._size;
|
|
||||||
assert(_size._owner == this);
|
assert(_size._owner == this);
|
||||||
if (RenderObject.debugActiveLayout != null) {
|
if (RenderObject.debugActiveLayout != null) {
|
||||||
// We are always allowed to access our own size (for print debugging
|
// We are always allowed to access our own size (for print debugging
|
||||||
@ -1850,7 +1850,7 @@ abstract class RenderBox extends RenderObject {
|
|||||||
assert(!_debugDoingBaseline, 'Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.');
|
assert(!_debugDoingBaseline, 'Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.');
|
||||||
assert(!debugNeedsLayout);
|
assert(!debugNeedsLayout);
|
||||||
assert(() {
|
assert(() {
|
||||||
final RenderObject parent = this.parent;
|
final RenderObject parent = this.parent as RenderObject;
|
||||||
if (owner.debugDoingLayout)
|
if (owner.debugDoingLayout)
|
||||||
return (RenderObject.debugActiveLayout == parent) && parent.debugDoingThisLayout;
|
return (RenderObject.debugActiveLayout == parent) && parent.debugDoingThisLayout;
|
||||||
if (owner.debugDoingPaint)
|
if (owner.debugDoingPaint)
|
||||||
@ -1913,7 +1913,7 @@ abstract class RenderBox extends RenderObject {
|
|||||||
|
|
||||||
/// The box constraints most recently received from the parent.
|
/// The box constraints most recently received from the parent.
|
||||||
@override
|
@override
|
||||||
BoxConstraints get constraints => super.constraints;
|
BoxConstraints get constraints => super.constraints as BoxConstraints;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void debugAssertDoesMeetConstraints() {
|
void debugAssertDoesMeetConstraints() {
|
||||||
@ -1946,14 +1946,14 @@ abstract class RenderBox extends RenderObject {
|
|||||||
if (!constraints.hasBoundedWidth) {
|
if (!constraints.hasBoundedWidth) {
|
||||||
RenderBox node = this;
|
RenderBox node = this;
|
||||||
while (!node.constraints.hasBoundedWidth && node.parent is RenderBox)
|
while (!node.constraints.hasBoundedWidth && node.parent is RenderBox)
|
||||||
node = node.parent;
|
node = node.parent as RenderBox;
|
||||||
|
|
||||||
information.add(node.describeForError('The nearest ancestor providing an unbounded width constraint is'));
|
information.add(node.describeForError('The nearest ancestor providing an unbounded width constraint is'));
|
||||||
}
|
}
|
||||||
if (!constraints.hasBoundedHeight) {
|
if (!constraints.hasBoundedHeight) {
|
||||||
RenderBox node = this;
|
RenderBox node = this;
|
||||||
while (!node.constraints.hasBoundedHeight && node.parent is RenderBox)
|
while (!node.constraints.hasBoundedHeight && node.parent is RenderBox)
|
||||||
node = node.parent;
|
node = node.parent as RenderBox;
|
||||||
|
|
||||||
information.add(node.describeForError('The nearest ancestor providing an unbounded height constraint is'));
|
information.add(node.describeForError('The nearest ancestor providing an unbounded height constraint is'));
|
||||||
}
|
}
|
||||||
@ -2208,7 +2208,7 @@ abstract class RenderBox extends RenderObject {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}());
|
}());
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
final Offset offset = childParentData.offset;
|
final Offset offset = childParentData.offset;
|
||||||
transform.translate(offset.dx, offset.dy);
|
transform.translate(offset.dx, offset.dy);
|
||||||
}
|
}
|
||||||
@ -2434,7 +2434,7 @@ mixin RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataTyp
|
|||||||
assert(!debugNeedsLayout);
|
assert(!debugNeedsLayout);
|
||||||
ChildType child = firstChild;
|
ChildType child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
final double result = child.getDistanceToActualBaseline(baseline);
|
final double result = child.getDistanceToActualBaseline(baseline);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
return result + childParentData.offset.dy;
|
return result + childParentData.offset.dy;
|
||||||
@ -2452,7 +2452,7 @@ mixin RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataTyp
|
|||||||
double result;
|
double result;
|
||||||
ChildType child = firstChild;
|
ChildType child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
double candidate = child.getDistanceToActualBaseline(baseline);
|
double candidate = child.getDistanceToActualBaseline(baseline);
|
||||||
if (candidate != null) {
|
if (candidate != null) {
|
||||||
candidate += childParentData.offset.dy;
|
candidate += childParentData.offset.dy;
|
||||||
@ -2479,7 +2479,7 @@ mixin RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataTyp
|
|||||||
// the x, y parameters have the top left of the node's box as the origin
|
// the x, y parameters have the top left of the node's box as the origin
|
||||||
ChildType child = lastChild;
|
ChildType child = lastChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
final bool isHit = result.addWithPaintOffset(
|
final bool isHit = result.addWithPaintOffset(
|
||||||
offset: childParentData.offset,
|
offset: childParentData.offset,
|
||||||
position: position,
|
position: position,
|
||||||
@ -2504,7 +2504,7 @@ mixin RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataTyp
|
|||||||
void defaultPaint(PaintingContext context, Offset offset) {
|
void defaultPaint(PaintingContext context, Offset offset) {
|
||||||
ChildType child = firstChild;
|
ChildType child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
context.paintChild(child, childParentData.offset + offset);
|
context.paintChild(child, childParentData.offset + offset);
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
@ -2519,8 +2519,8 @@ mixin RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataTyp
|
|||||||
final List<ChildType> result = <ChildType>[];
|
final List<ChildType> result = <ChildType>[];
|
||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
result.add(child);
|
result.add(child as ChildType);
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -186,12 +186,12 @@ abstract class MultiChildLayoutDelegate {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}());
|
}());
|
||||||
final MultiChildLayoutParentData childParentData = child.parentData;
|
final MultiChildLayoutParentData childParentData = child.parentData as MultiChildLayoutParentData;
|
||||||
childParentData.offset = offset;
|
childParentData.offset = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
DiagnosticsNode _debugDescribeChild(RenderBox child) {
|
DiagnosticsNode _debugDescribeChild(RenderBox child) {
|
||||||
final MultiChildLayoutParentData childParentData = child.parentData;
|
final MultiChildLayoutParentData childParentData = child.parentData as MultiChildLayoutParentData;
|
||||||
return DiagnosticsProperty<RenderBox>('${childParentData.id}', child);
|
return DiagnosticsProperty<RenderBox>('${childParentData.id}', child);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ abstract class MultiChildLayoutDelegate {
|
|||||||
_idToChild = <Object, RenderBox>{};
|
_idToChild = <Object, RenderBox>{};
|
||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final MultiChildLayoutParentData childParentData = child.parentData;
|
final MultiChildLayoutParentData childParentData = child.parentData as MultiChildLayoutParentData;
|
||||||
assert(() {
|
assert(() {
|
||||||
if (childParentData.id == null) {
|
if (childParentData.id == null) {
|
||||||
throw FlutterError.fromParts(<DiagnosticsNode>[
|
throw FlutterError.fromParts(<DiagnosticsNode>[
|
||||||
|
@ -284,7 +284,7 @@ mixin DebugOverflowIndicatorMixin on RenderObject {
|
|||||||
final List<_OverflowRegionData> overflowRegions = _calculateOverflowRegions(overflow, containerRect);
|
final List<_OverflowRegionData> overflowRegions = _calculateOverflowRegions(overflow, containerRect);
|
||||||
for (_OverflowRegionData region in overflowRegions) {
|
for (_OverflowRegionData region in overflowRegions) {
|
||||||
context.canvas.drawRect(region.rect.shift(offset), _indicatorPaint);
|
context.canvas.drawRect(region.rect.shift(offset), _indicatorPaint);
|
||||||
final TextSpan textSpan = _indicatorLabel[region.side.index].text;
|
final TextSpan textSpan = _indicatorLabel[region.side.index].text as TextSpan;
|
||||||
if (textSpan?.text != region.label) {
|
if (textSpan?.text != region.label) {
|
||||||
_indicatorLabel[region.side.index].text = TextSpan(
|
_indicatorLabel[region.side.index].text = TextSpan(
|
||||||
text: region.label,
|
text: region.label,
|
||||||
|
@ -733,7 +733,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The text to display.
|
/// The text to display.
|
||||||
TextSpan get text => _textPainter.text;
|
TextSpan get text => _textPainter.text as TextSpan;
|
||||||
final TextPainter _textPainter;
|
final TextPainter _textPainter;
|
||||||
set text(TextSpan value) {
|
set text(TextSpan value) {
|
||||||
if (_textPainter.text == value)
|
if (_textPainter.text == value)
|
||||||
@ -1955,8 +1955,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
|
|||||||
void _paintHandleLayers(PaintingContext context, List<TextSelectionPoint> endpoints) {
|
void _paintHandleLayers(PaintingContext context, List<TextSelectionPoint> endpoints) {
|
||||||
Offset startPoint = endpoints[0].point;
|
Offset startPoint = endpoints[0].point;
|
||||||
startPoint = Offset(
|
startPoint = Offset(
|
||||||
startPoint.dx.clamp(0.0, size.width),
|
startPoint.dx.clamp(0.0, size.width) as double,
|
||||||
startPoint.dy.clamp(0.0, size.height),
|
startPoint.dy.clamp(0.0, size.height) as double,
|
||||||
);
|
);
|
||||||
context.pushLayer(
|
context.pushLayer(
|
||||||
LeaderLayer(link: startHandleLayerLink, offset: startPoint),
|
LeaderLayer(link: startHandleLayerLink, offset: startPoint),
|
||||||
@ -1966,8 +1966,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
|
|||||||
if (endpoints.length == 2) {
|
if (endpoints.length == 2) {
|
||||||
Offset endPoint = endpoints[1].point;
|
Offset endPoint = endpoints[1].point;
|
||||||
endPoint = Offset(
|
endPoint = Offset(
|
||||||
endPoint.dx.clamp(0.0, size.width),
|
endPoint.dx.clamp(0.0, size.width) as double,
|
||||||
endPoint.dy.clamp(0.0, size.height),
|
endPoint.dy.clamp(0.0, size.height) as double,
|
||||||
);
|
);
|
||||||
context.pushLayer(
|
context.pushLayer(
|
||||||
LeaderLayer(link: endHandleLayerLink, offset: endPoint),
|
LeaderLayer(link: endHandleLayerLink, offset: endPoint),
|
||||||
|
@ -502,7 +502,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
|||||||
} else {
|
} else {
|
||||||
inflexibleSpace += childSize(child, extent);
|
inflexibleSpace += childSize(child, extent);
|
||||||
}
|
}
|
||||||
final FlexParentData childParentData = child.parentData;
|
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
return maxFlexFractionSoFar * totalFlex + inflexibleSpace;
|
return maxFlexFractionSoFar * totalFlex + inflexibleSpace;
|
||||||
@ -537,7 +537,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
|||||||
inflexibleSpace += mainSize;
|
inflexibleSpace += mainSize;
|
||||||
maxCrossSize = math.max(maxCrossSize, crossSize);
|
maxCrossSize = math.max(maxCrossSize, crossSize);
|
||||||
}
|
}
|
||||||
final FlexParentData childParentData = child.parentData;
|
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -552,7 +552,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
|||||||
final int flex = _getFlex(child);
|
final int flex = _getFlex(child);
|
||||||
if (flex > 0)
|
if (flex > 0)
|
||||||
maxCrossSize = math.max(maxCrossSize, childSize(child, spacePerFlex * flex));
|
maxCrossSize = math.max(maxCrossSize, childSize(child, spacePerFlex * flex));
|
||||||
final FlexParentData childParentData = child.parentData;
|
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,12 +604,12 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
|||||||
}
|
}
|
||||||
|
|
||||||
int _getFlex(RenderBox child) {
|
int _getFlex(RenderBox child) {
|
||||||
final FlexParentData childParentData = child.parentData;
|
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||||
return childParentData.flex ?? 0;
|
return childParentData.flex ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FlexFit _getFit(RenderBox child) {
|
FlexFit _getFit(RenderBox child) {
|
||||||
final FlexParentData childParentData = child.parentData;
|
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||||
return childParentData.fit ?? FlexFit.tight;
|
return childParentData.fit ?? FlexFit.tight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -648,7 +648,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
|||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
RenderBox lastFlexChild;
|
RenderBox lastFlexChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final FlexParentData childParentData = child.parentData;
|
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||||
totalChildren++;
|
totalChildren++;
|
||||||
final int flex = _getFlex(child);
|
final int flex = _getFlex(child);
|
||||||
if (flex > 0) {
|
if (flex > 0) {
|
||||||
@ -670,13 +670,13 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
|||||||
switch (_direction) {
|
switch (_direction) {
|
||||||
case Axis.horizontal:
|
case Axis.horizontal:
|
||||||
while (!node.constraints.hasBoundedWidth && node.parent is RenderBox)
|
while (!node.constraints.hasBoundedWidth && node.parent is RenderBox)
|
||||||
node = node.parent;
|
node = node.parent as RenderBox;
|
||||||
if (!node.constraints.hasBoundedWidth)
|
if (!node.constraints.hasBoundedWidth)
|
||||||
node = null;
|
node = null;
|
||||||
break;
|
break;
|
||||||
case Axis.vertical:
|
case Axis.vertical:
|
||||||
while (!node.constraints.hasBoundedHeight && node.parent is RenderBox)
|
while (!node.constraints.hasBoundedHeight && node.parent is RenderBox)
|
||||||
node = node.parent;
|
node = node.parent as RenderBox;
|
||||||
if (!node.constraints.hasBoundedHeight)
|
if (!node.constraints.hasBoundedHeight)
|
||||||
node = null;
|
node = null;
|
||||||
break;
|
break;
|
||||||
@ -830,7 +830,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
|||||||
crossSize = maxSizeAboveBaseline + maxSizeBelowBaseline;
|
crossSize = maxSizeAboveBaseline + maxSizeBelowBaseline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final FlexParentData childParentData = child.parentData;
|
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -892,7 +892,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
|||||||
double childMainPosition = flipMainAxis ? actualSize - leadingSpace : leadingSpace;
|
double childMainPosition = flipMainAxis ? actualSize - leadingSpace : leadingSpace;
|
||||||
child = firstChild;
|
child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final FlexParentData childParentData = child.parentData;
|
final FlexParentData childParentData = child.parentData as FlexParentData;
|
||||||
double childCrossPosition;
|
double childCrossPosition;
|
||||||
switch (_crossAxisAlignment) {
|
switch (_crossAxisAlignment) {
|
||||||
case CrossAxisAlignment.start:
|
case CrossAxisAlignment.start:
|
||||||
|
@ -287,7 +287,7 @@ class RenderFlow extends RenderBox
|
|||||||
_randomAccessChildren.add(child);
|
_randomAccessChildren.add(child);
|
||||||
final BoxConstraints innerConstraints = _delegate.getConstraintsForChild(i, constraints);
|
final BoxConstraints innerConstraints = _delegate.getConstraintsForChild(i, constraints);
|
||||||
child.layout(innerConstraints, parentUsesSize: true);
|
child.layout(innerConstraints, parentUsesSize: true);
|
||||||
final FlowParentData childParentData = child.parentData;
|
final FlowParentData childParentData = child.parentData as FlowParentData;
|
||||||
childParentData.offset = Offset.zero;
|
childParentData.offset = Offset.zero;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
i += 1;
|
i += 1;
|
||||||
@ -315,7 +315,7 @@ class RenderFlow extends RenderBox
|
|||||||
void paintChild(int i, { Matrix4 transform, double opacity = 1.0 }) {
|
void paintChild(int i, { Matrix4 transform, double opacity = 1.0 }) {
|
||||||
transform ??= Matrix4.identity();
|
transform ??= Matrix4.identity();
|
||||||
final RenderBox child = _randomAccessChildren[i];
|
final RenderBox child = _randomAccessChildren[i];
|
||||||
final FlowParentData childParentData = child.parentData;
|
final FlowParentData childParentData = child.parentData as FlowParentData;
|
||||||
assert(() {
|
assert(() {
|
||||||
if (childParentData._transform != null) {
|
if (childParentData._transform != null) {
|
||||||
throw FlutterError.fromParts(<DiagnosticsNode>[
|
throw FlutterError.fromParts(<DiagnosticsNode>[
|
||||||
@ -353,7 +353,7 @@ class RenderFlow extends RenderBox
|
|||||||
_paintingContext = context;
|
_paintingContext = context;
|
||||||
_paintingOffset = offset;
|
_paintingOffset = offset;
|
||||||
for (RenderBox child in _randomAccessChildren) {
|
for (RenderBox child in _randomAccessChildren) {
|
||||||
final FlowParentData childParentData = child.parentData;
|
final FlowParentData childParentData = child.parentData as FlowParentData;
|
||||||
childParentData._transform = null;
|
childParentData._transform = null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -377,7 +377,7 @@ class RenderFlow extends RenderBox
|
|||||||
if (childIndex >= children.length)
|
if (childIndex >= children.length)
|
||||||
continue;
|
continue;
|
||||||
final RenderBox child = children[childIndex];
|
final RenderBox child = children[childIndex];
|
||||||
final FlowParentData childParentData = child.parentData;
|
final FlowParentData childParentData = child.parentData as FlowParentData;
|
||||||
final Matrix4 transform = childParentData._transform;
|
final Matrix4 transform = childParentData._transform;
|
||||||
if (transform == null)
|
if (transform == null)
|
||||||
continue;
|
continue;
|
||||||
@ -396,7 +396,7 @@ class RenderFlow extends RenderBox
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void applyPaintTransform(RenderBox child, Matrix4 transform) {
|
void applyPaintTransform(RenderBox child, Matrix4 transform) {
|
||||||
final FlowParentData childParentData = child.parentData;
|
final FlowParentData childParentData = child.parentData as FlowParentData;
|
||||||
if (childParentData._transform != null)
|
if (childParentData._transform != null)
|
||||||
transform.multiply(childParentData._transform);
|
transform.multiply(childParentData._transform);
|
||||||
super.applyPaintTransform(child, transform);
|
super.applyPaintTransform(child, transform);
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
import 'dart:ui' as ui show EngineLayer, Image, ImageFilter, PathMetric,
|
import 'dart:ui' as ui;
|
||||||
Picture, PictureRecorder, Scene, SceneBuilder;
|
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
@ -103,7 +102,7 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
|
|||||||
/// Only subclasses of [ContainerLayer] can have children in the layer tree.
|
/// Only subclasses of [ContainerLayer] can have children in the layer tree.
|
||||||
/// All other layer classes are used for leaves in the layer tree.
|
/// All other layer classes are used for leaves in the layer tree.
|
||||||
@override
|
@override
|
||||||
ContainerLayer get parent => super.parent;
|
ContainerLayer get parent => super.parent as ContainerLayer;
|
||||||
|
|
||||||
// Whether this layer has any changes since its last call to [addToScene].
|
// Whether this layer has any changes since its last call to [addToScene].
|
||||||
//
|
//
|
||||||
@ -1158,7 +1157,11 @@ class OffsetLayer extends ContainerLayer {
|
|||||||
// retained rendering, we don't want to push the offset down to each leaf
|
// retained rendering, we don't want to push the offset down to each leaf
|
||||||
// node. Otherwise, changing an offset layer on the very high level could
|
// node. Otherwise, changing an offset layer on the very high level could
|
||||||
// cascade the change to too many leaves.
|
// cascade the change to too many leaves.
|
||||||
engineLayer = builder.pushOffset(layerOffset.dx + offset.dx, layerOffset.dy + offset.dy, oldLayer: _engineLayer);
|
engineLayer = builder.pushOffset(
|
||||||
|
layerOffset.dx + offset.dx,
|
||||||
|
layerOffset.dy + offset.dy,
|
||||||
|
oldLayer: _engineLayer as ui.OffsetEngineLayer,
|
||||||
|
);
|
||||||
addChildrenToScene(builder);
|
addChildrenToScene(builder);
|
||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
@ -1281,7 +1284,11 @@ class ClipRectLayer extends ContainerLayer {
|
|||||||
}());
|
}());
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
final Rect shiftedClipRect = layerOffset == Offset.zero ? clipRect : clipRect.shift(layerOffset);
|
final Rect shiftedClipRect = layerOffset == Offset.zero ? clipRect : clipRect.shift(layerOffset);
|
||||||
engineLayer = builder.pushClipRect(shiftedClipRect, clipBehavior: clipBehavior, oldLayer: _engineLayer);
|
engineLayer = builder.pushClipRect(
|
||||||
|
shiftedClipRect,
|
||||||
|
clipBehavior: clipBehavior,
|
||||||
|
oldLayer: _engineLayer as ui.ClipRectEngineLayer,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
engineLayer = null;
|
engineLayer = null;
|
||||||
}
|
}
|
||||||
@ -1362,7 +1369,11 @@ class ClipRRectLayer extends ContainerLayer {
|
|||||||
}());
|
}());
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
final RRect shiftedClipRRect = layerOffset == Offset.zero ? clipRRect : clipRRect.shift(layerOffset);
|
final RRect shiftedClipRRect = layerOffset == Offset.zero ? clipRRect : clipRRect.shift(layerOffset);
|
||||||
engineLayer = builder.pushClipRRect(shiftedClipRRect, clipBehavior: clipBehavior, oldLayer: _engineLayer);
|
engineLayer = builder.pushClipRRect(
|
||||||
|
shiftedClipRRect,
|
||||||
|
clipBehavior: clipBehavior,
|
||||||
|
oldLayer: _engineLayer as ui.ClipRRectEngineLayer,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
engineLayer = null;
|
engineLayer = null;
|
||||||
}
|
}
|
||||||
@ -1443,7 +1454,11 @@ class ClipPathLayer extends ContainerLayer {
|
|||||||
}());
|
}());
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
final Path shiftedPath = layerOffset == Offset.zero ? clipPath : clipPath.shift(layerOffset);
|
final Path shiftedPath = layerOffset == Offset.zero ? clipPath : clipPath.shift(layerOffset);
|
||||||
engineLayer = builder.pushClipPath(shiftedPath, clipBehavior: clipBehavior, oldLayer: _engineLayer);
|
engineLayer = builder.pushClipPath(
|
||||||
|
shiftedPath,
|
||||||
|
clipBehavior: clipBehavior,
|
||||||
|
oldLayer: _engineLayer as ui.ClipPathEngineLayer,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
engineLayer = null;
|
engineLayer = null;
|
||||||
}
|
}
|
||||||
@ -1486,7 +1501,10 @@ class ColorFilterLayer extends ContainerLayer {
|
|||||||
@override
|
@override
|
||||||
void addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) {
|
void addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) {
|
||||||
assert(colorFilter != null);
|
assert(colorFilter != null);
|
||||||
engineLayer = builder.pushColorFilter(colorFilter, oldLayer: _engineLayer);
|
engineLayer = builder.pushColorFilter(
|
||||||
|
colorFilter,
|
||||||
|
oldLayer: _engineLayer as ui.ColorFilterEngineLayer,
|
||||||
|
);
|
||||||
addChildrenToScene(builder, layerOffset);
|
addChildrenToScene(builder, layerOffset);
|
||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
@ -1546,7 +1564,10 @@ class TransformLayer extends OffsetLayer {
|
|||||||
_lastEffectiveTransform = Matrix4.translationValues(totalOffset.dx, totalOffset.dy, 0.0)
|
_lastEffectiveTransform = Matrix4.translationValues(totalOffset.dx, totalOffset.dy, 0.0)
|
||||||
..multiply(_lastEffectiveTransform);
|
..multiply(_lastEffectiveTransform);
|
||||||
}
|
}
|
||||||
engineLayer = builder.pushTransform(_lastEffectiveTransform.storage, oldLayer: _engineLayer);
|
engineLayer = builder.pushTransform(
|
||||||
|
_lastEffectiveTransform.storage,
|
||||||
|
oldLayer: _engineLayer as ui.TransformEngineLayer,
|
||||||
|
);
|
||||||
addChildrenToScene(builder);
|
addChildrenToScene(builder);
|
||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
@ -1656,7 +1677,11 @@ class OpacityLayer extends ContainerLayer {
|
|||||||
}());
|
}());
|
||||||
|
|
||||||
if (enabled)
|
if (enabled)
|
||||||
engineLayer = builder.pushOpacity(alpha, offset: offset + layerOffset, oldLayer: _engineLayer);
|
engineLayer = builder.pushOpacity(
|
||||||
|
alpha,
|
||||||
|
offset: offset + layerOffset,
|
||||||
|
oldLayer: _engineLayer as ui.OpacityEngineLayer,
|
||||||
|
);
|
||||||
else
|
else
|
||||||
engineLayer = null;
|
engineLayer = null;
|
||||||
addChildrenToScene(builder);
|
addChildrenToScene(builder);
|
||||||
@ -1748,7 +1773,12 @@ class ShaderMaskLayer extends ContainerLayer {
|
|||||||
assert(blendMode != null);
|
assert(blendMode != null);
|
||||||
assert(layerOffset != null);
|
assert(layerOffset != null);
|
||||||
final Rect shiftedMaskRect = layerOffset == Offset.zero ? maskRect : maskRect.shift(layerOffset);
|
final Rect shiftedMaskRect = layerOffset == Offset.zero ? maskRect : maskRect.shift(layerOffset);
|
||||||
engineLayer = builder.pushShaderMask(shader, shiftedMaskRect, blendMode, oldLayer: _engineLayer);
|
engineLayer = builder.pushShaderMask(
|
||||||
|
shader,
|
||||||
|
shiftedMaskRect,
|
||||||
|
blendMode,
|
||||||
|
oldLayer: _engineLayer as ui.ShaderMaskEngineLayer,
|
||||||
|
);
|
||||||
addChildrenToScene(builder, layerOffset);
|
addChildrenToScene(builder, layerOffset);
|
||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
@ -1786,7 +1816,10 @@ class BackdropFilterLayer extends ContainerLayer {
|
|||||||
@override
|
@override
|
||||||
void addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) {
|
void addToScene(ui.SceneBuilder builder, [ Offset layerOffset = Offset.zero ]) {
|
||||||
assert(filter != null);
|
assert(filter != null);
|
||||||
engineLayer = builder.pushBackdropFilter(filter, oldLayer: _engineLayer);
|
engineLayer = builder.pushBackdropFilter(
|
||||||
|
filter,
|
||||||
|
oldLayer: _engineLayer as ui.BackdropFilterEngineLayer,
|
||||||
|
);
|
||||||
addChildrenToScene(builder, layerOffset);
|
addChildrenToScene(builder, layerOffset);
|
||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
@ -1923,7 +1956,7 @@ class PhysicalModelLayer extends ContainerLayer {
|
|||||||
color: color,
|
color: color,
|
||||||
shadowColor: shadowColor,
|
shadowColor: shadowColor,
|
||||||
clipBehavior: clipBehavior,
|
clipBehavior: clipBehavior,
|
||||||
oldLayer: _engineLayer,
|
oldLayer: _engineLayer as ui.PhysicalShapeEngineLayer,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
engineLayer = null;
|
engineLayer = null;
|
||||||
@ -2036,7 +2069,10 @@ class LeaderLayer extends ContainerLayer {
|
|||||||
assert(offset != null);
|
assert(offset != null);
|
||||||
_lastOffset = offset + layerOffset;
|
_lastOffset = offset + layerOffset;
|
||||||
if (_lastOffset != Offset.zero)
|
if (_lastOffset != Offset.zero)
|
||||||
engineLayer = builder.pushTransform(Matrix4.translationValues(_lastOffset.dx, _lastOffset.dy, 0.0).storage, oldLayer: _engineLayer);
|
engineLayer = builder.pushTransform(
|
||||||
|
Matrix4.translationValues(_lastOffset.dx, _lastOffset.dy, 0.0).storage,
|
||||||
|
oldLayer: _engineLayer as ui.TransformEngineLayer,
|
||||||
|
);
|
||||||
addChildrenToScene(builder);
|
addChildrenToScene(builder);
|
||||||
if (_lastOffset != Offset.zero)
|
if (_lastOffset != Offset.zero)
|
||||||
builder.pop();
|
builder.pop();
|
||||||
@ -2278,14 +2314,20 @@ class FollowerLayer extends ContainerLayer {
|
|||||||
}
|
}
|
||||||
_establishTransform();
|
_establishTransform();
|
||||||
if (_lastTransform != null) {
|
if (_lastTransform != null) {
|
||||||
engineLayer = builder.pushTransform(_lastTransform.storage, oldLayer: _engineLayer);
|
engineLayer = builder.pushTransform(
|
||||||
|
_lastTransform.storage,
|
||||||
|
oldLayer: _engineLayer as ui.TransformEngineLayer,
|
||||||
|
);
|
||||||
addChildrenToScene(builder);
|
addChildrenToScene(builder);
|
||||||
builder.pop();
|
builder.pop();
|
||||||
_lastOffset = unlinkedOffset + layerOffset;
|
_lastOffset = unlinkedOffset + layerOffset;
|
||||||
} else {
|
} else {
|
||||||
_lastOffset = null;
|
_lastOffset = null;
|
||||||
final Matrix4 matrix = Matrix4.translationValues(unlinkedOffset.dx, unlinkedOffset.dy, .0);
|
final Matrix4 matrix = Matrix4.translationValues(unlinkedOffset.dx, unlinkedOffset.dy, .0);
|
||||||
engineLayer = builder.pushTransform(matrix.storage, oldLayer: _engineLayer);
|
engineLayer = builder.pushTransform(
|
||||||
|
matrix.storage,
|
||||||
|
oldLayer: _engineLayer as ui.TransformEngineLayer,
|
||||||
|
);
|
||||||
addChildrenToScene(builder);
|
addChildrenToScene(builder);
|
||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
@ -2425,7 +2467,7 @@ class AnnotatedRegionLayer<T> extends ContainerLayer {
|
|||||||
if (T == S) {
|
if (T == S) {
|
||||||
isAbsorbed = isAbsorbed || opaque;
|
isAbsorbed = isAbsorbed || opaque;
|
||||||
final Object untypedValue = value;
|
final Object untypedValue = value;
|
||||||
final S typedValue = untypedValue;
|
final S typedValue = untypedValue as S;
|
||||||
result.add(AnnotationEntry<S>(
|
result.add(AnnotationEntry<S>(
|
||||||
annotation: typedValue,
|
annotation: typedValue,
|
||||||
localPosition: localPosition,
|
localPosition: localPosition,
|
||||||
|
@ -126,7 +126,7 @@ class RenderListBody extends RenderBox
|
|||||||
final BoxConstraints innerConstraints = BoxConstraints.tightFor(height: constraints.maxHeight);
|
final BoxConstraints innerConstraints = BoxConstraints.tightFor(height: constraints.maxHeight);
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
child.layout(innerConstraints, parentUsesSize: true);
|
child.layout(innerConstraints, parentUsesSize: true);
|
||||||
final ListBodyParentData childParentData = child.parentData;
|
final ListBodyParentData childParentData = child.parentData as ListBodyParentData;
|
||||||
childParentData.offset = Offset(mainAxisExtent, 0.0);
|
childParentData.offset = Offset(mainAxisExtent, 0.0);
|
||||||
mainAxisExtent += child.size.width;
|
mainAxisExtent += child.size.width;
|
||||||
assert(child.parentData == childParentData);
|
assert(child.parentData == childParentData);
|
||||||
@ -138,7 +138,7 @@ class RenderListBody extends RenderBox
|
|||||||
final BoxConstraints innerConstraints = BoxConstraints.tightFor(height: constraints.maxHeight);
|
final BoxConstraints innerConstraints = BoxConstraints.tightFor(height: constraints.maxHeight);
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
child.layout(innerConstraints, parentUsesSize: true);
|
child.layout(innerConstraints, parentUsesSize: true);
|
||||||
final ListBodyParentData childParentData = child.parentData;
|
final ListBodyParentData childParentData = child.parentData as ListBodyParentData;
|
||||||
mainAxisExtent += child.size.width;
|
mainAxisExtent += child.size.width;
|
||||||
assert(child.parentData == childParentData);
|
assert(child.parentData == childParentData);
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
@ -146,7 +146,7 @@ class RenderListBody extends RenderBox
|
|||||||
double position = 0.0;
|
double position = 0.0;
|
||||||
child = firstChild;
|
child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final ListBodyParentData childParentData = child.parentData;
|
final ListBodyParentData childParentData = child.parentData as ListBodyParentData;
|
||||||
position += child.size.width;
|
position += child.size.width;
|
||||||
childParentData.offset = Offset(mainAxisExtent - position, 0.0);
|
childParentData.offset = Offset(mainAxisExtent - position, 0.0);
|
||||||
assert(child.parentData == childParentData);
|
assert(child.parentData == childParentData);
|
||||||
@ -158,7 +158,7 @@ class RenderListBody extends RenderBox
|
|||||||
final BoxConstraints innerConstraints = BoxConstraints.tightFor(width: constraints.maxWidth);
|
final BoxConstraints innerConstraints = BoxConstraints.tightFor(width: constraints.maxWidth);
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
child.layout(innerConstraints, parentUsesSize: true);
|
child.layout(innerConstraints, parentUsesSize: true);
|
||||||
final ListBodyParentData childParentData = child.parentData;
|
final ListBodyParentData childParentData = child.parentData as ListBodyParentData;
|
||||||
childParentData.offset = Offset(0.0, mainAxisExtent);
|
childParentData.offset = Offset(0.0, mainAxisExtent);
|
||||||
mainAxisExtent += child.size.height;
|
mainAxisExtent += child.size.height;
|
||||||
assert(child.parentData == childParentData);
|
assert(child.parentData == childParentData);
|
||||||
@ -170,7 +170,7 @@ class RenderListBody extends RenderBox
|
|||||||
final BoxConstraints innerConstraints = BoxConstraints.tightFor(width: constraints.maxWidth);
|
final BoxConstraints innerConstraints = BoxConstraints.tightFor(width: constraints.maxWidth);
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
child.layout(innerConstraints, parentUsesSize: true);
|
child.layout(innerConstraints, parentUsesSize: true);
|
||||||
final ListBodyParentData childParentData = child.parentData;
|
final ListBodyParentData childParentData = child.parentData as ListBodyParentData;
|
||||||
mainAxisExtent += child.size.height;
|
mainAxisExtent += child.size.height;
|
||||||
assert(child.parentData == childParentData);
|
assert(child.parentData == childParentData);
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
@ -178,7 +178,7 @@ class RenderListBody extends RenderBox
|
|||||||
double position = 0.0;
|
double position = 0.0;
|
||||||
child = firstChild;
|
child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final ListBodyParentData childParentData = child.parentData;
|
final ListBodyParentData childParentData = child.parentData as ListBodyParentData;
|
||||||
position += child.size.height;
|
position += child.size.height;
|
||||||
childParentData.offset = Offset(0.0, mainAxisExtent - position);
|
childParentData.offset = Offset(0.0, mainAxisExtent - position);
|
||||||
assert(child.parentData == childParentData);
|
assert(child.parentData == childParentData);
|
||||||
@ -201,7 +201,7 @@ class RenderListBody extends RenderBox
|
|||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
extent = math.max(extent, childSize(child));
|
extent = math.max(extent, childSize(child));
|
||||||
final ListBodyParentData childParentData = child.parentData;
|
final ListBodyParentData childParentData = child.parentData as ListBodyParentData;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
return extent;
|
return extent;
|
||||||
@ -212,7 +212,7 @@ class RenderListBody extends RenderBox
|
|||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
extent += childSize(child);
|
extent += childSize(child);
|
||||||
final ListBodyParentData childParentData = child.parentData;
|
final ListBodyParentData childParentData = child.parentData as ListBodyParentData;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
return extent;
|
return extent;
|
||||||
|
@ -598,7 +598,7 @@ class RenderListWheelViewport
|
|||||||
/// Gets the index of a child by looking at its parentData.
|
/// Gets the index of a child by looking at its parentData.
|
||||||
int indexOf(RenderBox child) {
|
int indexOf(RenderBox child) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final ListWheelParentData childParentData = child.parentData;
|
final ListWheelParentData childParentData = child.parentData as ListWheelParentData;
|
||||||
assert(childParentData.index != null);
|
assert(childParentData.index != null);
|
||||||
return childParentData.index;
|
return childParentData.index;
|
||||||
}
|
}
|
||||||
@ -625,7 +625,7 @@ class RenderListWheelViewport
|
|||||||
|
|
||||||
void _layoutChild(RenderBox child, BoxConstraints constraints, int index) {
|
void _layoutChild(RenderBox child, BoxConstraints constraints, int index) {
|
||||||
child.layout(constraints, parentUsesSize: true);
|
child.layout(constraints, parentUsesSize: true);
|
||||||
final ListWheelParentData childParentData = child.parentData;
|
final ListWheelParentData childParentData = child.parentData as ListWheelParentData;
|
||||||
// Centers the child horizontally.
|
// Centers the child horizontally.
|
||||||
final double crossPosition = size.width / 2.0 - child.size.width / 2.0;
|
final double crossPosition = size.width / 2.0 - child.size.width / 2.0;
|
||||||
childParentData.offset = Offset(crossPosition, indexToScrollOffset(index));
|
childParentData.offset = Offset(crossPosition, indexToScrollOffset(index));
|
||||||
@ -780,12 +780,12 @@ class RenderListWheelViewport
|
|||||||
/// Paints all children visible in the current viewport.
|
/// Paints all children visible in the current viewport.
|
||||||
void _paintVisibleChildren(PaintingContext context, Offset offset) {
|
void _paintVisibleChildren(PaintingContext context, Offset offset) {
|
||||||
RenderBox childToPaint = firstChild;
|
RenderBox childToPaint = firstChild;
|
||||||
ListWheelParentData childParentData = childToPaint?.parentData;
|
ListWheelParentData childParentData = childToPaint?.parentData as ListWheelParentData;
|
||||||
|
|
||||||
while (childParentData != null) {
|
while (childParentData != null) {
|
||||||
_paintTransformedChild(childToPaint, context, offset, childParentData.offset);
|
_paintTransformedChild(childToPaint, context, offset, childParentData.offset);
|
||||||
childToPaint = childAfter(childToPaint);
|
childToPaint = childAfter(childToPaint);
|
||||||
childParentData = childToPaint?.parentData;
|
childParentData = childToPaint?.parentData as ListWheelParentData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -971,7 +971,7 @@ class RenderListWheelViewport
|
|||||||
/// painting coordinates** system.
|
/// painting coordinates** system.
|
||||||
@override
|
@override
|
||||||
void applyPaintTransform(RenderBox child, Matrix4 transform) {
|
void applyPaintTransform(RenderBox child, Matrix4 transform) {
|
||||||
final ListWheelParentData parentData = child?.parentData;
|
final ListWheelParentData parentData = child?.parentData as ListWheelParentData;
|
||||||
transform.translate(0.0, _getUntransformedPaintingCoordinateY(parentData.offset.dy));
|
transform.translate(0.0, _getUntransformedPaintingCoordinateY(parentData.offset.dy));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -997,9 +997,9 @@ class RenderListWheelViewport
|
|||||||
// `child` will be the last RenderObject before the viewport when walking up from `target`.
|
// `child` will be the last RenderObject before the viewport when walking up from `target`.
|
||||||
RenderObject child = target;
|
RenderObject child = target;
|
||||||
while (child.parent != this)
|
while (child.parent != this)
|
||||||
child = child.parent;
|
child = child.parent as RenderObject;
|
||||||
|
|
||||||
final ListWheelParentData parentData = child.parentData;
|
final ListWheelParentData parentData = child.parentData as ListWheelParentData;
|
||||||
final double targetOffset = parentData.offset.dy; // the so-called "centerPosition"
|
final double targetOffset = parentData.offset.dy; // the so-called "centerPosition"
|
||||||
|
|
||||||
final Matrix4 transform = target.getTransformTo(child);
|
final Matrix4 transform = target.getTransformTo(child);
|
||||||
|
@ -112,7 +112,7 @@ class PaintingContext extends ClipContext {
|
|||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}());
|
}());
|
||||||
OffsetLayer childLayer = child._layer;
|
OffsetLayer childLayer = child._layer as OffsetLayer;
|
||||||
if (childLayer == null) {
|
if (childLayer == null) {
|
||||||
assert(debugAlsoPaintedParent);
|
assert(debugAlsoPaintedParent);
|
||||||
// Not using the `layer` setter because the setter asserts that we not
|
// Not using the `layer` setter because the setter asserts that we not
|
||||||
@ -211,7 +211,7 @@ class PaintingContext extends ClipContext {
|
|||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
assert(child._layer is OffsetLayer);
|
assert(child._layer is OffsetLayer);
|
||||||
final OffsetLayer childOffsetLayer = child._layer;
|
final OffsetLayer childOffsetLayer = child._layer as OffsetLayer;
|
||||||
childOffsetLayer.offset = offset;
|
childOffsetLayer.offset = offset;
|
||||||
appendLayer(child._layer);
|
appendLayer(child._layer);
|
||||||
}
|
}
|
||||||
@ -1388,7 +1388,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
result = true;
|
result = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
node = node.parent;
|
node = node.parent as RenderObject;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}());
|
}());
|
||||||
@ -1396,7 +1396,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
PipelineOwner get owner => super.owner;
|
PipelineOwner get owner => super.owner as PipelineOwner;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void attach(PipelineOwner owner) {
|
void attach(PipelineOwner owner) {
|
||||||
@ -1478,7 +1478,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
while (node != _relayoutBoundary) {
|
while (node != _relayoutBoundary) {
|
||||||
assert(node._relayoutBoundary == _relayoutBoundary);
|
assert(node._relayoutBoundary == _relayoutBoundary);
|
||||||
assert(node.parent != null);
|
assert(node.parent != null);
|
||||||
node = node.parent;
|
node = node.parent as RenderObject;
|
||||||
if ((!node._needsLayout) && (!node._debugDoingThisLayout))
|
if ((!node._needsLayout) && (!node._debugDoingThisLayout))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1559,7 +1559,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
@protected
|
@protected
|
||||||
void markParentNeedsLayout() {
|
void markParentNeedsLayout() {
|
||||||
_needsLayout = true;
|
_needsLayout = true;
|
||||||
final RenderObject parent = this.parent;
|
final RenderObject parent = this.parent as RenderObject;
|
||||||
if (!_doingThisLayoutWithCallback) {
|
if (!_doingThisLayoutWithCallback) {
|
||||||
parent.markNeedsLayout();
|
parent.markNeedsLayout();
|
||||||
} else {
|
} else {
|
||||||
@ -1697,8 +1697,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
if (!parentUsesSize || sizedByParent || constraints.isTight || parent is! RenderObject) {
|
if (!parentUsesSize || sizedByParent || constraints.isTight || parent is! RenderObject) {
|
||||||
relayoutBoundary = this;
|
relayoutBoundary = this;
|
||||||
} else {
|
} else {
|
||||||
final RenderObject parent = this.parent;
|
relayoutBoundary = (parent as RenderObject)._relayoutBoundary;
|
||||||
relayoutBoundary = parent._relayoutBoundary;
|
|
||||||
}
|
}
|
||||||
assert(() {
|
assert(() {
|
||||||
_debugCanParentUseSize = parentUsesSize;
|
_debugCanParentUseSize = parentUsesSize;
|
||||||
@ -1864,7 +1863,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
assert(!_doingThisLayoutWithCallback);
|
assert(!_doingThisLayoutWithCallback);
|
||||||
_doingThisLayoutWithCallback = true;
|
_doingThisLayoutWithCallback = true;
|
||||||
try {
|
try {
|
||||||
owner._enableMutationsToDirtySubtrees(() { callback(constraints); });
|
owner._enableMutationsToDirtySubtrees(() { callback(constraints as T); });
|
||||||
} finally {
|
} finally {
|
||||||
_doingThisLayoutWithCallback = false;
|
_doingThisLayoutWithCallback = false;
|
||||||
}
|
}
|
||||||
@ -2011,7 +2010,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
return;
|
return;
|
||||||
_needsCompositingBitsUpdate = true;
|
_needsCompositingBitsUpdate = true;
|
||||||
if (parent is RenderObject) {
|
if (parent is RenderObject) {
|
||||||
final RenderObject parent = this.parent;
|
final RenderObject parent = this.parent as RenderObject;
|
||||||
if (parent._needsCompositingBitsUpdate)
|
if (parent._needsCompositingBitsUpdate)
|
||||||
return;
|
return;
|
||||||
if (!isRepaintBoundary && !parent.isRepaintBoundary) {
|
if (!isRepaintBoundary && !parent.isRepaintBoundary) {
|
||||||
@ -2123,7 +2122,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
owner.requestVisualUpdate();
|
owner.requestVisualUpdate();
|
||||||
}
|
}
|
||||||
} else if (parent is RenderObject) {
|
} else if (parent is RenderObject) {
|
||||||
final RenderObject parent = this.parent;
|
final RenderObject parent = this.parent as RenderObject;
|
||||||
parent.markNeedsPaint();
|
parent.markNeedsPaint();
|
||||||
assert(parent == this.parent);
|
assert(parent == this.parent);
|
||||||
} else {
|
} else {
|
||||||
@ -2154,7 +2153,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
assert(!_layer.attached);
|
assert(!_layer.attached);
|
||||||
AbstractNode ancestor = parent;
|
AbstractNode ancestor = parent;
|
||||||
while (ancestor is RenderObject) {
|
while (ancestor is RenderObject) {
|
||||||
final RenderObject node = ancestor;
|
final RenderObject node = ancestor as RenderObject;
|
||||||
if (node.isRepaintBoundary) {
|
if (node.isRepaintBoundary) {
|
||||||
if (node._layer == null)
|
if (node._layer == null)
|
||||||
break; // looks like the subtree here has never been painted. let it handle itself.
|
break; // looks like the subtree here has never been painted. let it handle itself.
|
||||||
@ -2333,7 +2332,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
ancestor = rootNode;
|
ancestor = rootNode;
|
||||||
}
|
}
|
||||||
final List<RenderObject> renderers = <RenderObject>[];
|
final List<RenderObject> renderers = <RenderObject>[];
|
||||||
for (RenderObject renderer = this; renderer != ancestor; renderer = renderer.parent) {
|
for (RenderObject renderer = this; renderer != ancestor; renderer = renderer.parent as RenderObject) {
|
||||||
assert(renderer != null); // Failed to find ancestor in parent chain.
|
assert(renderer != null); // Failed to find ancestor in parent chain.
|
||||||
renderers.add(renderer);
|
renderers.add(renderer);
|
||||||
}
|
}
|
||||||
@ -2452,7 +2451,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
if (_semantics != null && !_semantics.isMergedIntoParent) {
|
if (_semantics != null && !_semantics.isMergedIntoParent) {
|
||||||
_semantics.sendEvent(semanticsEvent);
|
_semantics.sendEvent(semanticsEvent);
|
||||||
} else if (parent != null) {
|
} else if (parent != null) {
|
||||||
final RenderObject renderParent = parent;
|
final RenderObject renderParent = parent as RenderObject;
|
||||||
renderParent.sendSemanticsEvent(semanticsEvent);
|
renderParent.sendSemanticsEvent(semanticsEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2534,7 +2533,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
break;
|
break;
|
||||||
node._needsSemanticsUpdate = true;
|
node._needsSemanticsUpdate = true;
|
||||||
|
|
||||||
node = node.parent;
|
node = node.parent as RenderObject;
|
||||||
isEffectiveSemanticsBoundary = node._semanticsConfiguration.isSemanticBoundary;
|
isEffectiveSemanticsBoundary = node._semanticsConfiguration.isSemanticBoundary;
|
||||||
if (isEffectiveSemanticsBoundary && node._semantics == null) {
|
if (isEffectiveSemanticsBoundary && node._semantics == null) {
|
||||||
// We have reached a semantics boundary that doesn't own a semantics node.
|
// We have reached a semantics boundary that doesn't own a semantics node.
|
||||||
@ -2575,7 +2574,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
mergeIntoParent: _semantics?.parent?.isPartOfNodeMerging ?? false,
|
mergeIntoParent: _semantics?.parent?.isPartOfNodeMerging ?? false,
|
||||||
);
|
);
|
||||||
assert(fragment is _InterestingSemanticsFragment);
|
assert(fragment is _InterestingSemanticsFragment);
|
||||||
final _InterestingSemanticsFragment interestingFragment = fragment;
|
final _InterestingSemanticsFragment interestingFragment = fragment as _InterestingSemanticsFragment;
|
||||||
final SemanticsNode node = interestingFragment.compileChildren(
|
final SemanticsNode node = interestingFragment.compileChildren(
|
||||||
parentSemanticsClipRect: _semantics?.parentSemanticsClipRect,
|
parentSemanticsClipRect: _semantics?.parentSemanticsClipRect,
|
||||||
parentPaintClipRect: _semantics?.parentPaintClipRect,
|
parentPaintClipRect: _semantics?.parentPaintClipRect,
|
||||||
@ -2676,7 +2675,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
dropsSemanticsOfPreviousSiblings: dropSemanticsOfPreviousSiblings,
|
dropsSemanticsOfPreviousSiblings: dropSemanticsOfPreviousSiblings,
|
||||||
);
|
);
|
||||||
if (config.isSemanticBoundary) {
|
if (config.isSemanticBoundary) {
|
||||||
final _SwitchableSemanticsFragment fragment = result;
|
final _SwitchableSemanticsFragment fragment = result as _SwitchableSemanticsFragment;
|
||||||
fragment.markAsExplicit();
|
fragment.markAsExplicit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2717,7 +2716,8 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
Iterable<SemanticsNode> children,
|
Iterable<SemanticsNode> children,
|
||||||
) {
|
) {
|
||||||
assert(node == _semantics);
|
assert(node == _semantics);
|
||||||
node.updateWith(config: config, childrenInInversePaintOrder: children);
|
// TODO(a14n): remove the following cast by updating type of parameter in either updateWith or assembleSemanticsNode
|
||||||
|
node.updateWith(config: config, childrenInInversePaintOrder: children as List<SemanticsNode>);
|
||||||
}
|
}
|
||||||
|
|
||||||
// EVENTS
|
// EVENTS
|
||||||
@ -2753,9 +2753,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
String header = describeIdentity(this);
|
String header = describeIdentity(this);
|
||||||
if (_relayoutBoundary != null && _relayoutBoundary != this) {
|
if (_relayoutBoundary != null && _relayoutBoundary != this) {
|
||||||
int count = 1;
|
int count = 1;
|
||||||
RenderObject target = parent;
|
RenderObject target = parent as RenderObject;
|
||||||
while (target != null && target != _relayoutBoundary) {
|
while (target != null && target != _relayoutBoundary) {
|
||||||
target = target.parent;
|
target = target.parent as RenderObject;
|
||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
header += ' relayoutBoundary=up$count';
|
header += ' relayoutBoundary=up$count';
|
||||||
@ -2869,7 +2869,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
|||||||
Curve curve = Curves.ease,
|
Curve curve = Curves.ease,
|
||||||
}) {
|
}) {
|
||||||
if (parent is RenderObject) {
|
if (parent is RenderObject) {
|
||||||
final RenderObject renderParent = parent;
|
final RenderObject renderParent = parent as RenderObject;
|
||||||
renderParent.showOnScreen(
|
renderParent.showOnScreen(
|
||||||
descendant: descendant ?? this,
|
descendant: descendant ?? this,
|
||||||
rect: rect,
|
rect: rect,
|
||||||
@ -3003,20 +3003,20 @@ mixin ContainerParentDataMixin<ChildType extends RenderObject> on ParentData {
|
|||||||
/// list of children.
|
/// list of children.
|
||||||
mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType extends ContainerParentDataMixin<ChildType>> on RenderObject {
|
mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType extends ContainerParentDataMixin<ChildType>> on RenderObject {
|
||||||
bool _debugUltimatePreviousSiblingOf(ChildType child, { ChildType equals }) {
|
bool _debugUltimatePreviousSiblingOf(ChildType child, { ChildType equals }) {
|
||||||
ParentDataType childParentData = child.parentData;
|
ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
while (childParentData.previousSibling != null) {
|
while (childParentData.previousSibling != null) {
|
||||||
assert(childParentData.previousSibling != child);
|
assert(childParentData.previousSibling != child);
|
||||||
child = childParentData.previousSibling;
|
child = childParentData.previousSibling;
|
||||||
childParentData = child.parentData;
|
childParentData = child.parentData as ParentDataType;
|
||||||
}
|
}
|
||||||
return child == equals;
|
return child == equals;
|
||||||
}
|
}
|
||||||
bool _debugUltimateNextSiblingOf(ChildType child, { ChildType equals }) {
|
bool _debugUltimateNextSiblingOf(ChildType child, { ChildType equals }) {
|
||||||
ParentDataType childParentData = child.parentData;
|
ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
while (childParentData.nextSibling != null) {
|
while (childParentData.nextSibling != null) {
|
||||||
assert(childParentData.nextSibling != child);
|
assert(childParentData.nextSibling != child);
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
childParentData = child.parentData;
|
childParentData = child.parentData as ParentDataType;
|
||||||
}
|
}
|
||||||
return child == equals;
|
return child == equals;
|
||||||
}
|
}
|
||||||
@ -3068,7 +3068,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
ChildType _firstChild;
|
ChildType _firstChild;
|
||||||
ChildType _lastChild;
|
ChildType _lastChild;
|
||||||
void _insertIntoChildList(ChildType child, { ChildType after }) {
|
void _insertIntoChildList(ChildType child, { ChildType after }) {
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
assert(childParentData.nextSibling == null);
|
assert(childParentData.nextSibling == null);
|
||||||
assert(childParentData.previousSibling == null);
|
assert(childParentData.previousSibling == null);
|
||||||
_childCount += 1;
|
_childCount += 1;
|
||||||
@ -3077,7 +3077,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
// insert at the start (_firstChild)
|
// insert at the start (_firstChild)
|
||||||
childParentData.nextSibling = _firstChild;
|
childParentData.nextSibling = _firstChild;
|
||||||
if (_firstChild != null) {
|
if (_firstChild != null) {
|
||||||
final ParentDataType _firstChildParentData = _firstChild.parentData;
|
final ParentDataType _firstChildParentData = _firstChild.parentData as ParentDataType;
|
||||||
_firstChildParentData.previousSibling = child;
|
_firstChildParentData.previousSibling = child;
|
||||||
}
|
}
|
||||||
_firstChild = child;
|
_firstChild = child;
|
||||||
@ -3087,7 +3087,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
assert(_lastChild != null);
|
assert(_lastChild != null);
|
||||||
assert(_debugUltimatePreviousSiblingOf(after, equals: _firstChild));
|
assert(_debugUltimatePreviousSiblingOf(after, equals: _firstChild));
|
||||||
assert(_debugUltimateNextSiblingOf(after, equals: _lastChild));
|
assert(_debugUltimateNextSiblingOf(after, equals: _lastChild));
|
||||||
final ParentDataType afterParentData = after.parentData;
|
final ParentDataType afterParentData = after.parentData as ParentDataType;
|
||||||
if (afterParentData.nextSibling == null) {
|
if (afterParentData.nextSibling == null) {
|
||||||
// insert at the end (_lastChild); we'll end up with two or more children
|
// insert at the end (_lastChild); we'll end up with two or more children
|
||||||
assert(after == _lastChild);
|
assert(after == _lastChild);
|
||||||
@ -3100,8 +3100,8 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
childParentData.nextSibling = afterParentData.nextSibling;
|
childParentData.nextSibling = afterParentData.nextSibling;
|
||||||
childParentData.previousSibling = after;
|
childParentData.previousSibling = after;
|
||||||
// set up links from siblings to child
|
// set up links from siblings to child
|
||||||
final ParentDataType childPreviousSiblingParentData = childParentData.previousSibling.parentData;
|
final ParentDataType childPreviousSiblingParentData = childParentData.previousSibling.parentData as ParentDataType;
|
||||||
final ParentDataType childNextSiblingParentData = childParentData.nextSibling.parentData;
|
final ParentDataType childNextSiblingParentData = childParentData.nextSibling.parentData as ParentDataType;
|
||||||
childPreviousSiblingParentData.nextSibling = child;
|
childPreviousSiblingParentData.nextSibling = child;
|
||||||
childNextSiblingParentData.previousSibling = child;
|
childNextSiblingParentData.previousSibling = child;
|
||||||
assert(afterParentData.nextSibling == child);
|
assert(afterParentData.nextSibling == child);
|
||||||
@ -3133,7 +3133,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _removeFromChildList(ChildType child) {
|
void _removeFromChildList(ChildType child) {
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
assert(_debugUltimatePreviousSiblingOf(child, equals: _firstChild));
|
assert(_debugUltimatePreviousSiblingOf(child, equals: _firstChild));
|
||||||
assert(_debugUltimateNextSiblingOf(child, equals: _lastChild));
|
assert(_debugUltimateNextSiblingOf(child, equals: _lastChild));
|
||||||
assert(_childCount >= 0);
|
assert(_childCount >= 0);
|
||||||
@ -3141,14 +3141,14 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
assert(_firstChild == child);
|
assert(_firstChild == child);
|
||||||
_firstChild = childParentData.nextSibling;
|
_firstChild = childParentData.nextSibling;
|
||||||
} else {
|
} else {
|
||||||
final ParentDataType childPreviousSiblingParentData = childParentData.previousSibling.parentData;
|
final ParentDataType childPreviousSiblingParentData = childParentData.previousSibling.parentData as ParentDataType;
|
||||||
childPreviousSiblingParentData.nextSibling = childParentData.nextSibling;
|
childPreviousSiblingParentData.nextSibling = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
if (childParentData.nextSibling == null) {
|
if (childParentData.nextSibling == null) {
|
||||||
assert(_lastChild == child);
|
assert(_lastChild == child);
|
||||||
_lastChild = childParentData.previousSibling;
|
_lastChild = childParentData.previousSibling;
|
||||||
} else {
|
} else {
|
||||||
final ParentDataType childNextSiblingParentData = childParentData.nextSibling.parentData;
|
final ParentDataType childNextSiblingParentData = childParentData.nextSibling.parentData as ParentDataType;
|
||||||
childNextSiblingParentData.previousSibling = childParentData.previousSibling;
|
childNextSiblingParentData.previousSibling = childParentData.previousSibling;
|
||||||
}
|
}
|
||||||
childParentData.previousSibling = null;
|
childParentData.previousSibling = null;
|
||||||
@ -3170,7 +3170,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
void removeAll() {
|
void removeAll() {
|
||||||
ChildType child = _firstChild;
|
ChildType child = _firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
final ChildType next = childParentData.nextSibling;
|
final ChildType next = childParentData.nextSibling;
|
||||||
childParentData.previousSibling = null;
|
childParentData.previousSibling = null;
|
||||||
childParentData.nextSibling = null;
|
childParentData.nextSibling = null;
|
||||||
@ -3192,7 +3192,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
assert(after != this);
|
assert(after != this);
|
||||||
assert(child != after);
|
assert(child != after);
|
||||||
assert(child.parent == this);
|
assert(child.parent == this);
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
if (childParentData.previousSibling == after)
|
if (childParentData.previousSibling == after)
|
||||||
return;
|
return;
|
||||||
_removeFromChildList(child);
|
_removeFromChildList(child);
|
||||||
@ -3206,7 +3206,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
ChildType child = _firstChild;
|
ChildType child = _firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
child.attach(owner);
|
child.attach(owner);
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3217,7 +3217,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
ChildType child = _firstChild;
|
ChildType child = _firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
child.detach();
|
child.detach();
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3227,7 +3227,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
ChildType child = _firstChild;
|
ChildType child = _firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
redepthChild(child);
|
redepthChild(child);
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3237,7 +3237,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
ChildType child = _firstChild;
|
ChildType child = _firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
visitor(child);
|
visitor(child);
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3252,7 +3252,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
ChildType childBefore(ChildType child) {
|
ChildType childBefore(ChildType child) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
assert(child.parent == this);
|
assert(child.parent == this);
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
return childParentData.previousSibling;
|
return childParentData.previousSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3260,7 +3260,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
ChildType childAfter(ChildType child) {
|
ChildType childAfter(ChildType child) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
assert(child.parent == this);
|
assert(child.parent == this);
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
return childParentData.nextSibling;
|
return childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3275,7 +3275,7 @@ mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType
|
|||||||
if (child == lastChild)
|
if (child == lastChild)
|
||||||
break;
|
break;
|
||||||
count += 1;
|
count += 1;
|
||||||
final ParentDataType childParentData = child.parentData;
|
final ParentDataType childParentData = child.parentData as ParentDataType;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3305,7 +3305,7 @@ mixin RelayoutWhenSystemFontsChangeMixin on RenderObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void attach(covariant Object owner) {
|
void attach(covariant PipelineOwner owner) {
|
||||||
super.attach(owner);
|
super.attach(owner);
|
||||||
PaintingBinding.instance.systemFonts.addListener(systemFontsDidChange);
|
PaintingBinding.instance.systemFonts.addListener(systemFontsDidChange);
|
||||||
}
|
}
|
||||||
@ -3834,12 +3834,12 @@ class _SemanticsGeometry {
|
|||||||
assert(transform != null);
|
assert(transform != null);
|
||||||
assert(clipRectTransform != null);
|
assert(clipRectTransform != null);
|
||||||
assert(clipRectTransform.isIdentity());
|
assert(clipRectTransform.isIdentity());
|
||||||
RenderObject intermediateParent = child.parent;
|
RenderObject intermediateParent = child.parent as RenderObject;
|
||||||
assert(intermediateParent != null);
|
assert(intermediateParent != null);
|
||||||
while (intermediateParent != ancestor) {
|
while (intermediateParent != ancestor) {
|
||||||
intermediateParent.applyPaintTransform(child, transform);
|
intermediateParent.applyPaintTransform(child, transform);
|
||||||
intermediateParent = intermediateParent.parent;
|
intermediateParent = intermediateParent.parent as RenderObject;
|
||||||
child = child.parent;
|
child = child.parent as RenderObject;
|
||||||
assert(intermediateParent != null);
|
assert(intermediateParent != null);
|
||||||
}
|
}
|
||||||
ancestor.applyPaintTransform(child, transform);
|
ancestor.applyPaintTransform(child, transform);
|
||||||
|
@ -414,7 +414,7 @@ class RenderParagraph extends RenderBox
|
|||||||
bool hitTestChildren(BoxHitTestResult result, { Offset position }) {
|
bool hitTestChildren(BoxHitTestResult result, { Offset position }) {
|
||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final TextParentData textParentData = child.parentData;
|
final TextParentData textParentData = child.parentData as TextParentData;
|
||||||
final Matrix4 transform = Matrix4.translationValues(
|
final Matrix4 transform = Matrix4.translationValues(
|
||||||
textParentData.offset.dx,
|
textParentData.offset.dx,
|
||||||
textParentData.offset.dy,
|
textParentData.offset.dy,
|
||||||
@ -458,7 +458,7 @@ class RenderParagraph extends RenderBox
|
|||||||
}
|
}
|
||||||
if (span is TextSpan) {
|
if (span is TextSpan) {
|
||||||
final TextSpan textSpan = span;
|
final TextSpan textSpan = span;
|
||||||
textSpan.recognizer?.addPointer(event);
|
textSpan.recognizer?.addPointer(event as PointerDownEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,7 +550,7 @@ class RenderParagraph extends RenderBox
|
|||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
int childIndex = 0;
|
int childIndex = 0;
|
||||||
while (child != null && childIndex < _textPainter.inlinePlaceholderBoxes.length) {
|
while (child != null && childIndex < _textPainter.inlinePlaceholderBoxes.length) {
|
||||||
final TextParentData textParentData = child.parentData;
|
final TextParentData textParentData = child.parentData as TextParentData;
|
||||||
textParentData.offset = Offset(
|
textParentData.offset = Offset(
|
||||||
_textPainter.inlinePlaceholderBoxes[childIndex].left,
|
_textPainter.inlinePlaceholderBoxes[childIndex].left,
|
||||||
_textPainter.inlinePlaceholderBoxes[childIndex].top,
|
_textPainter.inlinePlaceholderBoxes[childIndex].top,
|
||||||
@ -681,7 +681,7 @@ class RenderParagraph extends RenderBox
|
|||||||
// it until we finish layout, and RenderObject is in immutable state at
|
// it until we finish layout, and RenderObject is in immutable state at
|
||||||
// this point.
|
// this point.
|
||||||
while (child != null && childIndex < _textPainter.inlinePlaceholderBoxes.length) {
|
while (child != null && childIndex < _textPainter.inlinePlaceholderBoxes.length) {
|
||||||
final TextParentData textParentData = child.parentData;
|
final TextParentData textParentData = child.parentData as TextParentData;
|
||||||
|
|
||||||
final double scale = textParentData.scale;
|
final double scale = textParentData.scale;
|
||||||
context.pushTransform(
|
context.pushTransform(
|
||||||
@ -876,7 +876,7 @@ class RenderParagraph extends RenderBox
|
|||||||
|
|
||||||
if (info.isPlaceholder) {
|
if (info.isPlaceholder) {
|
||||||
final SemanticsNode childNode = children.elementAt(placeholderIndex++);
|
final SemanticsNode childNode = children.elementAt(placeholderIndex++);
|
||||||
final TextParentData parentData = child.parentData;
|
final TextParentData parentData = child.parentData as TextParentData;
|
||||||
childNode.rect = Rect.fromLTWH(
|
childNode.rect = Rect.fromLTWH(
|
||||||
childNode.rect.left,
|
childNode.rect.left,
|
||||||
childNode.rect.top,
|
childNode.rect.top,
|
||||||
@ -890,13 +890,12 @@ class RenderParagraph extends RenderBox
|
|||||||
..sortKey = OrdinalSortKey(ordinal++)
|
..sortKey = OrdinalSortKey(ordinal++)
|
||||||
..textDirection = initialDirection
|
..textDirection = initialDirection
|
||||||
..label = info.semanticsLabel ?? info.text;
|
..label = info.semanticsLabel ?? info.text;
|
||||||
if (info.recognizer != null) {
|
final GestureRecognizer recognizer = info.recognizer;
|
||||||
if (info.recognizer is TapGestureRecognizer) {
|
if (recognizer != null) {
|
||||||
final TapGestureRecognizer recognizer = info.recognizer;
|
if (recognizer is TapGestureRecognizer) {
|
||||||
configuration.onTap = recognizer.onTap;
|
configuration.onTap = recognizer.onTap;
|
||||||
configuration.isLink = true;
|
configuration.isLink = true;
|
||||||
} else if (info.recognizer is LongPressGestureRecognizer) {
|
} else if (recognizer is LongPressGestureRecognizer) {
|
||||||
final LongPressGestureRecognizer recognizer = info.recognizer;
|
|
||||||
configuration.onLongPress = recognizer.onLongPress;
|
configuration.onLongPress = recognizer.onLongPress;
|
||||||
} else {
|
} else {
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@ -341,7 +341,7 @@ class RenderUiKitView extends RenderBox {
|
|||||||
if (event is! PointerDownEvent) {
|
if (event is! PointerDownEvent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_gestureRecognizer.addPointer(event);
|
_gestureRecognizer.addPointer(event as PointerDownEvent);
|
||||||
_lastPointerDownEvent = event.original ?? event;
|
_lastPointerDownEvent = event.original ?? event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -800,7 +800,7 @@ class RenderOpacity extends RenderProxyBox {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert(needsCompositing);
|
assert(needsCompositing);
|
||||||
layer = context.pushOpacity(offset, _alpha, super.paint, oldLayer: layer);
|
layer = context.pushOpacity(offset, _alpha, super.paint, oldLayer: layer as OpacityLayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -920,7 +920,7 @@ class RenderAnimatedOpacity extends RenderProxyBox {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert(needsCompositing);
|
assert(needsCompositing);
|
||||||
layer = context.pushOpacity(offset, _alpha, super.paint, oldLayer: layer);
|
layer = context.pushOpacity(offset, _alpha, super.paint, oldLayer: layer as OpacityLayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -962,7 +962,7 @@ class RenderShaderMask extends RenderProxyBox {
|
|||||||
super(child);
|
super(child);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ShaderMaskLayer get layer => super.layer;
|
ShaderMaskLayer get layer => super.layer as ShaderMaskLayer;
|
||||||
|
|
||||||
/// Called to creates the [Shader] that generates the mask.
|
/// Called to creates the [Shader] that generates the mask.
|
||||||
///
|
///
|
||||||
@ -1030,7 +1030,7 @@ class RenderBackdropFilter extends RenderProxyBox {
|
|||||||
super(child);
|
super(child);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
BackdropFilterLayer get layer => super.layer;
|
BackdropFilterLayer get layer => super.layer as BackdropFilterLayer;
|
||||||
|
|
||||||
/// The image filter to apply to the existing painted content before painting
|
/// The image filter to apply to the existing painted content before painting
|
||||||
/// the child.
|
/// the child.
|
||||||
@ -1163,7 +1163,7 @@ class ShapeBorderClipper extends CustomClipper<Path> {
|
|||||||
bool shouldReclip(CustomClipper<Path> oldClipper) {
|
bool shouldReclip(CustomClipper<Path> oldClipper) {
|
||||||
if (oldClipper.runtimeType != ShapeBorderClipper)
|
if (oldClipper.runtimeType != ShapeBorderClipper)
|
||||||
return true;
|
return true;
|
||||||
final ShapeBorderClipper typedOldClipper = oldClipper;
|
final ShapeBorderClipper typedOldClipper = oldClipper as ShapeBorderClipper;
|
||||||
return typedOldClipper.shape != shape
|
return typedOldClipper.shape != shape
|
||||||
|| typedOldClipper.textDirection != textDirection;
|
|| typedOldClipper.textDirection != textDirection;
|
||||||
}
|
}
|
||||||
@ -1315,7 +1315,14 @@ class RenderClipRect extends _RenderCustomClip<Rect> {
|
|||||||
void paint(PaintingContext context, Offset offset) {
|
void paint(PaintingContext context, Offset offset) {
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
_updateClip();
|
_updateClip();
|
||||||
layer = context.pushClipRect(needsCompositing, offset, _clip, super.paint, clipBehavior: clipBehavior, oldLayer: layer);
|
layer = context.pushClipRect(
|
||||||
|
needsCompositing,
|
||||||
|
offset,
|
||||||
|
_clip,
|
||||||
|
super.paint,
|
||||||
|
clipBehavior: clipBehavior,
|
||||||
|
oldLayer: layer as ClipRectLayer,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
layer = null;
|
layer = null;
|
||||||
}
|
}
|
||||||
@ -1394,7 +1401,13 @@ class RenderClipRRect extends _RenderCustomClip<RRect> {
|
|||||||
void paint(PaintingContext context, Offset offset) {
|
void paint(PaintingContext context, Offset offset) {
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
_updateClip();
|
_updateClip();
|
||||||
layer = context.pushClipRRect(needsCompositing, offset, _clip.outerRect, _clip, super.paint, clipBehavior: clipBehavior, oldLayer: layer);
|
layer = context.pushClipRRect(
|
||||||
|
needsCompositing,
|
||||||
|
offset,
|
||||||
|
_clip.outerRect,
|
||||||
|
_clip,
|
||||||
|
super.paint, clipBehavior: clipBehavior, oldLayer: layer as ClipRRectLayer,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
layer = null;
|
layer = null;
|
||||||
}
|
}
|
||||||
@ -1465,7 +1478,15 @@ class RenderClipOval extends _RenderCustomClip<Rect> {
|
|||||||
void paint(PaintingContext context, Offset offset) {
|
void paint(PaintingContext context, Offset offset) {
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
_updateClip();
|
_updateClip();
|
||||||
layer = context.pushClipPath(needsCompositing, offset, _clip, _getClipPath(_clip), super.paint, clipBehavior: clipBehavior, oldLayer: layer);
|
layer = context.pushClipPath(
|
||||||
|
needsCompositing,
|
||||||
|
offset,
|
||||||
|
_clip,
|
||||||
|
_getClipPath(_clip),
|
||||||
|
super.paint,
|
||||||
|
clipBehavior: clipBehavior,
|
||||||
|
oldLayer: layer as ClipPathLayer,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
layer = null;
|
layer = null;
|
||||||
}
|
}
|
||||||
@ -1530,7 +1551,15 @@ class RenderClipPath extends _RenderCustomClip<Path> {
|
|||||||
void paint(PaintingContext context, Offset offset) {
|
void paint(PaintingContext context, Offset offset) {
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
_updateClip();
|
_updateClip();
|
||||||
layer = context.pushClipPath(needsCompositing, offset, Offset.zero & size, _clip, super.paint, clipBehavior: clipBehavior, oldLayer: layer);
|
layer = context.pushClipPath(
|
||||||
|
needsCompositing,
|
||||||
|
offset,
|
||||||
|
Offset.zero & size,
|
||||||
|
_clip,
|
||||||
|
super.paint,
|
||||||
|
clipBehavior: clipBehavior,
|
||||||
|
oldLayer: layer as ClipPathLayer,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
layer = null;
|
layer = null;
|
||||||
}
|
}
|
||||||
@ -1667,7 +1696,7 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase<RRect> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
PhysicalModelLayer get layer => super.layer;
|
PhysicalModelLayer get layer => super.layer as PhysicalModelLayer;
|
||||||
|
|
||||||
/// The shape of the layer.
|
/// The shape of the layer.
|
||||||
///
|
///
|
||||||
@ -1809,7 +1838,7 @@ class RenderPhysicalShape extends _RenderPhysicalModelBase<Path> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
PhysicalModelLayer get layer => super.layer;
|
PhysicalModelLayer get layer => super.layer as PhysicalModelLayer;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Path get _defaultClip => Path()..addRect(Offset.zero & size);
|
Path get _defaultClip => Path()..addRect(Offset.zero & size);
|
||||||
@ -2191,7 +2220,13 @@ class RenderTransform extends RenderProxyBox {
|
|||||||
final Matrix4 transform = _effectiveTransform;
|
final Matrix4 transform = _effectiveTransform;
|
||||||
final Offset childOffset = MatrixUtils.getAsTranslation(transform);
|
final Offset childOffset = MatrixUtils.getAsTranslation(transform);
|
||||||
if (childOffset == null) {
|
if (childOffset == null) {
|
||||||
layer = context.pushTransform(needsCompositing, offset, transform, super.paint, oldLayer: layer);
|
layer = context.pushTransform(
|
||||||
|
needsCompositing,
|
||||||
|
offset,
|
||||||
|
transform,
|
||||||
|
super.paint,
|
||||||
|
oldLayer: layer as TransformLayer,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
super.paint(context, offset + childOffset);
|
super.paint(context, offset + childOffset);
|
||||||
layer = null;
|
layer = null;
|
||||||
@ -2209,7 +2244,7 @@ class RenderTransform extends RenderProxyBox {
|
|||||||
super.debugFillProperties(properties);
|
super.debugFillProperties(properties);
|
||||||
properties.add(TransformProperty('transform matrix', _transform));
|
properties.add(TransformProperty('transform matrix', _transform));
|
||||||
properties.add(DiagnosticsProperty<Offset>('origin', origin));
|
properties.add(DiagnosticsProperty<Offset>('origin', origin));
|
||||||
properties.add(DiagnosticsProperty<Alignment>('alignment', alignment));
|
properties.add(DiagnosticsProperty<AlignmentGeometry>('alignment', alignment));
|
||||||
properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
|
properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
|
||||||
properties.add(DiagnosticsProperty<bool>('transformHitTests', transformHitTests));
|
properties.add(DiagnosticsProperty<bool>('transformHitTests', transformHitTests));
|
||||||
}
|
}
|
||||||
@ -2339,7 +2374,7 @@ class RenderFittedBox extends RenderProxyBox {
|
|||||||
final Offset childOffset = MatrixUtils.getAsTranslation(_transform);
|
final Offset childOffset = MatrixUtils.getAsTranslation(_transform);
|
||||||
if (childOffset == null)
|
if (childOffset == null)
|
||||||
return context.pushTransform(needsCompositing, offset, _transform, super.paint,
|
return context.pushTransform(needsCompositing, offset, _transform, super.paint,
|
||||||
oldLayer: layer is TransformLayer ? layer : null);
|
oldLayer: layer is TransformLayer ? layer as TransformLayer : null);
|
||||||
else
|
else
|
||||||
super.paint(context, offset + childOffset);
|
super.paint(context, offset + childOffset);
|
||||||
return null;
|
return null;
|
||||||
@ -2353,7 +2388,7 @@ class RenderFittedBox extends RenderProxyBox {
|
|||||||
if (child != null) {
|
if (child != null) {
|
||||||
if (_hasVisualOverflow)
|
if (_hasVisualOverflow)
|
||||||
layer = context.pushClipRect(needsCompositing, offset, Offset.zero & size, _paintChildWithTransform,
|
layer = context.pushClipRect(needsCompositing, offset, Offset.zero & size, _paintChildWithTransform,
|
||||||
oldLayer: layer is ClipRectLayer ? layer : null);
|
oldLayer: layer is ClipRectLayer ? layer as ClipRectLayer : null);
|
||||||
else
|
else
|
||||||
layer = _paintChildWithTransform(context, offset);
|
layer = _paintChildWithTransform(context, offset);
|
||||||
}
|
}
|
||||||
@ -2387,7 +2422,7 @@ class RenderFittedBox extends RenderProxyBox {
|
|||||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||||
super.debugFillProperties(properties);
|
super.debugFillProperties(properties);
|
||||||
properties.add(EnumProperty<BoxFit>('fit', fit));
|
properties.add(EnumProperty<BoxFit>('fit', fit));
|
||||||
properties.add(DiagnosticsProperty<Alignment>('alignment', alignment));
|
properties.add(DiagnosticsProperty<AlignmentGeometry>('alignment', alignment));
|
||||||
properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
|
properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2906,7 +2941,7 @@ class RenderRepaintBoundary extends RenderProxyBox {
|
|||||||
/// * [dart:ui.Scene.toImage] for more information about the image returned.
|
/// * [dart:ui.Scene.toImage] for more information about the image returned.
|
||||||
Future<ui.Image> toImage({ double pixelRatio = 1.0 }) {
|
Future<ui.Image> toImage({ double pixelRatio = 1.0 }) {
|
||||||
assert(!debugNeedsPaint);
|
assert(!debugNeedsPaint);
|
||||||
final OffsetLayer offsetLayer = layer;
|
final OffsetLayer offsetLayer = layer as OffsetLayer;
|
||||||
return offsetLayer.toImage(Offset.zero & size, pixelRatio: pixelRatio);
|
return offsetLayer.toImage(Offset.zero & size, pixelRatio: pixelRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4794,7 +4829,7 @@ class RenderLeaderLayer extends RenderProxyBox {
|
|||||||
if (layer == null) {
|
if (layer == null) {
|
||||||
layer = LeaderLayer(link: link, offset: offset);
|
layer = LeaderLayer(link: link, offset: offset);
|
||||||
} else {
|
} else {
|
||||||
final LeaderLayer leaderLayer = layer;
|
final LeaderLayer leaderLayer = layer as LeaderLayer;
|
||||||
leaderLayer
|
leaderLayer
|
||||||
..link = link
|
..link = link
|
||||||
..offset = offset;
|
..offset = offset;
|
||||||
@ -4895,7 +4930,7 @@ class RenderFollowerLayer extends RenderProxyBox {
|
|||||||
|
|
||||||
/// The layer we created when we were last painted.
|
/// The layer we created when we were last painted.
|
||||||
@override
|
@override
|
||||||
FollowerLayer get layer => super.layer;
|
FollowerLayer get layer => super.layer as FollowerLayer;
|
||||||
|
|
||||||
/// Return the transform that was used in the last composition phase, if any.
|
/// Return the transform that was used in the last composition phase, if any.
|
||||||
///
|
///
|
||||||
|
@ -54,7 +54,7 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi
|
|||||||
if (child != null) {
|
if (child != null) {
|
||||||
assert(!debugNeedsLayout);
|
assert(!debugNeedsLayout);
|
||||||
result = child.getDistanceToActualBaseline(baseline);
|
result = child.getDistanceToActualBaseline(baseline);
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
if (result != null)
|
if (result != null)
|
||||||
result += childParentData.offset.dy;
|
result += childParentData.offset.dy;
|
||||||
} else {
|
} else {
|
||||||
@ -66,7 +66,7 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi
|
|||||||
@override
|
@override
|
||||||
void paint(PaintingContext context, Offset offset) {
|
void paint(PaintingContext context, Offset offset) {
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
context.paintChild(child, childParentData.offset + offset);
|
context.paintChild(child, childParentData.offset + offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi
|
|||||||
@override
|
@override
|
||||||
bool hitTestChildren(BoxHitTestResult result, { Offset position }) {
|
bool hitTestChildren(BoxHitTestResult result, { Offset position }) {
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
return result.addWithPaintOffset(
|
return result.addWithPaintOffset(
|
||||||
offset: childParentData.offset,
|
offset: childParentData.offset,
|
||||||
position: position,
|
position: position,
|
||||||
@ -204,7 +204,7 @@ class RenderPadding extends RenderShiftedBox {
|
|||||||
}
|
}
|
||||||
final BoxConstraints innerConstraints = constraints.deflate(_resolvedPadding);
|
final BoxConstraints innerConstraints = constraints.deflate(_resolvedPadding);
|
||||||
child.layout(innerConstraints, parentUsesSize: true);
|
child.layout(innerConstraints, parentUsesSize: true);
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
childParentData.offset = Offset(_resolvedPadding.left, _resolvedPadding.top);
|
childParentData.offset = Offset(_resolvedPadding.left, _resolvedPadding.top);
|
||||||
size = constraints.constrain(Size(
|
size = constraints.constrain(Size(
|
||||||
_resolvedPadding.left + child.size.width + _resolvedPadding.right,
|
_resolvedPadding.left + child.size.width + _resolvedPadding.right,
|
||||||
@ -321,8 +321,8 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
|
|||||||
assert(child.hasSize);
|
assert(child.hasSize);
|
||||||
assert(hasSize);
|
assert(hasSize);
|
||||||
assert(_resolvedAlignment != null);
|
assert(_resolvedAlignment != null);
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
childParentData.offset = _resolvedAlignment.alongOffset(size - child.size);
|
childParentData.offset = _resolvedAlignment.alongOffset(size - child.size as Offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -411,7 +411,7 @@ class RenderPositionedBox extends RenderAligningShiftedBox {
|
|||||||
..strokeWidth = 1.0
|
..strokeWidth = 1.0
|
||||||
..color = const Color(0xFFFFFF00);
|
..color = const Color(0xFFFFFF00);
|
||||||
path = Path();
|
path = Path();
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
if (childParentData.offset.dy > 0.0) {
|
if (childParentData.offset.dy > 0.0) {
|
||||||
// vertical alignment arrows
|
// vertical alignment arrows
|
||||||
final double headSize = math.min(childParentData.offset.dy * 0.2, 10.0);
|
final double headSize = math.min(childParentData.offset.dy * 0.2, 10.0);
|
||||||
@ -668,7 +668,7 @@ class RenderUnconstrainedBox extends RenderAligningShiftedBox with DebugOverflow
|
|||||||
child.layout(childConstraints, parentUsesSize: true);
|
child.layout(childConstraints, parentUsesSize: true);
|
||||||
size = constraints.constrain(child.size);
|
size = constraints.constrain(child.size);
|
||||||
alignChild();
|
alignChild();
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
_overflowContainerRect = Offset.zero & size;
|
_overflowContainerRect = Offset.zero & size;
|
||||||
_overflowChildRect = childParentData.offset & child.size;
|
_overflowChildRect = childParentData.offset & child.size;
|
||||||
} else {
|
} else {
|
||||||
@ -1121,7 +1121,7 @@ class RenderCustomSingleChildLayoutBox extends RenderShiftedBox {
|
|||||||
final BoxConstraints childConstraints = delegate.getConstraintsForChild(constraints);
|
final BoxConstraints childConstraints = delegate.getConstraintsForChild(constraints);
|
||||||
assert(childConstraints.debugAssertIsValid(isAppliedConstraint: true));
|
assert(childConstraints.debugAssertIsValid(isAppliedConstraint: true));
|
||||||
child.layout(childConstraints, parentUsesSize: !childConstraints.isTight);
|
child.layout(childConstraints, parentUsesSize: !childConstraints.isTight);
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
childParentData.offset = delegate.getPositionForChild(size, childConstraints.isTight ? childConstraints.smallest : child.size);
|
childParentData.offset = delegate.getPositionForChild(size, childConstraints.isTight ? childConstraints.smallest : child.size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1187,7 +1187,7 @@ class RenderBaseline extends RenderShiftedBox {
|
|||||||
final double childBaseline = child.getDistanceToBaseline(baselineType);
|
final double childBaseline = child.getDistanceToBaseline(baselineType);
|
||||||
final double actualBaseline = baseline;
|
final double actualBaseline = baseline;
|
||||||
final double top = actualBaseline - childBaseline;
|
final double top = actualBaseline - childBaseline;
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
childParentData.offset = Offset(0.0, top);
|
childParentData.offset = Offset(0.0, top);
|
||||||
final Size childSize = child.size;
|
final Size childSize = child.size;
|
||||||
size = constraints.constrain(Size(childSize.width, top + childSize.height));
|
size = constraints.constrain(Size(childSize.width, top + childSize.height));
|
||||||
|
@ -12,6 +12,7 @@ import 'package:vector_math/vector_math_64.dart';
|
|||||||
import 'binding.dart';
|
import 'binding.dart';
|
||||||
import 'box.dart';
|
import 'box.dart';
|
||||||
import 'debug.dart';
|
import 'debug.dart';
|
||||||
|
import 'layer.dart';
|
||||||
import 'object.dart';
|
import 'object.dart';
|
||||||
import 'viewport.dart';
|
import 'viewport.dart';
|
||||||
import 'viewport_offset.dart';
|
import 'viewport_offset.dart';
|
||||||
@ -452,18 +453,18 @@ class SliverConstraints extends Constraints {
|
|||||||
return true;
|
return true;
|
||||||
if (other is! SliverConstraints)
|
if (other is! SliverConstraints)
|
||||||
return false;
|
return false;
|
||||||
final SliverConstraints typedOther = other;
|
assert(other is SliverConstraints && other.debugAssertIsValid());
|
||||||
assert(typedOther.debugAssertIsValid());
|
return other is SliverConstraints
|
||||||
return typedOther.axisDirection == axisDirection
|
&& other.axisDirection == axisDirection
|
||||||
&& typedOther.growthDirection == growthDirection
|
&& other.growthDirection == growthDirection
|
||||||
&& typedOther.scrollOffset == scrollOffset
|
&& other.scrollOffset == scrollOffset
|
||||||
&& typedOther.overlap == overlap
|
&& other.overlap == overlap
|
||||||
&& typedOther.remainingPaintExtent == remainingPaintExtent
|
&& other.remainingPaintExtent == remainingPaintExtent
|
||||||
&& typedOther.crossAxisExtent == crossAxisExtent
|
&& other.crossAxisExtent == crossAxisExtent
|
||||||
&& typedOther.crossAxisDirection == crossAxisDirection
|
&& other.crossAxisDirection == crossAxisDirection
|
||||||
&& typedOther.viewportMainAxisExtent == viewportMainAxisExtent
|
&& other.viewportMainAxisExtent == viewportMainAxisExtent
|
||||||
&& typedOther.remainingCacheExtent == remainingCacheExtent
|
&& other.remainingCacheExtent == remainingCacheExtent
|
||||||
&& typedOther.cacheOrigin == cacheOrigin;
|
&& other.cacheOrigin == cacheOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -870,7 +871,7 @@ class SliverHitTestEntry extends HitTestEntry {
|
|||||||
super(target);
|
super(target);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
RenderSliver get target => super.target;
|
RenderSliver get target => super.target as RenderSliver;
|
||||||
|
|
||||||
/// The distance in the [AxisDirection] from the edge of the sliver's painted
|
/// The distance in the [AxisDirection] from the edge of the sliver's painted
|
||||||
/// area (as given by the [SliverConstraints.scrollOffset]) to the hit point.
|
/// area (as given by the [SliverConstraints.scrollOffset]) to the hit point.
|
||||||
@ -1110,7 +1111,7 @@ List<DiagnosticsNode> _debugCompareFloats(String labelA, double valueA, String l
|
|||||||
abstract class RenderSliver extends RenderObject {
|
abstract class RenderSliver extends RenderObject {
|
||||||
// layout input
|
// layout input
|
||||||
@override
|
@override
|
||||||
SliverConstraints get constraints => super.constraints;
|
SliverConstraints get constraints => super.constraints as SliverConstraints;
|
||||||
|
|
||||||
/// The amount of space this sliver occupies.
|
/// The amount of space this sliver occupies.
|
||||||
///
|
///
|
||||||
@ -1327,7 +1328,7 @@ abstract class RenderSliver extends RenderObject {
|
|||||||
final double a = constraints.scrollOffset;
|
final double a = constraints.scrollOffset;
|
||||||
final double b = constraints.scrollOffset + constraints.remainingPaintExtent;
|
final double b = constraints.scrollOffset + constraints.remainingPaintExtent;
|
||||||
// the clamp on the next line is to avoid floating point rounding errors
|
// the clamp on the next line is to avoid floating point rounding errors
|
||||||
return (to.clamp(a, b) - from.clamp(a, b)).clamp(0.0, constraints.remainingPaintExtent);
|
return (to.clamp(a, b) - from.clamp(a, b)).clamp(0.0, constraints.remainingPaintExtent) as double;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the portion of the region from `from` to `to` that is within
|
/// Computes the portion of the region from `from` to `to` that is within
|
||||||
@ -1343,7 +1344,7 @@ abstract class RenderSliver extends RenderObject {
|
|||||||
final double a = constraints.scrollOffset + constraints.cacheOrigin;
|
final double a = constraints.scrollOffset + constraints.cacheOrigin;
|
||||||
final double b = constraints.scrollOffset + constraints.remainingCacheExtent;
|
final double b = constraints.scrollOffset + constraints.remainingCacheExtent;
|
||||||
// the clamp on the next line is to avoid floating point rounding errors
|
// the clamp on the next line is to avoid floating point rounding errors
|
||||||
return (to.clamp(a, b) - from.clamp(a, b)).clamp(0.0, constraints.remainingCacheExtent);
|
return (to.clamp(a, b) - from.clamp(a, b)).clamp(0.0, constraints.remainingCacheExtent) as double;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the distance from the leading _visible_ edge of the sliver to the
|
/// Returns the distance from the leading _visible_ edge of the sliver to the
|
||||||
@ -1719,7 +1720,7 @@ abstract class RenderSliverSingleBoxAdapter extends RenderSliver with RenderObje
|
|||||||
/// [SliverConstraints.growthDirection] and the given geometry.
|
/// [SliverConstraints.growthDirection] and the given geometry.
|
||||||
@protected
|
@protected
|
||||||
void setChildParentData(RenderObject child, SliverConstraints constraints, SliverGeometry geometry) {
|
void setChildParentData(RenderObject child, SliverConstraints constraints, SliverGeometry geometry) {
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
assert(constraints.axisDirection != null);
|
assert(constraints.axisDirection != null);
|
||||||
assert(constraints.growthDirection != null);
|
assert(constraints.growthDirection != null);
|
||||||
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
|
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
|
||||||
@ -1756,14 +1757,14 @@ abstract class RenderSliverSingleBoxAdapter extends RenderSliver with RenderObje
|
|||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
assert(child == this.child);
|
assert(child == this.child);
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
childParentData.applyPaintTransform(transform);
|
childParentData.applyPaintTransform(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(PaintingContext context, Offset offset) {
|
void paint(PaintingContext context, Offset offset) {
|
||||||
if (child != null && geometry.visible) {
|
if (child != null && geometry.visible) {
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
context.paintChild(child, offset + childParentData.paintOffset);
|
context.paintChild(child, offset + childParentData.paintOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1945,7 +1946,7 @@ class RenderSliverOpacity extends RenderSliver with RenderObjectWithChildMixin<R
|
|||||||
offset,
|
offset,
|
||||||
_alpha,
|
_alpha,
|
||||||
_paintWithOpacity,
|
_paintWithOpacity,
|
||||||
oldLayer: layer,
|
oldLayer: layer as OpacityLayer,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1953,7 +1954,7 @@ class RenderSliverOpacity extends RenderSliver with RenderObjectWithChildMixin<R
|
|||||||
@override
|
@override
|
||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
childParentData.applyPaintTransform(transform);
|
childParentData.applyPaintTransform(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2067,7 +2068,7 @@ class RenderSliverIgnorePointer extends RenderSliver with RenderObjectWithChildM
|
|||||||
@override
|
@override
|
||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
childParentData.applyPaintTransform(transform);
|
childParentData.applyPaintTransform(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2174,7 +2175,7 @@ class RenderSliverOffstage extends RenderSliver with RenderObjectWithChildMixin<
|
|||||||
@override
|
@override
|
||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
childParentData.applyPaintTransform(transform);
|
childParentData.applyPaintTransform(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
|
|||||||
geometry = SliverGeometry(scrollOffsetCorrection: index * itemExtent);
|
geometry = SliverGeometry(scrollOffsetCorrection: index * itemExtent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
childParentData.layoutOffset = indexToLayoutOffset(itemExtent, index);
|
childParentData.layoutOffset = indexToLayoutOffset(itemExtent, index);
|
||||||
assert(childParentData.index == index);
|
assert(childParentData.index == index);
|
||||||
trailingChildWithLayout ??= child;
|
trailingChildWithLayout ??= child;
|
||||||
@ -243,7 +243,7 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
|
|||||||
|
|
||||||
if (trailingChildWithLayout == null) {
|
if (trailingChildWithLayout == null) {
|
||||||
firstChild.layout(childConstraints);
|
firstChild.layout(childConstraints);
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = firstChild.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = firstChild.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
childParentData.layoutOffset = indexToLayoutOffset(itemExtent, firstIndex);
|
childParentData.layoutOffset = indexToLayoutOffset(itemExtent, firstIndex);
|
||||||
trailingChildWithLayout = firstChild;
|
trailingChildWithLayout = firstChild;
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ abstract class RenderSliverFixedExtentBoxAdaptor extends RenderSliverMultiBoxAda
|
|||||||
}
|
}
|
||||||
trailingChildWithLayout = child;
|
trailingChildWithLayout = child;
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
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);
|
||||||
}
|
}
|
||||||
|
@ -504,7 +504,7 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
double childCrossAxisPosition(RenderBox child) {
|
double childCrossAxisPosition(RenderBox child) {
|
||||||
final SliverGridParentData childParentData = child.parentData;
|
final SliverGridParentData childParentData = child.parentData as SliverGridParentData;
|
||||||
return childParentData.crossAxisOffset;
|
return childParentData.crossAxisOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,8 +528,10 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
|
|||||||
if (firstChild != null) {
|
if (firstChild != null) {
|
||||||
final int oldFirstIndex = indexOf(firstChild);
|
final int oldFirstIndex = indexOf(firstChild);
|
||||||
final int oldLastIndex = indexOf(lastChild);
|
final int oldLastIndex = indexOf(lastChild);
|
||||||
final int leadingGarbage = (firstIndex - oldFirstIndex).clamp(0, childCount);
|
final int leadingGarbage = (firstIndex - oldFirstIndex).clamp(0, childCount) as int;
|
||||||
final int trailingGarbage = targetLastIndex == null ? 0 : (oldLastIndex - targetLastIndex).clamp(0, childCount);
|
final int trailingGarbage = targetLastIndex == null
|
||||||
|
? 0
|
||||||
|
: ((oldLastIndex - targetLastIndex).clamp(0, childCount) as int);
|
||||||
collectGarbage(leadingGarbage, trailingGarbage);
|
collectGarbage(leadingGarbage, trailingGarbage);
|
||||||
} else {
|
} else {
|
||||||
collectGarbage(0, 0);
|
collectGarbage(0, 0);
|
||||||
@ -559,7 +561,7 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
|
|||||||
final RenderBox child = insertAndLayoutLeadingChild(
|
final RenderBox child = insertAndLayoutLeadingChild(
|
||||||
gridGeometry.getBoxConstraints(constraints),
|
gridGeometry.getBoxConstraints(constraints),
|
||||||
);
|
);
|
||||||
final SliverGridParentData childParentData = child.parentData;
|
final SliverGridParentData childParentData = child.parentData as SliverGridParentData;
|
||||||
childParentData.layoutOffset = gridGeometry.scrollOffset;
|
childParentData.layoutOffset = gridGeometry.scrollOffset;
|
||||||
childParentData.crossAxisOffset = gridGeometry.crossAxisOffset;
|
childParentData.crossAxisOffset = gridGeometry.crossAxisOffset;
|
||||||
assert(childParentData.index == index);
|
assert(childParentData.index == index);
|
||||||
@ -569,7 +571,7 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
|
|||||||
|
|
||||||
if (trailingChildWithLayout == null) {
|
if (trailingChildWithLayout == null) {
|
||||||
firstChild.layout(firstChildGridGeometry.getBoxConstraints(constraints));
|
firstChild.layout(firstChildGridGeometry.getBoxConstraints(constraints));
|
||||||
final SliverGridParentData childParentData = firstChild.parentData;
|
final SliverGridParentData childParentData = firstChild.parentData as SliverGridParentData;
|
||||||
childParentData.layoutOffset = firstChildGridGeometry.scrollOffset;
|
childParentData.layoutOffset = firstChildGridGeometry.scrollOffset;
|
||||||
childParentData.crossAxisOffset = firstChildGridGeometry.crossAxisOffset;
|
childParentData.crossAxisOffset = firstChildGridGeometry.crossAxisOffset;
|
||||||
trailingChildWithLayout = firstChild;
|
trailingChildWithLayout = firstChild;
|
||||||
@ -590,7 +592,7 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
|
|||||||
}
|
}
|
||||||
trailingChildWithLayout = child;
|
trailingChildWithLayout = child;
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final SliverGridParentData childParentData = child.parentData;
|
final SliverGridParentData childParentData = child.parentData as SliverGridParentData;
|
||||||
childParentData.layoutOffset = gridGeometry.scrollOffset;
|
childParentData.layoutOffset = gridGeometry.scrollOffset;
|
||||||
childParentData.crossAxisOffset = gridGeometry.crossAxisOffset;
|
childParentData.crossAxisOffset = gridGeometry.crossAxisOffset;
|
||||||
assert(childParentData.index == index);
|
assert(childParentData.index == index);
|
||||||
|
@ -99,7 +99,7 @@ class RenderSliverList extends RenderSliverMultiBoxAdaptor {
|
|||||||
earliestUsefulChild = insertAndLayoutLeadingChild(childConstraints, parentUsesSize: true);
|
earliestUsefulChild = insertAndLayoutLeadingChild(childConstraints, parentUsesSize: true);
|
||||||
|
|
||||||
if (earliestUsefulChild == null) {
|
if (earliestUsefulChild == null) {
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = firstChild.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = firstChild.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
childParentData.layoutOffset = 0.0;
|
childParentData.layoutOffset = 0.0;
|
||||||
|
|
||||||
if (scrollOffset == 0.0) {
|
if (scrollOffset == 0.0) {
|
||||||
@ -142,12 +142,12 @@ class RenderSliverList extends RenderSliverMultiBoxAdaptor {
|
|||||||
geometry = SliverGeometry(
|
geometry = SliverGeometry(
|
||||||
scrollOffsetCorrection: correction - earliestScrollOffset,
|
scrollOffsetCorrection: correction - earliestScrollOffset,
|
||||||
);
|
);
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = firstChild.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = firstChild.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
childParentData.layoutOffset = 0.0;
|
childParentData.layoutOffset = 0.0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = earliestUsefulChild.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = earliestUsefulChild.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
childParentData.layoutOffset = firstChildScrollOffset;
|
childParentData.layoutOffset = firstChildScrollOffset;
|
||||||
assert(earliestUsefulChild == firstChild);
|
assert(earliestUsefulChild == firstChild);
|
||||||
leadingChildWithLayout = earliestUsefulChild;
|
leadingChildWithLayout = earliestUsefulChild;
|
||||||
@ -207,7 +207,7 @@ class RenderSliverList extends RenderSliverMultiBoxAdaptor {
|
|||||||
trailingChildWithLayout = child;
|
trailingChildWithLayout = child;
|
||||||
}
|
}
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
childParentData.layoutOffset = endScrollOffset;
|
childParentData.layoutOffset = endScrollOffset;
|
||||||
assert(childParentData.index == index);
|
assert(childParentData.index == index);
|
||||||
endScrollOffset = childScrollOffset(child) + paintExtentOf(child);
|
endScrollOffset = childScrollOffset(child) + paintExtentOf(child);
|
||||||
|
@ -243,9 +243,9 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
@override
|
@override
|
||||||
void adoptChild(RenderObject child) {
|
void adoptChild(RenderObject child) {
|
||||||
super.adoptChild(child);
|
super.adoptChild(child);
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
if (!childParentData._keptAlive)
|
if (!childParentData._keptAlive)
|
||||||
childManager.didAdoptChild(child);
|
childManager.didAdoptChild(child as RenderBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _debugAssertChildListLocked() => childManager.debugAssertChildListLocked();
|
bool _debugAssertChildListLocked() => childManager.debugAssertChildListLocked();
|
||||||
@ -285,7 +285,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
// 2. The child is keptAlive.
|
// 2. The child is keptAlive.
|
||||||
// In this case, the child is no longer in the childList but might be stored in
|
// In this case, the child is no longer in the childList but might be stored in
|
||||||
// [_keepAliveBucket]. We need to update the location of the child in the bucket.
|
// [_keepAliveBucket]. We need to update the location of the child in the bucket.
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
if (!childParentData.keptAlive) {
|
if (!childParentData.keptAlive) {
|
||||||
super.move(child, after: after);
|
super.move(child, after: after);
|
||||||
childManager.didAdoptChild(child); // updates the slot in the parentData
|
childManager.didAdoptChild(child); // updates the slot in the parentData
|
||||||
@ -318,7 +318,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void remove(RenderBox child) {
|
void remove(RenderBox child) {
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
if (!childParentData._keptAlive) {
|
if (!childParentData._keptAlive) {
|
||||||
super.remove(child);
|
super.remove(child);
|
||||||
return;
|
return;
|
||||||
@ -344,7 +344,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
assert(constraints == this.constraints);
|
assert(constraints == this.constraints);
|
||||||
if (_keepAliveBucket.containsKey(index)) {
|
if (_keepAliveBucket.containsKey(index)) {
|
||||||
final RenderBox child = _keepAliveBucket.remove(index);
|
final RenderBox child = _keepAliveBucket.remove(index);
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
assert(childParentData._keptAlive);
|
assert(childParentData._keptAlive);
|
||||||
dropChild(child);
|
dropChild(child);
|
||||||
child.parentData = childParentData;
|
child.parentData = childParentData;
|
||||||
@ -357,7 +357,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _destroyOrCacheChild(RenderBox child) {
|
void _destroyOrCacheChild(RenderBox child) {
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
if (childParentData.keepAlive) {
|
if (childParentData.keepAlive) {
|
||||||
assert(!childParentData._keptAlive);
|
assert(!childParentData._keptAlive);
|
||||||
remove(child);
|
remove(child);
|
||||||
@ -428,7 +428,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
if (firstChild != null) {
|
if (firstChild != null) {
|
||||||
assert(firstChild == lastChild);
|
assert(firstChild == lastChild);
|
||||||
assert(indexOf(firstChild) == index);
|
assert(indexOf(firstChild) == index);
|
||||||
final SliverMultiBoxAdaptorParentData firstChildParentData = firstChild.parentData;
|
final SliverMultiBoxAdaptorParentData firstChildParentData = firstChild.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
firstChildParentData.layoutOffset = layoutOffset;
|
firstChildParentData.layoutOffset = layoutOffset;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -522,11 +522,11 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
// kept alive. (This should cause _keepAliveBucket to change, so we have
|
// kept alive. (This should cause _keepAliveBucket to change, so we have
|
||||||
// to prepare our list ahead of time.)
|
// to prepare our list ahead of time.)
|
||||||
_keepAliveBucket.values.where((RenderBox child) {
|
_keepAliveBucket.values.where((RenderBox child) {
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
return !childParentData.keepAlive;
|
return !childParentData.keepAlive;
|
||||||
}).toList().forEach(_childManager.removeChild);
|
}).toList().forEach(_childManager.removeChild);
|
||||||
assert(_keepAliveBucket.values.where((RenderBox child) {
|
assert(_keepAliveBucket.values.where((RenderBox child) {
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
return !childParentData.keepAlive;
|
return !childParentData.keepAlive;
|
||||||
}).isEmpty);
|
}).isEmpty);
|
||||||
});
|
});
|
||||||
@ -536,7 +536,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
/// [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);
|
assert(child != null);
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
assert(childParentData.index != null);
|
assert(childParentData.index != null);
|
||||||
return childParentData.index;
|
return childParentData.index;
|
||||||
}
|
}
|
||||||
@ -577,14 +577,14 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
double childScrollOffset(RenderObject child) {
|
double childScrollOffset(RenderObject child) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
assert(child.parent == this);
|
assert(child.parent == this);
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
assert(childParentData.layoutOffset != null);
|
assert(childParentData.layoutOffset != null);
|
||||||
return childParentData.layoutOffset;
|
return childParentData.layoutOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
applyPaintTransformForBoxChild(child, transform);
|
applyPaintTransformForBoxChild(child as RenderBox, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -674,7 +674,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
|
|||||||
if (firstChild != null) {
|
if (firstChild != null) {
|
||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
while (true) {
|
while (true) {
|
||||||
final SliverMultiBoxAdaptorParentData childParentData = child.parentData;
|
final SliverMultiBoxAdaptorParentData childParentData = child.parentData as SliverMultiBoxAdaptorParentData;
|
||||||
children.add(child.toDiagnosticsNode(name: 'child with index ${childParentData.index}'));
|
children.add(child.toDiagnosticsNode(name: 'child with index ${childParentData.index}'));
|
||||||
if (child == lastChild)
|
if (child == lastChild)
|
||||||
break;
|
break;
|
||||||
|
@ -188,7 +188,7 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
|
|||||||
hasVisualOverflow: childLayoutGeometry.hasVisualOverflow,
|
hasVisualOverflow: childLayoutGeometry.hasVisualOverflow,
|
||||||
);
|
);
|
||||||
|
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
assert(constraints.axisDirection != null);
|
assert(constraints.axisDirection != null);
|
||||||
assert(constraints.growthDirection != null);
|
assert(constraints.growthDirection != null);
|
||||||
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
|
switch (applyGrowthDirectionToAxisDirection(constraints.axisDirection, constraints.growthDirection)) {
|
||||||
@ -215,7 +215,7 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
|
|||||||
@override
|
@override
|
||||||
bool hitTestChildren(SliverHitTestResult result, { @required double mainAxisPosition, @required double crossAxisPosition }) {
|
bool hitTestChildren(SliverHitTestResult result, { @required double mainAxisPosition, @required double crossAxisPosition }) {
|
||||||
if (child != null && child.geometry.hitTestExtent > 0.0) {
|
if (child != null && child.geometry.hitTestExtent > 0.0) {
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
result.addWithAxisOffset(
|
result.addWithAxisOffset(
|
||||||
mainAxisPosition: mainAxisPosition,
|
mainAxisPosition: mainAxisPosition,
|
||||||
crossAxisPosition: crossAxisPosition,
|
crossAxisPosition: crossAxisPosition,
|
||||||
@ -264,14 +264,14 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
|
|||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
assert(child == this.child);
|
assert(child == this.child);
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
childParentData.applyPaintTransform(transform);
|
childParentData.applyPaintTransform(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(PaintingContext context, Offset offset) {
|
void paint(PaintingContext context, Offset offset) {
|
||||||
if (child != null && child.geometry.visible) {
|
if (child != null && child.geometry.visible) {
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
context.paintChild(child, offset + childParentData.paintOffset);
|
context.paintChild(child, offset + childParentData.paintOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -287,7 +287,7 @@ abstract class RenderSliverEdgeInsetsPadding extends RenderSliver with RenderObj
|
|||||||
Rect innerRect;
|
Rect innerRect;
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
childSize = child.getAbsoluteSize();
|
childSize = child.getAbsoluteSize();
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
innerRect = (offset + childParentData.paintOffset) & childSize;
|
innerRect = (offset + childParentData.paintOffset) & childSize;
|
||||||
assert(innerRect.top >= outerRect.top);
|
assert(innerRect.top >= outerRect.top);
|
||||||
assert(innerRect.left >= outerRect.left);
|
assert(innerRect.left >= outerRect.left);
|
||||||
|
@ -231,7 +231,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
|
|||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
assert(child == this.child);
|
assert(child == this.child);
|
||||||
applyPaintTransformForBoxChild(child, transform);
|
applyPaintTransformForBoxChild(child as RenderBox, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -321,7 +321,7 @@ abstract class RenderSliverScrollingPersistentHeader extends RenderSliverPersist
|
|||||||
geometry = SliverGeometry(
|
geometry = SliverGeometry(
|
||||||
scrollExtent: maxExtent,
|
scrollExtent: maxExtent,
|
||||||
paintOrigin: math.min(constraints.overlap, 0.0),
|
paintOrigin: math.min(constraints.overlap, 0.0),
|
||||||
paintExtent: paintExtent.clamp(0.0, constraints.remainingPaintExtent),
|
paintExtent: paintExtent.clamp(0.0, constraints.remainingPaintExtent) as double,
|
||||||
maxPaintExtent: maxExtent + stretchOffset,
|
maxPaintExtent: maxExtent + stretchOffset,
|
||||||
hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
|
hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
|
||||||
);
|
);
|
||||||
@ -337,7 +337,7 @@ abstract class RenderSliverScrollingPersistentHeader extends RenderSliverPersist
|
|||||||
geometry = SliverGeometry(
|
geometry = SliverGeometry(
|
||||||
scrollExtent: maxExtent,
|
scrollExtent: maxExtent,
|
||||||
paintOrigin: math.min(constraints.overlap, 0.0),
|
paintOrigin: math.min(constraints.overlap, 0.0),
|
||||||
paintExtent: paintExtent.clamp(0.0, constraints.remainingPaintExtent),
|
paintExtent: paintExtent.clamp(0.0, constraints.remainingPaintExtent) as double,
|
||||||
maxPaintExtent: maxExtent,
|
maxPaintExtent: maxExtent,
|
||||||
hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
|
hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
|
||||||
);
|
);
|
||||||
@ -373,7 +373,7 @@ abstract class RenderSliverPinnedPersistentHeader extends RenderSliverPersistent
|
|||||||
final bool overlapsContent = constraints.overlap > 0.0;
|
final bool overlapsContent = constraints.overlap > 0.0;
|
||||||
excludeFromSemanticsScrolling = overlapsContent || (constraints.scrollOffset > maxExtent - minExtent);
|
excludeFromSemanticsScrolling = overlapsContent || (constraints.scrollOffset > maxExtent - minExtent);
|
||||||
layoutChild(constraints.scrollOffset, maxExtent, overlapsContent: overlapsContent);
|
layoutChild(constraints.scrollOffset, maxExtent, overlapsContent: overlapsContent);
|
||||||
final double layoutExtent = (maxExtent - constraints.scrollOffset).clamp(0.0, constraints.remainingPaintExtent);
|
final double layoutExtent = (maxExtent - constraints.scrollOffset).clamp(0.0, constraints.remainingPaintExtent) as double;
|
||||||
final double stretchOffset = stretchConfiguration != null ?
|
final double stretchOffset = stretchConfiguration != null ?
|
||||||
constraints.overlap.abs() :
|
constraints.overlap.abs() :
|
||||||
0.0;
|
0.0;
|
||||||
@ -505,8 +505,8 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste
|
|||||||
geometry = SliverGeometry(
|
geometry = SliverGeometry(
|
||||||
scrollExtent: maxExtent,
|
scrollExtent: maxExtent,
|
||||||
paintOrigin: math.min(constraints.overlap, 0.0),
|
paintOrigin: math.min(constraints.overlap, 0.0),
|
||||||
paintExtent: paintExtent.clamp(0.0, constraints.remainingPaintExtent),
|
paintExtent: paintExtent.clamp(0.0, constraints.remainingPaintExtent) as double,
|
||||||
layoutExtent: layoutExtent.clamp(0.0, constraints.remainingPaintExtent),
|
layoutExtent: layoutExtent.clamp(0.0, constraints.remainingPaintExtent) as double,
|
||||||
maxPaintExtent: maxExtent + stretchOffset,
|
maxPaintExtent: maxExtent + stretchOffset,
|
||||||
hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
|
hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
|
||||||
);
|
);
|
||||||
@ -565,7 +565,7 @@ abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersiste
|
|||||||
if (delta > 0.0) // If we are trying to expand when allowFloatingExpansion is false,
|
if (delta > 0.0) // If we are trying to expand when allowFloatingExpansion is false,
|
||||||
delta = 0.0; // disallow the expansion. (But allow shrinking, i.e. delta < 0.0 is fine.)
|
delta = 0.0; // disallow the expansion. (But allow shrinking, i.e. delta < 0.0 is fine.)
|
||||||
}
|
}
|
||||||
_effectiveScrollOffset = (_effectiveScrollOffset - delta).clamp(0.0, constraints.scrollOffset);
|
_effectiveScrollOffset = (_effectiveScrollOffset - delta).clamp(0.0, constraints.scrollOffset) as double;
|
||||||
} else {
|
} else {
|
||||||
_effectiveScrollOffset = constraints.scrollOffset;
|
_effectiveScrollOffset = constraints.scrollOffset;
|
||||||
}
|
}
|
||||||
@ -627,7 +627,7 @@ abstract class RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFl
|
|||||||
final double clampedPaintExtent = paintExtent.clamp(
|
final double clampedPaintExtent = paintExtent.clamp(
|
||||||
minAllowedExtent,
|
minAllowedExtent,
|
||||||
constraints.remainingPaintExtent,
|
constraints.remainingPaintExtent,
|
||||||
);
|
) as double;
|
||||||
final double layoutExtent = maxExtent - constraints.scrollOffset;
|
final double layoutExtent = maxExtent - constraints.scrollOffset;
|
||||||
final double stretchOffset = stretchConfiguration != null ?
|
final double stretchOffset = stretchConfiguration != null ?
|
||||||
constraints.overlap.abs() :
|
constraints.overlap.abs() :
|
||||||
@ -636,7 +636,7 @@ abstract class RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFl
|
|||||||
scrollExtent: maxExtent,
|
scrollExtent: maxExtent,
|
||||||
paintOrigin: math.min(constraints.overlap, 0.0),
|
paintOrigin: math.min(constraints.overlap, 0.0),
|
||||||
paintExtent: clampedPaintExtent,
|
paintExtent: clampedPaintExtent,
|
||||||
layoutExtent: layoutExtent.clamp(0.0, clampedPaintExtent),
|
layoutExtent: layoutExtent.clamp(0.0, clampedPaintExtent) as double,
|
||||||
maxPaintExtent: maxExtent + stretchOffset,
|
maxPaintExtent: maxExtent + stretchOffset,
|
||||||
maxScrollObstructionExtent: maxExtent,
|
maxScrollObstructionExtent: maxExtent,
|
||||||
hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
|
hasVisualOverflow: true, // Conservatively say we do have overflow to avoid complexity.
|
||||||
|
@ -154,13 +154,11 @@ class RelativeRect {
|
|||||||
bool operator ==(dynamic other) {
|
bool operator ==(dynamic other) {
|
||||||
if (identical(this, other))
|
if (identical(this, other))
|
||||||
return true;
|
return true;
|
||||||
if (other is! RelativeRect)
|
return other is RelativeRect
|
||||||
return false;
|
&& other.left == left
|
||||||
final RelativeRect typedOther = other;
|
&& other.top == top
|
||||||
return left == typedOther.left &&
|
&& other.right == right
|
||||||
top == typedOther.top &&
|
&& other.bottom == bottom;
|
||||||
right == typedOther.right &&
|
|
||||||
bottom == typedOther.bottom;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -431,7 +429,7 @@ class RenderStack extends RenderBox
|
|||||||
double extent = 0.0;
|
double extent = 0.0;
|
||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final StackParentData childParentData = child.parentData;
|
final StackParentData childParentData = child.parentData as StackParentData;
|
||||||
if (!childParentData.isPositioned)
|
if (!childParentData.isPositioned)
|
||||||
extent = math.max(extent, mainChildSizeGetter(child));
|
extent = math.max(extent, mainChildSizeGetter(child));
|
||||||
assert(child.parentData == childParentData);
|
assert(child.parentData == childParentData);
|
||||||
@ -497,7 +495,7 @@ class RenderStack extends RenderBox
|
|||||||
|
|
||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final StackParentData childParentData = child.parentData;
|
final StackParentData childParentData = child.parentData as StackParentData;
|
||||||
|
|
||||||
if (!childParentData.isPositioned) {
|
if (!childParentData.isPositioned) {
|
||||||
hasNonPositionedChildren = true;
|
hasNonPositionedChildren = true;
|
||||||
@ -524,10 +522,10 @@ class RenderStack extends RenderBox
|
|||||||
|
|
||||||
child = firstChild;
|
child = firstChild;
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final StackParentData childParentData = child.parentData;
|
final StackParentData childParentData = child.parentData as StackParentData;
|
||||||
|
|
||||||
if (!childParentData.isPositioned) {
|
if (!childParentData.isPositioned) {
|
||||||
childParentData.offset = _resolvedAlignment.alongOffset(size - child.size);
|
childParentData.offset = _resolvedAlignment.alongOffset(size - child.size as Offset);
|
||||||
} else {
|
} else {
|
||||||
BoxConstraints childConstraints = const BoxConstraints();
|
BoxConstraints childConstraints = const BoxConstraints();
|
||||||
|
|
||||||
@ -549,7 +547,7 @@ class RenderStack extends RenderBox
|
|||||||
} else if (childParentData.right != null) {
|
} else if (childParentData.right != null) {
|
||||||
x = size.width - childParentData.right - child.size.width;
|
x = size.width - childParentData.right - child.size.width;
|
||||||
} else {
|
} else {
|
||||||
x = _resolvedAlignment.alongOffset(size - child.size).dx;
|
x = _resolvedAlignment.alongOffset(size - child.size as Offset).dx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x < 0.0 || x + child.size.width > size.width)
|
if (x < 0.0 || x + child.size.width > size.width)
|
||||||
@ -561,7 +559,7 @@ class RenderStack extends RenderBox
|
|||||||
} else if (childParentData.bottom != null) {
|
} else if (childParentData.bottom != null) {
|
||||||
y = size.height - childParentData.bottom - child.size.height;
|
y = size.height - childParentData.bottom - child.size.height;
|
||||||
} else {
|
} else {
|
||||||
y = _resolvedAlignment.alongOffset(size - child.size).dy;
|
y = _resolvedAlignment.alongOffset(size - child.size as Offset).dy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y < 0.0 || y + child.size.height > size.height)
|
if (y < 0.0 || y + child.size.height > size.height)
|
||||||
@ -653,7 +651,7 @@ class RenderIndexedStack extends RenderStack {
|
|||||||
RenderBox child = firstChild;
|
RenderBox child = firstChild;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (child != null && i < index) {
|
while (child != null && i < index) {
|
||||||
final StackParentData childParentData = child.parentData;
|
final StackParentData childParentData = child.parentData as StackParentData;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
@ -668,7 +666,7 @@ class RenderIndexedStack extends RenderStack {
|
|||||||
return false;
|
return false;
|
||||||
assert(position != null);
|
assert(position != null);
|
||||||
final RenderBox child = _childAtIndex();
|
final RenderBox child = _childAtIndex();
|
||||||
final StackParentData childParentData = child.parentData;
|
final StackParentData childParentData = child.parentData as StackParentData;
|
||||||
return result.addWithPaintOffset(
|
return result.addWithPaintOffset(
|
||||||
offset: childParentData.offset,
|
offset: childParentData.offset,
|
||||||
position: position,
|
position: position,
|
||||||
@ -684,7 +682,7 @@ class RenderIndexedStack extends RenderStack {
|
|||||||
if (firstChild == null || index == null)
|
if (firstChild == null || index == null)
|
||||||
return;
|
return;
|
||||||
final RenderBox child = _childAtIndex();
|
final RenderBox child = _childAtIndex();
|
||||||
final StackParentData childParentData = child.parentData;
|
final StackParentData childParentData = child.parentData as StackParentData;
|
||||||
context.paintChild(child, childParentData.offset + offset);
|
context.paintChild(child, childParentData.offset + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1036,7 +1036,7 @@ class RenderTable extends RenderBox {
|
|||||||
final int xy = x + y * columns;
|
final int xy = x + y * columns;
|
||||||
final RenderBox child = _children[xy];
|
final RenderBox child = _children[xy];
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
final TableCellParentData childParentData = child.parentData;
|
final TableCellParentData childParentData = child.parentData as TableCellParentData;
|
||||||
assert(childParentData != null);
|
assert(childParentData != null);
|
||||||
childParentData.x = x;
|
childParentData.x = x;
|
||||||
childParentData.y = y;
|
childParentData.y = y;
|
||||||
@ -1075,7 +1075,7 @@ class RenderTable extends RenderBox {
|
|||||||
final int xy = x + y * columns;
|
final int xy = x + y * columns;
|
||||||
final RenderBox child = _children[xy];
|
final RenderBox child = _children[xy];
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
final TableCellParentData childParentData = child.parentData;
|
final TableCellParentData childParentData = child.parentData as TableCellParentData;
|
||||||
switch (childParentData.verticalAlignment ?? defaultVerticalAlignment) {
|
switch (childParentData.verticalAlignment ?? defaultVerticalAlignment) {
|
||||||
case TableCellVerticalAlignment.baseline:
|
case TableCellVerticalAlignment.baseline:
|
||||||
if (baselines[x] != null)
|
if (baselines[x] != null)
|
||||||
@ -1110,7 +1110,7 @@ class RenderTable extends RenderBox {
|
|||||||
for (int index = _children.length - 1; index >= 0; index -= 1) {
|
for (int index = _children.length - 1; index >= 0; index -= 1) {
|
||||||
final RenderBox child = _children[index];
|
final RenderBox child = _children[index];
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
final bool isHit = result.addWithPaintOffset(
|
final bool isHit = result.addWithPaintOffset(
|
||||||
offset: childParentData.offset,
|
offset: childParentData.offset,
|
||||||
position: position,
|
position: position,
|
||||||
@ -1156,7 +1156,7 @@ class RenderTable extends RenderBox {
|
|||||||
for (int index = 0; index < _children.length; index += 1) {
|
for (int index = 0; index < _children.length; index += 1) {
|
||||||
final RenderBox child = _children[index];
|
final RenderBox child = _children[index];
|
||||||
if (child != null) {
|
if (child != null) {
|
||||||
final BoxParentData childParentData = child.parentData;
|
final BoxParentData childParentData = child.parentData as BoxParentData;
|
||||||
context.paintChild(child, childParentData.offset + offset);
|
context.paintChild(child, childParentData.offset + offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,13 +265,13 @@ class TableBorder {
|
|||||||
return true;
|
return true;
|
||||||
if (runtimeType != other.runtimeType)
|
if (runtimeType != other.runtimeType)
|
||||||
return false;
|
return false;
|
||||||
final TableBorder typedOther = other;
|
return other is TableBorder
|
||||||
return top == typedOther.top
|
&& other.top == top
|
||||||
&& right == typedOther.right
|
&& other.right == right
|
||||||
&& bottom == typedOther.bottom
|
&& other.bottom == bottom
|
||||||
&& left == typedOther.left
|
&& other.left == left
|
||||||
&& horizontalInside == typedOther.horizontalInside
|
&& other.horizontalInside == horizontalInside
|
||||||
&& verticalInside == typedOther.verticalInside;
|
&& other.verticalInside == verticalInside;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -139,9 +139,9 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
|
|||||||
|
|
||||||
Matrix4 _rootTransform;
|
Matrix4 _rootTransform;
|
||||||
|
|
||||||
Layer _updateMatricesAndCreateNewRootLayer() {
|
TransformLayer _updateMatricesAndCreateNewRootLayer() {
|
||||||
_rootTransform = configuration.toMatrix();
|
_rootTransform = configuration.toMatrix();
|
||||||
final ContainerLayer rootLayer = TransformLayer(transform: _rootTransform);
|
final TransformLayer rootLayer = TransformLayer(transform: _rootTransform);
|
||||||
rootLayer.attach(this);
|
rootLayer.attach(this);
|
||||||
assert(_rootTransform != null);
|
assert(_rootTransform != null);
|
||||||
return rootLayer;
|
return rootLayer;
|
||||||
|
@ -43,7 +43,7 @@ abstract class RenderAbstractViewport extends RenderObject {
|
|||||||
while (object != null) {
|
while (object != null) {
|
||||||
if (object is RenderAbstractViewport)
|
if (object is RenderAbstractViewport)
|
||||||
return object;
|
return object;
|
||||||
object = object.parent;
|
object = object.parent as RenderObject;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -659,18 +659,18 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
|
|||||||
RenderBox pivot;
|
RenderBox pivot;
|
||||||
bool onlySlivers = target is RenderSliver; // ... between viewport and `target` (`target` included).
|
bool onlySlivers = target is RenderSliver; // ... between viewport and `target` (`target` included).
|
||||||
while (child.parent != this) {
|
while (child.parent != this) {
|
||||||
assert(child.parent != null, '$target must be a descendant of $this');
|
final RenderObject parent = child.parent as RenderObject;
|
||||||
|
assert(parent != null, '$target must be a descendant of $this');
|
||||||
if (child is RenderBox) {
|
if (child is RenderBox) {
|
||||||
pivot = child;
|
pivot = child;
|
||||||
}
|
}
|
||||||
if (child.parent is RenderSliver) {
|
if (parent is RenderSliver) {
|
||||||
final RenderSliver parent = child.parent;
|
|
||||||
leadingScrollOffset += parent.childScrollOffset(child);
|
leadingScrollOffset += parent.childScrollOffset(child);
|
||||||
} else {
|
} else {
|
||||||
onlySlivers = false;
|
onlySlivers = false;
|
||||||
leadingScrollOffset = 0.0;
|
leadingScrollOffset = 0.0;
|
||||||
}
|
}
|
||||||
child = child.parent;
|
child = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pivot != null) {
|
if (pivot != null) {
|
||||||
@ -678,7 +678,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
|
|||||||
assert(pivot.parent != this);
|
assert(pivot.parent != this);
|
||||||
assert(pivot != this);
|
assert(pivot != this);
|
||||||
assert(pivot.parent is RenderSliver); // TODO(abarth): Support other kinds of render objects besides slivers.
|
assert(pivot.parent is RenderSliver); // TODO(abarth): Support other kinds of render objects besides slivers.
|
||||||
final RenderSliver pivotParent = pivot.parent;
|
final RenderSliver pivotParent = pivot.parent as RenderSliver;
|
||||||
|
|
||||||
final Matrix4 transform = target.getTransformTo(pivot);
|
final Matrix4 transform = target.getTransformTo(pivot);
|
||||||
final Rect bounds = MatrixUtils.transformRect(transform, rect);
|
final Rect bounds = MatrixUtils.transformRect(transform, rect);
|
||||||
@ -739,7 +739,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (onlySlivers) {
|
} else if (onlySlivers) {
|
||||||
final RenderSliver targetSliver = target;
|
final RenderSliver targetSliver = target as RenderSliver;
|
||||||
targetMainAxisExtent = targetSliver.geometry.scrollExtent;
|
targetMainAxisExtent = targetSliver.geometry.scrollExtent;
|
||||||
} else {
|
} else {
|
||||||
return RevealedOffset(offset: offset.pixels, rect: rect);
|
return RevealedOffset(offset: offset.pixels, rect: rect);
|
||||||
@ -747,7 +747,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
|
|||||||
|
|
||||||
assert(child.parent == this);
|
assert(child.parent == this);
|
||||||
assert(child is RenderSliver);
|
assert(child is RenderSliver);
|
||||||
final RenderSliver sliver = child;
|
final RenderSliver sliver = child as RenderSliver;
|
||||||
final double extentOfPinnedSlivers = maxScrollObstructionExtentBefore(sliver);
|
final double extentOfPinnedSlivers = maxScrollObstructionExtentBefore(sliver);
|
||||||
leadingScrollOffset = scrollOffsetOf(sliver, leadingScrollOffset);
|
leadingScrollOffset = scrollOffsetOf(sliver, leadingScrollOffset);
|
||||||
switch (sliver.constraints.growthDirection) {
|
switch (sliver.constraints.growthDirection) {
|
||||||
@ -1064,7 +1064,7 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
|
|||||||
} else {
|
} else {
|
||||||
// `descendant` is between leading and trailing edge and hence already
|
// `descendant` is between leading and trailing edge and hence already
|
||||||
// fully shown on screen. No action necessary.
|
// fully shown on screen. No action necessary.
|
||||||
final Matrix4 transform = descendant.getTransformTo(viewport.parent);
|
final Matrix4 transform = descendant.getTransformTo(viewport.parent as RenderObject);
|
||||||
return MatrixUtils.transformRect(transform, rect ?? descendant.paintBounds);
|
return MatrixUtils.transformRect(transform, rect ?? descendant.paintBounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1388,8 +1388,8 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
|
|||||||
// to the zero scroll offset (the line between the forward slivers and the
|
// to the zero scroll offset (the line between the forward slivers and the
|
||||||
// reverse slivers).
|
// reverse slivers).
|
||||||
final double centerOffset = mainAxisExtent * anchor - correctedOffset;
|
final double centerOffset = mainAxisExtent * anchor - correctedOffset;
|
||||||
final double reverseDirectionRemainingPaintExtent = centerOffset.clamp(0.0, mainAxisExtent);
|
final double reverseDirectionRemainingPaintExtent = centerOffset.clamp(0.0, mainAxisExtent) as double;
|
||||||
final double forwardDirectionRemainingPaintExtent = (mainAxisExtent - centerOffset).clamp(0.0, mainAxisExtent);
|
final double forwardDirectionRemainingPaintExtent = (mainAxisExtent - centerOffset).clamp(0.0, mainAxisExtent) as double;
|
||||||
|
|
||||||
switch (cacheExtentStyle) {
|
switch (cacheExtentStyle) {
|
||||||
case CacheExtentStyle.pixel:
|
case CacheExtentStyle.pixel:
|
||||||
@ -1402,8 +1402,8 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
|
|||||||
|
|
||||||
final double fullCacheExtent = mainAxisExtent + 2 * _calculatedCacheExtent;
|
final double fullCacheExtent = mainAxisExtent + 2 * _calculatedCacheExtent;
|
||||||
final double centerCacheOffset = centerOffset + _calculatedCacheExtent;
|
final double centerCacheOffset = centerOffset + _calculatedCacheExtent;
|
||||||
final double reverseDirectionRemainingCacheExtent = centerCacheOffset.clamp(0.0, fullCacheExtent);
|
final double reverseDirectionRemainingCacheExtent = centerCacheOffset.clamp(0.0, fullCacheExtent) as double;
|
||||||
final double forwardDirectionRemainingCacheExtent = (fullCacheExtent - centerCacheOffset).clamp(0.0, fullCacheExtent);
|
final double forwardDirectionRemainingCacheExtent = (fullCacheExtent - centerCacheOffset).clamp(0.0, fullCacheExtent) as double;
|
||||||
|
|
||||||
final RenderSliver leadingNegativeChild = childBefore(center);
|
final RenderSliver leadingNegativeChild = childBefore(center);
|
||||||
|
|
||||||
@ -1420,7 +1420,7 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
|
|||||||
growthDirection: GrowthDirection.reverse,
|
growthDirection: GrowthDirection.reverse,
|
||||||
advance: childBefore,
|
advance: childBefore,
|
||||||
remainingCacheExtent: reverseDirectionRemainingCacheExtent,
|
remainingCacheExtent: reverseDirectionRemainingCacheExtent,
|
||||||
cacheOrigin: (mainAxisExtent - centerOffset).clamp(-_calculatedCacheExtent, 0.0),
|
cacheOrigin: (mainAxisExtent - centerOffset).clamp(-_calculatedCacheExtent, 0.0) as double,
|
||||||
);
|
);
|
||||||
if (result != 0.0)
|
if (result != 0.0)
|
||||||
return -result;
|
return -result;
|
||||||
@ -1438,7 +1438,7 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
|
|||||||
growthDirection: GrowthDirection.forward,
|
growthDirection: GrowthDirection.forward,
|
||||||
advance: childAfter,
|
advance: childAfter,
|
||||||
remainingCacheExtent: forwardDirectionRemainingCacheExtent,
|
remainingCacheExtent: forwardDirectionRemainingCacheExtent,
|
||||||
cacheOrigin: centerOffset.clamp(-_calculatedCacheExtent, 0.0),
|
cacheOrigin: centerOffset.clamp(-_calculatedCacheExtent, 0.0) as double,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1461,13 +1461,13 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void updateChildLayoutOffset(RenderSliver child, double layoutOffset, GrowthDirection growthDirection) {
|
void updateChildLayoutOffset(RenderSliver child, double layoutOffset, GrowthDirection growthDirection) {
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
childParentData.paintOffset = computeAbsolutePaintOffset(child, layoutOffset, growthDirection);
|
childParentData.paintOffset = computeAbsolutePaintOffset(child, layoutOffset, growthDirection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Offset paintOffsetOf(RenderSliver child) {
|
Offset paintOffsetOf(RenderSliver child) {
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
return childParentData.paintOffset;
|
return childParentData.paintOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1526,7 +1526,7 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
|
|||||||
@override
|
@override
|
||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
childParentData.applyPaintTransform(transform);
|
childParentData.applyPaintTransform(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1534,7 +1534,7 @@ class RenderViewport extends RenderViewportBase<SliverPhysicalContainerParentDat
|
|||||||
double computeChildMainAxisPosition(RenderSliver child, double parentMainAxisPosition) {
|
double computeChildMainAxisPosition(RenderSliver child, double parentMainAxisPosition) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
assert(child.constraints != null);
|
assert(child.constraints != null);
|
||||||
final SliverPhysicalParentData childParentData = child.parentData;
|
final SliverPhysicalParentData childParentData = child.parentData as SliverPhysicalParentData;
|
||||||
switch (applyGrowthDirectionToAxisDirection(child.constraints.axisDirection, child.constraints.growthDirection)) {
|
switch (applyGrowthDirectionToAxisDirection(child.constraints.axisDirection, child.constraints.growthDirection)) {
|
||||||
case AxisDirection.down:
|
case AxisDirection.down:
|
||||||
return parentMainAxisPosition - childParentData.paintOffset.dy;
|
return parentMainAxisPosition - childParentData.paintOffset.dy;
|
||||||
@ -1790,13 +1790,13 @@ class RenderShrinkWrappingViewport extends RenderViewportBase<SliverLogicalConta
|
|||||||
@override
|
@override
|
||||||
void updateChildLayoutOffset(RenderSliver child, double layoutOffset, GrowthDirection growthDirection) {
|
void updateChildLayoutOffset(RenderSliver child, double layoutOffset, GrowthDirection growthDirection) {
|
||||||
assert(growthDirection == GrowthDirection.forward);
|
assert(growthDirection == GrowthDirection.forward);
|
||||||
final SliverLogicalParentData childParentData = child.parentData;
|
final SliverLogicalParentData childParentData = child.parentData as SliverLogicalParentData;
|
||||||
childParentData.layoutOffset = layoutOffset;
|
childParentData.layoutOffset = layoutOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Offset paintOffsetOf(RenderSliver child) {
|
Offset paintOffsetOf(RenderSliver child) {
|
||||||
final SliverLogicalParentData childParentData = child.parentData;
|
final SliverLogicalParentData childParentData = child.parentData as SliverLogicalParentData;
|
||||||
return computeAbsolutePaintOffset(child, childParentData.layoutOffset, GrowthDirection.forward);
|
return computeAbsolutePaintOffset(child, childParentData.layoutOffset, GrowthDirection.forward);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1829,7 +1829,7 @@ class RenderShrinkWrappingViewport extends RenderViewportBase<SliverLogicalConta
|
|||||||
@override
|
@override
|
||||||
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
void applyPaintTransform(RenderObject child, Matrix4 transform) {
|
||||||
assert(child != null);
|
assert(child != null);
|
||||||
final Offset offset = paintOffsetOf(child);
|
final Offset offset = paintOffsetOf(child as RenderSliver);
|
||||||
transform.translate(offset.dx, offset.dy);
|
transform.translate(offset.dx, offset.dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1838,7 +1838,7 @@ class RenderShrinkWrappingViewport extends RenderViewportBase<SliverLogicalConta
|
|||||||
assert(child != null);
|
assert(child != null);
|
||||||
assert(child.constraints != null);
|
assert(child.constraints != null);
|
||||||
assert(hasSize);
|
assert(hasSize);
|
||||||
final SliverLogicalParentData childParentData = child.parentData;
|
final SliverLogicalParentData childParentData = child.parentData as SliverLogicalParentData;
|
||||||
switch (applyGrowthDirectionToAxisDirection(child.constraints.axisDirection, child.constraints.growthDirection)) {
|
switch (applyGrowthDirectionToAxisDirection(child.constraints.axisDirection, child.constraints.growthDirection)) {
|
||||||
case AxisDirection.down:
|
case AxisDirection.down:
|
||||||
case AxisDirection.right:
|
case AxisDirection.right:
|
||||||
|
@ -623,7 +623,7 @@ class RenderWrap extends RenderBox with ContainerRenderObjectMixin<RenderBox, Wr
|
|||||||
runMainAxisExtent += spacing;
|
runMainAxisExtent += spacing;
|
||||||
runCrossAxisExtent = math.max(runCrossAxisExtent, childCrossAxisExtent);
|
runCrossAxisExtent = math.max(runCrossAxisExtent, childCrossAxisExtent);
|
||||||
childCount += 1;
|
childCount += 1;
|
||||||
final WrapParentData childParentData = child.parentData;
|
final WrapParentData childParentData = child.parentData as WrapParentData;
|
||||||
childParentData._runIndex = runMetrics.length;
|
childParentData._runIndex = runMetrics.length;
|
||||||
child = childParentData.nextSibling;
|
child = childParentData.nextSibling;
|
||||||
}
|
}
|
||||||
@ -724,7 +724,7 @@ class RenderWrap extends RenderBox with ContainerRenderObjectMixin<RenderBox, Wr
|
|||||||
crossAxisOffset -= runCrossAxisExtent;
|
crossAxisOffset -= runCrossAxisExtent;
|
||||||
|
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
final WrapParentData childParentData = child.parentData;
|
final WrapParentData childParentData = child.parentData as WrapParentData;
|
||||||
if (childParentData._runIndex != i)
|
if (childParentData._runIndex != i)
|
||||||
break;
|
break;
|
||||||
final double childMainAxisExtent = _getMainAxisExtent(child);
|
final double childMainAxisExtent = _getMainAxisExtent(child);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user