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