Commit 7a2d82d0 authored by Adam Barth's avatar Adam Barth

Merge pull request #2301 from abarth/dotdot_pattern

updateRenderObject() methods should use the .. pattern
parents ad1eac32 ac1cba59
......@@ -75,10 +75,11 @@ class _CheckboxRenderObjectWidget extends LeafRenderObjectWidget {
);
void updateRenderObject(_RenderCheckbox renderObject, _CheckboxRenderObjectWidget oldWidget) {
renderObject.value = value;
renderObject.activeColor = activeColor;
renderObject.inactiveColor = inactiveColor;
renderObject.onChanged = onChanged;
renderObject
..value = value
..activeColor = activeColor
..inactiveColor = inactiveColor
..onChanged = onChanged;
}
}
......
......@@ -80,10 +80,11 @@ class _RadioRenderObjectWidget extends LeafRenderObjectWidget {
);
void updateRenderObject(_RenderRadio renderObject, _RadioRenderObjectWidget oldWidget) {
renderObject.value = selected;
renderObject.activeColor = activeColor;
renderObject.inactiveColor = inactiveColor;
renderObject.onChanged = onChanged;
renderObject
..value = selected
..activeColor = activeColor
..inactiveColor = inactiveColor
..onChanged = onChanged;
}
}
......
......@@ -62,9 +62,10 @@ class _SliderRenderObjectWidget extends LeafRenderObjectWidget {
);
void updateRenderObject(_RenderSlider renderObject, _SliderRenderObjectWidget oldWidget) {
renderObject.value = value;
renderObject.activeColor = activeColor;
renderObject.onChanged = onChanged;
renderObject
..value = value
..activeColor = activeColor
..onChanged = onChanged;
}
}
......
......@@ -78,12 +78,13 @@ class _SwitchRenderObjectWidget extends LeafRenderObjectWidget {
);
void updateRenderObject(_RenderSwitch renderObject, _SwitchRenderObjectWidget oldWidget) {
renderObject.value = value;
renderObject.activeColor = activeColor;
renderObject.inactiveColor = inactiveColor;
renderObject.activeTrackColor = activeTrackColor;
renderObject.inactiveTrackColor = inactiveTrackColor;
renderObject.onChanged = onChanged;
renderObject
..value = value
..activeColor = activeColor
..inactiveColor = inactiveColor
..activeTrackColor = activeTrackColor
..inactiveTrackColor = inactiveTrackColor
..onChanged = onChanged;
}
}
......
......@@ -270,12 +270,13 @@ class _TabBarWrapper extends MultiChildRenderObjectWidget {
}
void updateRenderObject(_RenderTabBar renderObject, _TabBarWrapper oldWidget) {
renderObject.selectedIndex = selectedIndex;
renderObject.indicatorColor = indicatorColor;
renderObject.indicatorRect = indicatorRect;
renderObject.textAndIcons = textAndIcons;
renderObject.isScrollable = isScrollable;
renderObject.onLayoutChanged = onLayoutChanged;
renderObject
..selectedIndex = selectedIndex
..indicatorColor = indicatorColor
..indicatorRect = indicatorRect
..textAndIcons = textAndIcons
..isScrollable = isScrollable
..onLayoutChanged = onLayoutChanged;
}
}
......
......@@ -102,8 +102,9 @@ class ShaderMask extends OneChildRenderObjectWidget {
}
void updateRenderObject(RenderShaderMask renderObject, ShaderMask oldWidget) {
renderObject.shaderCallback = shaderCallback;
renderObject.transferMode = transferMode;
renderObject
..shaderCallback = shaderCallback
..transferMode = transferMode;
}
}
......@@ -132,8 +133,9 @@ class DecoratedBox extends OneChildRenderObjectWidget {
RenderDecoratedBox createRenderObject() => new RenderDecoratedBox(decoration: decoration, position: position);
void updateRenderObject(RenderDecoratedBox renderObject, DecoratedBox oldWidget) {
renderObject.decoration = decoration;
renderObject.position = position;
renderObject
..decoration = decoration
..position = position;
}
}
......@@ -166,13 +168,15 @@ class CustomPaint extends OneChildRenderObjectWidget {
);
void updateRenderObject(RenderCustomPaint renderObject, CustomPaint oldWidget) {
renderObject.painter = painter;
renderObject.foregroundPainter = foregroundPainter;
renderObject
..painter = painter
..foregroundPainter = foregroundPainter;
}
void didUnmountRenderObject(RenderCustomPaint renderObject) {
renderObject.painter = null;
renderObject.foregroundPainter = null;
renderObject
..painter = null
..foregroundPainter = null;
}
}
......@@ -220,8 +224,9 @@ class ClipRRect extends OneChildRenderObjectWidget {
RenderClipRRect createRenderObject() => new RenderClipRRect(xRadius: xRadius, yRadius: yRadius);
void updateRenderObject(RenderClipRRect renderObject, ClipRRect oldWidget) {
renderObject.xRadius = xRadius;
renderObject.yRadius = yRadius;
renderObject
..xRadius = xRadius
..yRadius = yRadius;
}
}
......@@ -283,10 +288,11 @@ class Transform extends OneChildRenderObjectWidget {
);
void updateRenderObject(RenderTransform renderObject, Transform oldWidget) {
renderObject.transform = transform;
renderObject.origin = origin;
renderObject.alignment = alignment;
renderObject.transformHitTests = transformHitTests;
renderObject
..transform = transform
..origin = origin
..alignment = alignment
..transformHitTests = transformHitTests;
}
}
......@@ -307,8 +313,9 @@ class FractionalTranslation extends OneChildRenderObjectWidget {
RenderFractionalTranslation createRenderObject() => new RenderFractionalTranslation(translation: translation, transformHitTests: transformHitTests);
void updateRenderObject(RenderFractionalTranslation renderObject, FractionalTranslation oldWidget) {
renderObject.translation = translation;
renderObject.transformHitTests = transformHitTests;
renderObject
..translation = translation
..transformHitTests = transformHitTests;
}
}
......@@ -381,9 +388,10 @@ class Align extends OneChildRenderObjectWidget {
RenderPositionedBox createRenderObject() => new RenderPositionedBox(alignment: alignment, widthFactor: widthFactor, heightFactor: heightFactor);
void updateRenderObject(RenderPositionedBox renderObject, Align oldWidget) {
renderObject.alignment = alignment;
renderObject.widthFactor = widthFactor;
renderObject.heightFactor = heightFactor;
renderObject
..alignment = alignment
..widthFactor = widthFactor
..heightFactor = heightFactor;
}
}
......@@ -563,8 +571,9 @@ class FractionallySizedBox extends OneChildRenderObjectWidget {
);
void updateRenderObject(RenderFractionallySizedBox renderObject, FractionallySizedBox oldWidget) {
renderObject.widthFactor = width;
renderObject.heightFactor = height;
renderObject
..widthFactor = width
..heightFactor = height;
}
void debugFillDescription(List<String> description) {
......
......@@ -450,11 +450,12 @@ class _GestureSemantics extends OneChildRenderObjectWidget {
void updateRenderObject(RenderSemanticsGestureHandler renderObject, _GestureSemantics oldWidget) {
Map<Type, GestureRecognizer> recognizers = owner._recognizers;
renderObject.onTap = recognizers.containsKey(TapGestureRecognizer) ? _handleTap : null;
renderObject.onLongPress = recognizers.containsKey(LongPressGestureRecognizer) ? _handleLongPress : null;
renderObject.onHorizontalDragUpdate = recognizers.containsKey(VerticalDragGestureRecognizer) ||
recognizers.containsKey(PanGestureRecognizer) ? _handleHorizontalDragUpdate : null;
renderObject.onVerticalDragUpdate = recognizers.containsKey(VerticalDragGestureRecognizer) ||
recognizers.containsKey(PanGestureRecognizer) ? _handleVerticalDragUpdate : null;
renderObject
..onTap = recognizers.containsKey(TapGestureRecognizer) ? _handleTap : null
..onLongPress = recognizers.containsKey(LongPressGestureRecognizer) ? _handleLongPress : null
..onHorizontalDragUpdate = recognizers.containsKey(VerticalDragGestureRecognizer) ||
recognizers.containsKey(PanGestureRecognizer) ? _handleHorizontalDragUpdate : null
..onVerticalDragUpdate = recognizers.containsKey(VerticalDragGestureRecognizer) ||
recognizers.containsKey(PanGestureRecognizer) ? _handleVerticalDragUpdate : null;
}
}
......@@ -62,7 +62,8 @@ class PerformanceOverlay extends LeafRenderObjectWidget {
);
void updateRenderObject(RenderPerformanceOverlay renderObject, RenderObjectWidget oldWidget) {
renderObject.optionsMask = optionsMask;
renderObject.rasterizerThreshold = rasterizerThreshold;
renderObject
..optionsMask = optionsMask
..rasterizerThreshold = rasterizerThreshold;
}
}
......@@ -27,7 +27,8 @@ class SpriteWidget extends OneChildRenderObjectWidget {
SpriteBox createRenderObject() => new SpriteBox(rootNode, transformMode);
void updateRenderObject(SpriteBox renderObject, SpriteWidget oldWidget) {
renderObject.rootNode = rootNode;
renderObject.transformMode = transformMode;
renderObject
..rootNode = rootNode
..transformMode = transformMode;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment