diff --git a/examples/fitness/lib/feed.dart b/examples/fitness/lib/feed.dart index ac7d09f018b..4bfead463df 100644 --- a/examples/fitness/lib/feed.dart +++ b/examples/fitness/lib/feed.dart @@ -32,10 +32,10 @@ class DialogMenuItem extends ButtonBase { List children; Function onPressed; - void syncFields(DialogMenuItem source) { + void syncConstructorArguments(DialogMenuItem source) { children = source.children; onPressed = source.onPressed; - super.syncFields(source); + super.syncConstructorArguments(source); } Widget buildContent() { @@ -73,7 +73,7 @@ class FeedFragment extends StatefulComponent { super.initState(); } - void syncFields(FeedFragment source) { + void syncConstructorArguments(FeedFragment source) { navigator = source.navigator; userData = source.userData; onItemCreated = source.onItemCreated; @@ -298,7 +298,7 @@ class AddItemDialog extends StatefulComponent { Navigator navigator; - void syncFields(AddItemDialog source) { + void syncConstructorArguments(AddItemDialog source) { this.navigator = source.navigator; } diff --git a/examples/fitness/lib/meal.dart b/examples/fitness/lib/meal.dart index 8969214632c..43a99d58129 100644 --- a/examples/fitness/lib/meal.dart +++ b/examples/fitness/lib/meal.dart @@ -49,7 +49,7 @@ class MealFragment extends StatefulComponent { Navigator navigator; FitnessItemHandler onCreated; - void syncFields(MealFragment source) { + void syncConstructorArguments(MealFragment source) { navigator = source.navigator; onCreated = source.onCreated; } diff --git a/examples/fitness/lib/measurement.dart b/examples/fitness/lib/measurement.dart index ea8e4a9fa6f..cdc0ad44d21 100644 --- a/examples/fitness/lib/measurement.dart +++ b/examples/fitness/lib/measurement.dart @@ -60,7 +60,7 @@ class MeasurementFragment extends StatefulComponent { Navigator navigator; FitnessItemHandler onCreated; - void syncFields(MeasurementFragment source) { + void syncConstructorArguments(MeasurementFragment source) { navigator = source.navigator; onCreated = source.onCreated; } diff --git a/examples/fitness/lib/settings.dart b/examples/fitness/lib/settings.dart index be25ce0666a..4c4e8b0b80a 100644 --- a/examples/fitness/lib/settings.dart +++ b/examples/fitness/lib/settings.dart @@ -17,7 +17,7 @@ class SettingsFragment extends StatefulComponent { UserData userData; SettingsUpdater updater; - void syncFields(SettingsFragment source) { + void syncConstructorArguments(SettingsFragment source) { navigator = source.navigator; userData = source.userData; updater = source.updater; diff --git a/examples/stocks/lib/stock_home.dart b/examples/stocks/lib/stock_home.dart index 43f7f04c383..bbb924b648b 100644 --- a/examples/stocks/lib/stock_home.dart +++ b/examples/stocks/lib/stock_home.dart @@ -17,7 +17,7 @@ class StockHome extends StatefulComponent { StockMode stockMode; ModeUpdater modeUpdater; - void syncFields(StockHome source) { + void syncConstructorArguments(StockHome source) { navigator = source.navigator; stocks = source.stocks; stockMode = source.stockMode; diff --git a/examples/stocks/lib/stock_settings.dart b/examples/stocks/lib/stock_settings.dart index a97fd16ca56..fe75e8a7a84 100644 --- a/examples/stocks/lib/stock_settings.dart +++ b/examples/stocks/lib/stock_settings.dart @@ -18,7 +18,7 @@ class StockSettings extends StatefulComponent { BackupMode backup; SettingsUpdater updater; - void syncFields(StockSettings source) { + void syncConstructorArguments(StockSettings source) { navigator = source.navigator; optimism = source.optimism; backup = source.backup; diff --git a/examples/widgets/drag_and_drop.dart b/examples/widgets/drag_and_drop.dart index 7c2f00f2391..80723b88503 100644 --- a/examples/widgets/drag_and_drop.dart +++ b/examples/widgets/drag_and_drop.dart @@ -19,7 +19,7 @@ class DragData { class ExampleDragTarget extends StatefulComponent { String _text = 'ready'; - void syncFields(ExampleDragTarget source) { + void syncConstructorArguments(ExampleDragTarget source) { } void _handleAccept(DragData data) { diff --git a/sky/packages/sky/lib/editing/editable_text.dart b/sky/packages/sky/lib/editing/editable_text.dart index 9b43313dc1f..4e8bd363aef 100644 --- a/sky/packages/sky/lib/editing/editable_text.dart +++ b/sky/packages/sky/lib/editing/editable_text.dart @@ -29,7 +29,7 @@ class EditableText extends StatefulComponent { TextStyle style; Color cursorColor; - void syncFields(EditableText source) { + void syncConstructorArguments(EditableText source) { value = source.value; focused = source.focused; style = source.style; diff --git a/sky/packages/sky/lib/editing/input.dart b/sky/packages/sky/lib/editing/input.dart index 91fe65a6f02..9a9ac76fa11 100644 --- a/sky/packages/sky/lib/editing/input.dart +++ b/sky/packages/sky/lib/editing/input.dart @@ -44,7 +44,7 @@ class Input extends StatefulComponent { super.initState(); } - void syncFields(Input source) { + void syncConstructorArguments(Input source) { placeholder = source.placeholder; onChanged = source.onChanged; keyboardType = source.keyboardType; diff --git a/sky/packages/sky/lib/widgets/README.md b/sky/packages/sky/lib/widgets/README.md index 3129bf48864..88681eea83e 100644 --- a/sky/packages/sky/lib/widgets/README.md +++ b/sky/packages/sky/lib/widgets/README.md @@ -267,7 +267,7 @@ class MyDialog extends StatefulComponent { }); } - void syncFields(MyDialog source) { + void syncConstructorArguments(MyDialog source) { onDismissed = source.onDismissed; } @@ -319,9 +319,9 @@ Let's walk through the differences in `MyDialog` caused by its being stateful: `build` function, which means the user interface might not update to reflect the changed state. - * `MyDialog` implements the `syncFields` member function. To understand - `syncFields`, we'll need to dive a bit deeper into how the `build` function - is used by the framework. + * `MyDialog` implements the `syncConstructorArguments` member function. To + understand `syncConstructorArguments`, we'll need to dive a bit deeper into + how the `build` function is used by the framework. A component's `build` function returns a tree of widgets that represent a "virtual" description of its appearance. The first time the framework calls @@ -337,28 +337,29 @@ Let's walk through the differences in `MyDialog` caused by its being stateful: hierchy. Old _stateful_ components, however, cannot simply be discarded because they contain state that needs to be preserved. Instead, the old stateful components are retained in the widget hierarchy and asked to - `syncFields` with the new instance of the component created by the parent in - its `build` function. + `syncConstructorArguments` with the new instance of the component created by + the parent in its `build` function. - Without `syncFields`, the new values the parent component passed to the - `MyDialog` constructor in the parent's `build` function would be lost because - they would be stored only as member variables on the new instance of the - component, which is not retained in the component hiearchy. Therefore, the - `syncFields` function in a component should update `this` to account for the - new values the parent passed to `source` because `source` is the authorative - source of those values. + Without `syncConstructorArguments`, the new values the parent component + passed to the `MyDialog` constructor in the parent's `build` function would + be lost because they would be stored only as member variables on the new + instance of the component, which is not retained in the component hiearchy. + Therefore, the `syncConstructorArguments` function in a component should + update `this` to account for the new values the parent passed to `source` + because `source` is the authorative source of those values. By convention, components typically store the values they receive from their parents in public member variables and their own internal state in private - member variables. Therefore, a typical `syncFields` implementation will copy - the public, but not the private, member variables from `source`. When - following this convention, there is no need to copy over the private member - variables because those represent the internal state of the object and `this` - is the authoritative source of that state. + member variables. Therefore, a typical `syncConstructorArguments` + implementation will copy the public, but not the private, member variables + from `source`. When following this convention, there is no need to copy over + the private member variables because those represent the internal state of + the object and `this` is the authoritative source of that state. When implementing a `StatefulComponent`, make sure to call - `super.syncFields(source)` from within your `syncFields()` method, - unless you are extending `StatefulComponent` directly. + `super.syncConstructorArguments(source)` from within your + `syncConstructorArguments()` method, unless you are extending + `StatefulComponent` directly. Finally, when the user taps on the "Save" button, `MyDialog` follows the same pattern as `MyCheckbox` and calls a function passed in by its parent component @@ -382,9 +383,9 @@ efficient (and less error-prone) than initializing that state during the component's constructor because parent executes the component's constructor each time the parent rebuilds even though the framework mounts only the first instance into the widget hierarchy. (Instead of mounting later instances, the -framework passes them to the original instance in `syncFields` so that the first -instance of the component can incorporate the values passed by the parent to the -component's constructor.) +framework passes them to the original instance in `syncConstructorArguments` so +that the first instance of the component can incorporate the values passed by +the parent to the component's constructor.) Components often override `didUnmount` to release resources or to cancel subscriptions to event streams from outside the widget hierachy. When overriding diff --git a/sky/packages/sky/lib/widgets/animated_component.dart b/sky/packages/sky/lib/widgets/animated_component.dart index 7cb047e52d5..977fc485733 100644 --- a/sky/packages/sky/lib/widgets/animated_component.dart +++ b/sky/packages/sky/lib/widgets/animated_component.dart @@ -9,7 +9,7 @@ abstract class AnimatedComponent extends StatefulComponent { AnimatedComponent({ Key key }) : super(key: key); - void syncFields(AnimatedComponent source) { } + void syncConstructorArguments(AnimatedComponent source) { } final List _watchedPerformances = new List(); diff --git a/sky/packages/sky/lib/widgets/animated_container.dart b/sky/packages/sky/lib/widgets/animated_container.dart index cb45dfc8485..8470e5d307d 100644 --- a/sky/packages/sky/lib/widgets/animated_container.dart +++ b/sky/packages/sky/lib/widgets/animated_container.dart @@ -57,7 +57,7 @@ class AnimatedMatrix4Value extends AnimatedValue { abstract class AnimationBehavior { void initFields(AnimatedContainer original); - void syncFields(AnimatedContainer original, AnimatedContainer updated); + void syncConstructorArguments(AnimatedContainer original, AnimatedContainer updated); } class ImplicitlyAnimatedValue { @@ -97,7 +97,7 @@ abstract class ImplicitlyAnimatedFieldBehavior extends AnimationBehavior { _updateField(original, getter(original)); } - void syncFields(AnimatedContainer original, AnimatedContainer updated) { + void syncConstructorArguments(AnimatedContainer original, AnimatedContainer updated) { _updateField(original, getter(updated)); } @@ -213,10 +213,10 @@ class AnimatedContainer extends AnimatedComponent { i.initFields(this); } - void syncFields(AnimatedContainer updated) { + void syncConstructorArguments(AnimatedContainer updated) { child = updated.child; for (AnimationBehavior i in behavior) - i.syncFields(this, updated); + i.syncConstructorArguments(this, updated); } Widget build() { diff --git a/sky/packages/sky/lib/widgets/basic.dart b/sky/packages/sky/lib/widgets/basic.dart index 6606d311849..645411e2f04 100644 --- a/sky/packages/sky/lib/widgets/basic.dart +++ b/sky/packages/sky/lib/widgets/basic.dart @@ -622,7 +622,7 @@ class ImageListener extends StatefulComponent { image.removeListener(_handleImageChanged); } - void syncFields(ImageListener source) { + void syncConstructorArguments(ImageListener source) { final bool needToUpdateListeners = (image != source.image) && mounted; if (needToUpdateListeners) image.removeListener(_handleImageChanged); diff --git a/sky/packages/sky/lib/widgets/button_base.dart b/sky/packages/sky/lib/widgets/button_base.dart index a6a378fd475..7f5aef0bed7 100644 --- a/sky/packages/sky/lib/widgets/button_base.dart +++ b/sky/packages/sky/lib/widgets/button_base.dart @@ -10,7 +10,7 @@ abstract class ButtonBase extends StatefulComponent { bool highlight; - void syncFields(ButtonBase source) { + void syncConstructorArguments(ButtonBase source) { highlight = source.highlight; } diff --git a/sky/packages/sky/lib/widgets/dismissable.dart b/sky/packages/sky/lib/widgets/dismissable.dart index 8f23d585097..6f83ab432cd 100644 --- a/sky/packages/sky/lib/widgets/dismissable.dart +++ b/sky/packages/sky/lib/widgets/dismissable.dart @@ -52,7 +52,7 @@ class Dismissable extends StatefulComponent { _startResizePerformance(); } - void syncFields(Dismissable source) { + void syncConstructorArguments(Dismissable source) { child = source.child; onResized = source.onResized; onDismissed = source.onDismissed; diff --git a/sky/packages/sky/lib/widgets/drag_target.dart b/sky/packages/sky/lib/widgets/drag_target.dart index 7f9402b640a..d7d6d5d1c3c 100644 --- a/sky/packages/sky/lib/widgets/drag_target.dart +++ b/sky/packages/sky/lib/widgets/drag_target.dart @@ -28,7 +28,7 @@ class DragTarget extends StatefulComponent { final List _candidateData = new List(); final List _rejectedData = new List(); - void syncFields(DragTarget source) { + void syncConstructorArguments(DragTarget source) { builder = source.builder; onWillAccept = source.onWillAccept; onAccept = source.onAccept; diff --git a/sky/packages/sky/lib/widgets/drawer.dart b/sky/packages/sky/lib/widgets/drawer.dart index c80db53aca4..400f4643033 100644 --- a/sky/packages/sky/lib/widgets/drawer.dart +++ b/sky/packages/sky/lib/widgets/drawer.dart @@ -75,7 +75,7 @@ class Drawer extends StatefulComponent { } } - void syncFields(Drawer source) { + void syncConstructorArguments(Drawer source) { children = source.children; level = source.level; navigator = source.navigator; diff --git a/sky/packages/sky/lib/widgets/drawer_item.dart b/sky/packages/sky/lib/widgets/drawer_item.dart index eb04c0669e6..f0d0d743b80 100644 --- a/sky/packages/sky/lib/widgets/drawer_item.dart +++ b/sky/packages/sky/lib/widgets/drawer_item.dart @@ -25,12 +25,12 @@ class DrawerItem extends ButtonBase { OnPressedFunction onPressed; bool selected; - void syncFields(DrawerItem source) { + void syncConstructorArguments(DrawerItem source) { icon = source.icon; children = source.children; onPressed = source.onPressed; selected = source.selected; - super.syncFields(source); + super.syncConstructorArguments(source); } TextStyle _getTextStyle(ThemeData themeData) { diff --git a/sky/packages/sky/lib/widgets/floating_action_button.dart b/sky/packages/sky/lib/widgets/floating_action_button.dart index d48be01024c..5375b78fd76 100644 --- a/sky/packages/sky/lib/widgets/floating_action_button.dart +++ b/sky/packages/sky/lib/widgets/floating_action_button.dart @@ -26,8 +26,8 @@ class FloatingActionButton extends ButtonBase { Color backgroundColor; Function onPressed; - void syncFields(FloatingActionButton source) { - super.syncFields(source); + void syncConstructorArguments(FloatingActionButton source) { + super.syncConstructorArguments(source); child = source.child; backgroundColor = source.backgroundColor; onPressed = source.onPressed; diff --git a/sky/packages/sky/lib/widgets/focus.dart b/sky/packages/sky/lib/widgets/focus.dart index ef683f2d80c..f75fb921a2a 100644 --- a/sky/packages/sky/lib/widgets/focus.dart +++ b/sky/packages/sky/lib/widgets/focus.dart @@ -78,7 +78,7 @@ class Focus extends StatefulComponent { bool autofocus; Widget child; - void syncFields(Focus source) { + void syncConstructorArguments(Focus source) { autofocus = source.autofocus; child = source.child; } diff --git a/sky/packages/sky/lib/widgets/framework.dart b/sky/packages/sky/lib/widgets/framework.dart index a234d1c35ec..a82b3104fed 100644 --- a/sky/packages/sky/lib/widgets/framework.dart +++ b/sky/packages/sky/lib/widgets/framework.dart @@ -257,7 +257,7 @@ abstract class Widget { // Subclasses which implements Nodes that become stateful may return true // if the node has become stateful and should be retained. // This is called immediately before _sync(). - // Component.retainStatefulNodeIfPossible() calls syncFields(). + // Component.retainStatefulNodeIfPossible() calls syncConstructorArguments(). bool retainStatefulNodeIfPossible(Widget newNode) => false; void _sync(Widget old, dynamic slot); @@ -737,7 +737,7 @@ abstract class StatefulComponent extends Component { _isStateInitialized = true; } if (old != null) - syncFields(old); + syncConstructorArguments(old); super._sync(old, slot); } @@ -748,9 +748,9 @@ abstract class StatefulComponent extends Component { // This is called by _sync(). Derived classes should override this // method to update `this` to account for the new values the parent - // passed to `source`. Make sure to call super.syncFields(source) + // passed to `source`. Make sure to call super.syncConstructorArguments(source) // unless you are extending StatefulComponent directly. - void syncFields(Component source); + void syncConstructorArguments(Component source); Widget syncChild(Widget node, Widget oldNode, dynamic slot) { assert(!_disqualifiedFromEverAppearingAgain); @@ -1262,7 +1262,7 @@ abstract class App extends StatefulComponent { SkyBinding.instance.removeEventListener(_handleEvent); } - void syncFields(Component source) { } + void syncConstructorArguments(Component source) { } // Override this to handle back button behavior in your app // Call super.onBack() to finish the activity @@ -1278,7 +1278,7 @@ abstract class AbstractWidgetRoot extends StatefulComponent { _scheduleComponentForRender(this); } - void syncFields(AbstractWidgetRoot source) { + void syncConstructorArguments(AbstractWidgetRoot source) { assert(false); // if we get here, it implies that we have a parent } diff --git a/sky/packages/sky/lib/widgets/material_button.dart b/sky/packages/sky/lib/widgets/material_button.dart index d4e27c1fa2f..34a47b004ae 100644 --- a/sky/packages/sky/lib/widgets/material_button.dart +++ b/sky/packages/sky/lib/widgets/material_button.dart @@ -21,11 +21,11 @@ abstract class MaterialButton extends ButtonBase { bool enabled; Function onPressed; - void syncFields(MaterialButton source) { + void syncConstructorArguments(MaterialButton source) { child = source.child; enabled = source.enabled; onPressed = source.onPressed; - super.syncFields(source); + super.syncConstructorArguments(source); } Color get color; diff --git a/sky/packages/sky/lib/widgets/mimic.dart b/sky/packages/sky/lib/widgets/mimic.dart index 99da565c0f2..3968a409dd8 100644 --- a/sky/packages/sky/lib/widgets/mimic.dart +++ b/sky/packages/sky/lib/widgets/mimic.dart @@ -20,7 +20,7 @@ class Mimic extends StatefulComponent { _requestToStartMimic(); } - void syncFields(Mimic source) { + void syncConstructorArguments(Mimic source) { callback = source.callback; if (original != source.original) { _stopMimic(); @@ -87,7 +87,7 @@ class Mimicable extends StatefulComponent { Mimic _mimic; bool _didStartMimic = false; - void syncFields(Mimicable source) { + void syncConstructorArguments(Mimicable source) { child = source.child; } diff --git a/sky/packages/sky/lib/widgets/mimic_overlay.dart b/sky/packages/sky/lib/widgets/mimic_overlay.dart index 4c6dabc0d43..33e6a978a97 100644 --- a/sky/packages/sky/lib/widgets/mimic_overlay.dart +++ b/sky/packages/sky/lib/widgets/mimic_overlay.dart @@ -25,7 +25,7 @@ class MimicOverlay extends AnimatedComponent { Curve curve; Rect targetRect; - void syncFields(MimicOverlay source) { + void syncConstructorArguments(MimicOverlay source) { children = source.children; duration = source.duration; diff --git a/sky/packages/sky/lib/widgets/navigator.dart b/sky/packages/sky/lib/widgets/navigator.dart index 7aeb41a4fc8..c1c48faaead 100644 --- a/sky/packages/sky/lib/widgets/navigator.dart +++ b/sky/packages/sky/lib/widgets/navigator.dart @@ -138,7 +138,7 @@ class Navigator extends StatefulComponent { NavigationState state; - void syncFields(Navigator source) { + void syncConstructorArguments(Navigator source) { state = source.state; } diff --git a/sky/packages/sky/lib/widgets/popup_menu.dart b/sky/packages/sky/lib/widgets/popup_menu.dart index d678b96b3da..b2b6d5eacc0 100644 --- a/sky/packages/sky/lib/widgets/popup_menu.dart +++ b/sky/packages/sky/lib/widgets/popup_menu.dart @@ -58,7 +58,7 @@ class PopupMenu extends StatefulComponent { _open(); } - void syncFields(PopupMenu source) { + void syncConstructorArguments(PopupMenu source) { if (!showing && source.showing) _open(); showing = source.showing; diff --git a/sky/packages/sky/lib/widgets/progress_indicator.dart b/sky/packages/sky/lib/widgets/progress_indicator.dart index d766693b776..30ca034fe2c 100644 --- a/sky/packages/sky/lib/widgets/progress_indicator.dart +++ b/sky/packages/sky/lib/widgets/progress_indicator.dart @@ -38,7 +38,7 @@ abstract class ProgressIndicator extends StatefulComponent { ..variable = new AnimatedValue(0.0, end: 1.0, curve: ease); } - void syncFields(ProgressIndicator source) { + void syncConstructorArguments(ProgressIndicator source) { value = source.value; bufferValue = source.bufferValue; } diff --git a/sky/packages/sky/lib/widgets/radio.dart b/sky/packages/sky/lib/widgets/radio.dart index abad4085d1e..277d20cb528 100644 --- a/sky/packages/sky/lib/widgets/radio.dart +++ b/sky/packages/sky/lib/widgets/radio.dart @@ -27,11 +27,11 @@ class Radio extends ButtonBase { Object groupValue; RadioValueChanged onChanged; - void syncFields(Radio source) { + void syncConstructorArguments(Radio source) { value = source.value; groupValue = source.groupValue; onChanged = source.onChanged; - super.syncFields(source); + super.syncConstructorArguments(source); } Color get color { diff --git a/sky/packages/sky/lib/widgets/scrollable.dart b/sky/packages/sky/lib/widgets/scrollable.dart index 9e977fc08e0..a761fd03812 100644 --- a/sky/packages/sky/lib/widgets/scrollable.dart +++ b/sky/packages/sky/lib/widgets/scrollable.dart @@ -55,7 +55,7 @@ abstract class Scrollable extends StatefulComponent { }); } - void syncFields(Scrollable source) { + void syncConstructorArguments(Scrollable source) { scrollDirection = source.scrollDirection; } @@ -266,9 +266,9 @@ class ScrollableViewport extends Scrollable { Widget child; - void syncFields(ScrollableViewport source) { + void syncConstructorArguments(ScrollableViewport source) { child = source.child; - super.syncFields(source); + super.syncConstructorArguments(source); } ScrollBehavior createScrollBehavior() => new OverscrollWhenScrollableBehavior(); @@ -357,7 +357,7 @@ abstract class ScrollableWidgetList extends Scrollable { int get itemCount; int _previousItemCount; - void syncFields(ScrollableWidgetList source) { + void syncConstructorArguments(ScrollableWidgetList source) { bool scrollBehaviorUpdateNeeded = padding != source.padding || itemExtent != source.itemExtent || @@ -365,7 +365,7 @@ abstract class ScrollableWidgetList extends Scrollable { padding = source.padding; itemExtent = source.itemExtent; - super.syncFields(source); // update scrollDirection + super.syncConstructorArguments(source); // update scrollDirection if (itemCount != _previousItemCount) { scrollBehaviorUpdateNeeded = true; @@ -508,10 +508,10 @@ class ScrollableList extends ScrollableWidgetList { List items; ItemBuilder itemBuilder; - void syncFields(ScrollableList source) { + void syncConstructorArguments(ScrollableList source) { items = source.items; itemBuilder = source.itemBuilder; - super.syncFields(source); + super.syncConstructorArguments(source); } int get itemCount => items.length; @@ -547,10 +547,10 @@ class PageableList extends ScrollableList { Duration duration; Curve curve; - void syncFields(PageableList source) { + void syncConstructorArguments(PageableList source) { duration = source.duration; curve = source.curve; - super.syncFields(source); + super.syncConstructorArguments(source); } double _snapScrollOffset(double newScrollOffset) { @@ -617,7 +617,7 @@ class ScrollableMixedWidgetList extends Scrollable { super.didUnmount(); } - void syncFields(ScrollableMixedWidgetList source) { + void syncConstructorArguments(ScrollableMixedWidgetList source) { builder = source.builder; if (token != source.token) _contentsChanged = true; @@ -629,7 +629,7 @@ class ScrollableMixedWidgetList extends Scrollable { layoutState = source.layoutState; layoutState.addListener(_handleLayoutChanged); } - super.syncFields(source); + super.syncConstructorArguments(source); } ScrollBehavior createScrollBehavior() => new OverscrollBehavior(); diff --git a/sky/packages/sky/lib/widgets/tabs.dart b/sky/packages/sky/lib/widgets/tabs.dart index 06db9efb54a..86ac7b693f2 100644 --- a/sky/packages/sky/lib/widgets/tabs.dart +++ b/sky/packages/sky/lib/widgets/tabs.dart @@ -416,8 +416,8 @@ class TabBar extends Scrollable { ..variable = new AnimatedRect(null, curve: ease); } - void syncFields(TabBar source) { - super.syncFields(source); + void syncConstructorArguments(TabBar source) { + super.syncConstructorArguments(source); labels = source.labels; selectedIndex = source.selectedIndex; onChanged = source.onChanged; diff --git a/sky/packages/sky/lib/widgets/transitions.dart b/sky/packages/sky/lib/widgets/transitions.dart index 39cf34bc3f5..d7bc35acab4 100644 --- a/sky/packages/sky/lib/widgets/transitions.dart +++ b/sky/packages/sky/lib/widgets/transitions.dart @@ -42,14 +42,14 @@ class _AnchorTransition extends AnimatedComponent { watch(transition.performance); } - void syncFields(_AnchorTransition source) { + void syncConstructorArguments(_AnchorTransition source) { if (transition != null && isWatching(transition.performance)) unwatch(transition.performance); anchoredTo = source.anchoredTo; if (transition != null) watch(transition.performance); child = source.child; - super.syncFields(source); + super.syncConstructorArguments(source); } Widget build() { @@ -95,7 +95,7 @@ abstract class TransitionBase extends AnimatedComponent { _start(); } - void syncFields(TransitionBase source) { + void syncConstructorArguments(TransitionBase source) { child = source.child; onCompleted = source.onCompleted; onDismissed = source.onDismissed; @@ -104,7 +104,7 @@ abstract class TransitionBase extends AnimatedComponent { direction = source.direction; _start(); } - super.syncFields(source); + super.syncConstructorArguments(source); } void _start() { @@ -152,9 +152,9 @@ class SlideTransition extends TransitionBase { AnimatedValue position; - void syncFields(SlideTransition source) { + void syncConstructorArguments(SlideTransition source) { position = source.position; - super.syncFields(source); + super.syncConstructorArguments(source); } Widget buildWithChild(Widget child) { @@ -187,9 +187,9 @@ class FadeTransition extends TransitionBase { AnimatedValue opacity; - void syncFields(FadeTransition source) { + void syncConstructorArguments(FadeTransition source) { opacity = source.opacity; - super.syncFields(source); + super.syncConstructorArguments(source); } Widget buildWithChild(Widget child) { @@ -220,9 +220,9 @@ class ColorTransition extends TransitionBase { AnimatedColorValue color; - void syncFields(ColorTransition source) { + void syncConstructorArguments(ColorTransition source) { color = source.color; - super.syncFields(source); + super.syncConstructorArguments(source); } Widget buildWithChild(Widget child) { @@ -258,10 +258,10 @@ class SquashTransition extends TransitionBase { AnimatedValue width; AnimatedValue height; - void syncFields(SquashTransition source) { + void syncConstructorArguments(SquashTransition source) { width = source.width; height = source.height; - super.syncFields(source); + super.syncConstructorArguments(source); } Widget buildWithChild(Widget child) { @@ -299,10 +299,10 @@ class BuilderTransition extends TransitionBase { List variables; BuilderFunction builder; - void syncFields(BuilderTransition source) { + void syncConstructorArguments(BuilderTransition source) { variables = source.variables; builder = source.builder; - super.syncFields(source); + super.syncConstructorArguments(source); } Widget buildWithChild(Widget child) { diff --git a/sky/tests/widgets/stack_relayout_from_parent_data.dart b/sky/tests/widgets/stack_relayout_from_parent_data.dart index 90ec6af724a..f680cdddf84 100644 --- a/sky/tests/widgets/stack_relayout_from_parent_data.dart +++ b/sky/tests/widgets/stack_relayout_from_parent_data.dart @@ -21,7 +21,7 @@ class ChildComponent extends Component { class ParentComponent extends StatefulComponent { Size _size = new Size(100.0, 100.0); - void syncFields(ParentComponent source) { + void syncConstructorArguments(ParentComponent source) { } Widget build() { diff --git a/sky/tests/widgets/syncs2.dart b/sky/tests/widgets/syncs2.dart index ddc0c722844..c2c31a061cc 100644 --- a/sky/tests/widgets/syncs2.dart +++ b/sky/tests/widgets/syncs2.dart @@ -10,7 +10,7 @@ import '../resources/display_list.dart'; class ProblemComponent extends StatefulComponent { - void syncFields(ProblemComponent source) { } + void syncConstructorArguments(ProblemComponent source) { } bool _flag = false;