diff --git a/examples/mine_digger/lib/main.dart b/examples/mine_digger/lib/main.dart index dd1c3982bae..bd1fff8e9e7 100644 --- a/examples/mine_digger/lib/main.dart +++ b/examples/mine_digger/lib/main.dart @@ -54,8 +54,8 @@ class MineDiggerState extends State { // |uiState| keeps track of the visible player progess. List> uiState; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); resetGame(); } diff --git a/examples/stocks/lib/main.dart b/examples/stocks/lib/main.dart index 8effe098f6d..361c5966de5 100644 --- a/examples/stocks/lib/main.dart +++ b/examples/stocks/lib/main.dart @@ -34,8 +34,8 @@ class StocksAppState extends State { final Map _stocks = {}; final List _symbols = []; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); new StockDataFetcher((StockData data) { setState(() { data.appendTo(_stocks, _symbols); diff --git a/examples/widgets/card_collection.dart b/examples/widgets/card_collection.dart index 22c2e2c39eb..9dbeca792ea 100644 --- a/examples/widgets/card_collection.dart +++ b/examples/widgets/card_collection.dart @@ -65,8 +65,8 @@ class CardCollectionAppState extends State { _initVariableSizedCardModels(); } - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _initCardModels(); } @@ -264,7 +264,6 @@ class CardCollectionAppState extends State { }) .toList(); - double offset; for (int i = 0; i < cumulativeHeights.length; i++) { if (cumulativeHeights[i] >= scrollOffset) return 12.0 + (margins + _cardModels[i].height) / 2.0 + ((i == 0) ? 0.0 : cumulativeHeights[i - 1]); diff --git a/examples/widgets/date_picker.dart b/examples/widgets/date_picker.dart index 0fec33c9f8e..42688c409a5 100644 --- a/examples/widgets/date_picker.dart +++ b/examples/widgets/date_picker.dart @@ -12,8 +12,8 @@ class DatePickerDemo extends StatefulComponent { } class DatePickerDemoState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); DateTime now = new DateTime.now(); _dateTime = new DateTime(now.year, now.month, now.day); } diff --git a/examples/widgets/pageable_list.dart b/examples/widgets/pageable_list.dart index 9d3012fd6c7..2dd6fe6c8cd 100644 --- a/examples/widgets/pageable_list.dart +++ b/examples/widgets/pageable_list.dart @@ -21,8 +21,8 @@ class PageableListApp extends StatefulComponent { } class PageableListAppState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); List cardSizes = [ [100.0, 300.0], [300.0, 100.0], [200.0, 400.0], [400.0, 400.0], [300.0, 400.0] ] diff --git a/examples/widgets/progress_indicator.dart b/examples/widgets/progress_indicator.dart index 00d3f28df08..f62c9e2ef73 100644 --- a/examples/widgets/progress_indicator.dart +++ b/examples/widgets/progress_indicator.dart @@ -11,8 +11,8 @@ class ProgressIndicatorApp extends StatefulComponent { } class ProgressIndicatorAppState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); valueAnimation = new ValueAnimation() ..duration = const Duration(milliseconds: 1500) ..variable = new AnimatedValue( diff --git a/examples/widgets/scale.dart b/examples/widgets/scale.dart index d100016db5b..2a6d7132678 100644 --- a/examples/widgets/scale.dart +++ b/examples/widgets/scale.dart @@ -11,8 +11,8 @@ class ScaleApp extends StatefulComponent { } class ScaleAppState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _offset = Offset.zero; _zoom = 1.0; } diff --git a/examples/widgets/styled_text.dart b/examples/widgets/styled_text.dart index 1191648c11f..6d3b9790bff 100644 --- a/examples/widgets/styled_text.dart +++ b/examples/widgets/styled_text.dart @@ -11,8 +11,8 @@ class StyledTextApp extends StatefulComponent { } class StyledTextAppState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); toText = toStyledText; nameLines = dialogText .split('\n') diff --git a/packages/flutter/lib/src/fn3/animated_component.dart b/packages/flutter/lib/src/fn3/animated_component.dart index 7ce8bd57409..a795d2c0fec 100644 --- a/packages/flutter/lib/src/fn3/animated_component.dart +++ b/packages/flutter/lib/src/fn3/animated_component.dart @@ -13,8 +13,8 @@ abstract class AnimatedComponent extends StatefulComponent { } abstract class AnimatedState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _performance = new AnimationPerformance(duration: config.duration); performance.addStatusListener(_handleAnimationStatusChanged); if (buildDependsOnPerformance) { diff --git a/packages/flutter/lib/src/fn3/app.dart b/packages/flutter/lib/src/fn3/app.dart index 9ae1cf68112..b181d5c2587 100644 --- a/packages/flutter/lib/src/fn3/app.dart +++ b/packages/flutter/lib/src/fn3/app.dart @@ -46,8 +46,8 @@ class AppState extends State { GlobalObjectKey _navigator; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _navigator = new GlobalObjectKey(this); WidgetFlutterBinding.instance.addEventListener(_backHandler); } @@ -86,4 +86,4 @@ class AppState extends State { ); } -} \ No newline at end of file +} diff --git a/packages/flutter/lib/src/fn3/basic.dart b/packages/flutter/lib/src/fn3/basic.dart index 60521444556..a1d2d34a6a2 100644 --- a/packages/flutter/lib/src/fn3/basic.dart +++ b/packages/flutter/lib/src/fn3/basic.dart @@ -754,8 +754,8 @@ class ImageListener extends StatefulComponent { } class ImageListenerState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); config.image.addListener(_handleImageChanged); } diff --git a/packages/flutter/lib/src/fn3/date_picker.dart b/packages/flutter/lib/src/fn3/date_picker.dart index ba828370c80..4e431748c14 100644 --- a/packages/flutter/lib/src/fn3/date_picker.dart +++ b/packages/flutter/lib/src/fn3/date_picker.dart @@ -294,8 +294,8 @@ class MonthPicker extends ScrollableWidgetList { } class MonthPickerState extends ScrollableWidgetListState { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _updateCurrentDate(); } diff --git a/packages/flutter/lib/src/fn3/dismissable.dart b/packages/flutter/lib/src/fn3/dismissable.dart index c0e87de6aa3..8dc356e20a8 100644 --- a/packages/flutter/lib/src/fn3/dismissable.dart +++ b/packages/flutter/lib/src/fn3/dismissable.dart @@ -48,8 +48,8 @@ class Dismissable extends StatefulComponent { } class DismissableState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _fadePerformance = new AnimationPerformance(duration: _kCardDismissFadeout); _fadePerformance.addStatusListener((AnimationStatus status) { if (status == AnimationStatus.completed) diff --git a/packages/flutter/lib/src/fn3/drawer.dart b/packages/flutter/lib/src/fn3/drawer.dart index 4b2eceb9127..e79187477a4 100644 --- a/packages/flutter/lib/src/fn3/drawer.dart +++ b/packages/flutter/lib/src/fn3/drawer.dart @@ -57,8 +57,8 @@ class Drawer extends StatefulComponent { } class DrawerState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _performance = new AnimationPerformance(duration: _kBaseSettleDuration); _performance.addStatusListener((AnimationStatus status) { if (status == AnimationStatus.dismissed) diff --git a/packages/flutter/lib/src/fn3/focus.dart b/packages/flutter/lib/src/fn3/focus.dart index 384b222f568..f74e5ad1f91 100644 --- a/packages/flutter/lib/src/fn3/focus.dart +++ b/packages/flutter/lib/src/fn3/focus.dart @@ -152,8 +152,8 @@ class FocusState extends State { } } - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); if (config.autofocus) FocusState._moveScopeTo(context, config); _updateWidgetRemovalListener(_focusedWidget); diff --git a/packages/flutter/lib/src/fn3/framework.dart b/packages/flutter/lib/src/fn3/framework.dart index e391f35a3f2..45146394922 100644 --- a/packages/flutter/lib/src/fn3/framework.dart +++ b/packages/flutter/lib/src/fn3/framework.dart @@ -306,8 +306,8 @@ abstract class State { /// object was inserted into the tree or on the widget configuration object. /// /// If you override this, make sure your method starts with a call to - /// super.initState(context). - void initState(BuildContext context) { + /// super.initState(). + void initState() { assert(_debugLifecycleState == _StateLifecycle.created); assert(() { _debugLifecycleState = _StateLifecycle.initialized; return true; }); } @@ -834,7 +834,7 @@ class StatefulComponentElement extends BuildableElement { assert(_state._debugLifecycleState == _StateLifecycle.created); try { _debugSetAllowIgnoredCallsToMarkNeedsBuild(true); - _state.initState(this); + _state.initState(); } finally { _debugSetAllowIgnoredCallsToMarkNeedsBuild(false); } diff --git a/packages/flutter/lib/src/fn3/gesture_detector.dart b/packages/flutter/lib/src/fn3/gesture_detector.dart index b15c122effb..ad3582d4105 100644 --- a/packages/flutter/lib/src/fn3/gesture_detector.dart +++ b/packages/flutter/lib/src/fn3/gesture_detector.dart @@ -55,8 +55,8 @@ class GestureDetector extends StatefulComponent { } class GestureDetectorState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); didUpdateConfig(null); } diff --git a/packages/flutter/lib/src/fn3/input.dart b/packages/flutter/lib/src/fn3/input.dart index 2717f69040d..2f9d9d470ec 100644 --- a/packages/flutter/lib/src/fn3/input.dart +++ b/packages/flutter/lib/src/fn3/input.dart @@ -50,8 +50,8 @@ class InputState extends ScrollableState { double _contentWidth = 0.0; double _containerWidth = 0.0; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _value = config.initialValue; _editableValue = new EditableString( text: _value, diff --git a/packages/flutter/lib/src/fn3/navigator.dart b/packages/flutter/lib/src/fn3/navigator.dart index d69fd1becb3..6de2d6b1b7e 100644 --- a/packages/flutter/lib/src/fn3/navigator.dart +++ b/packages/flutter/lib/src/fn3/navigator.dart @@ -39,8 +39,8 @@ class NavigatorState extends State { Route get currentRoute => _history[_currentPosition]; bool get hasPreviousRoute => _history.length > 1; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); PageRoute route = new PageRoute(config.routes['/']); assert(route != null); assert(!route.ephemeral); @@ -187,7 +187,7 @@ abstract class Route { /// ephemeral, modal, and opaque are ignored. This is useful if the route /// represents some state handled by another widget. See /// NavigatorState.pushState(). - /// + /// /// Set hasContent to false if you have nothing useful to return from build(). /// /// modal must be false if hasContent is false, since otherwise any @@ -229,7 +229,7 @@ abstract class Route { /// Set this to true if there's no reason to build and paint the route behind /// you when your transition is finished, and set it to false if you do not /// cover the entire application surface or are in any way semi-transparent. - bool get opaque => false; + bool get opaque => false; /// If this is set to a non-zero [Duration], then an [AnimationPerformance] /// object, available via the performance field, will be created when the diff --git a/packages/flutter/lib/src/fn3/popup_menu.dart b/packages/flutter/lib/src/fn3/popup_menu.dart index a64d214930a..10520687047 100644 --- a/packages/flutter/lib/src/fn3/popup_menu.dart +++ b/packages/flutter/lib/src/fn3/popup_menu.dart @@ -50,8 +50,8 @@ class PopupMenu extends StatefulComponent { } class PopupMenuState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); config.performance.addListener(_performanceChanged); } diff --git a/packages/flutter/lib/src/fn3/progress_indicator.dart b/packages/flutter/lib/src/fn3/progress_indicator.dart index 99c1663024d..5c9eccee62f 100644 --- a/packages/flutter/lib/src/fn3/progress_indicator.dart +++ b/packages/flutter/lib/src/fn3/progress_indicator.dart @@ -35,8 +35,8 @@ abstract class ProgressIndicator extends StatefulComponent { } class ProgressIndicatorState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _performance = new AnimationPerformance() ..duration = const Duration(milliseconds: 1500) ..variable = new AnimatedValue(0.0, end: 1.0, curve: ease); diff --git a/packages/flutter/lib/src/fn3/scrollable.dart b/packages/flutter/lib/src/fn3/scrollable.dart index db8ab10ecfb..4e9dd3c2426 100644 --- a/packages/flutter/lib/src/fn3/scrollable.dart +++ b/packages/flutter/lib/src/fn3/scrollable.dart @@ -47,8 +47,8 @@ abstract class Scrollable extends StatefulComponent { } abstract class ScrollableState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); if (config.initialScrollOffset is double) _scrollOffset = config.initialScrollOffset; _toEndAnimation = new AnimatedSimulation(_setScrollOffset); @@ -672,8 +672,8 @@ class ScrollableMixedWidgetList extends Scrollable { } class ScrollableMixedWidgetListState extends ScrollableState { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); scrollBehavior.updateExtents( contentExtent: double.INFINITY ); diff --git a/packages/flutter/lib/src/fn3/tabs.dart b/packages/flutter/lib/src/fn3/tabs.dart index 96faf70e425..1ef29058232 100644 --- a/packages/flutter/lib/src/fn3/tabs.dart +++ b/packages/flutter/lib/src/fn3/tabs.dart @@ -401,8 +401,8 @@ class TabBar extends Scrollable { } class TabBarState extends ScrollableState { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _indicatorAnimation = new ValueAnimation() ..duration = _kTabBarScroll ..variable = new AnimatedRect(null, curve: ease); diff --git a/packages/flutter/lib/src/fn3/transitions.dart b/packages/flutter/lib/src/fn3/transitions.dart index 902db33f4bf..87089c271cf 100644 --- a/packages/flutter/lib/src/fn3/transitions.dart +++ b/packages/flutter/lib/src/fn3/transitions.dart @@ -25,8 +25,8 @@ abstract class TransitionComponent extends StatefulComponent { } class TransitionState extends State { - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); config.performance.addListener(_performanceChanged); } diff --git a/packages/unit/test/widget/build_scope_test.dart b/packages/unit/test/widget/build_scope_test.dart index e7d9eb55786..1ae79788bf6 100644 --- a/packages/unit/test/widget/build_scope_test.dart +++ b/packages/unit/test/widget/build_scope_test.dart @@ -11,8 +11,8 @@ class ProbeWidget extends StatefulComponent { class ProbeWidgetState extends State { static int buildCount = 0; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); setState(() {}); } diff --git a/packages/unit/test/widget/scrollable_list_hit_testing_test.dart b/packages/unit/test/widget/scrollable_list_hit_testing_test.dart index 43dd00bb386..308ead5062d 100644 --- a/packages/unit/test/widget/scrollable_list_hit_testing_test.dart +++ b/packages/unit/test/widget/scrollable_list_hit_testing_test.dart @@ -1,4 +1,3 @@ -import 'package:quiver/testing/async.dart'; import 'package:sky/rendering.dart'; import 'package:sky/src/fn3.dart'; import 'package:test/test.dart'; @@ -8,10 +7,6 @@ import '../fn3/widget_tester.dart'; const List items = const [0, 1, 2, 3, 4, 5]; List tapped = []; -Widget buildFrame() { - return ; -} - void main() { double t = 0.0; WidgetTester tester = new WidgetTester(); diff --git a/packages/unit/test/widget/scrollable_list_horizontal_test.dart b/packages/unit/test/widget/scrollable_list_horizontal_test.dart index e55209d3a3a..16c936836f4 100644 --- a/packages/unit/test/widget/scrollable_list_horizontal_test.dart +++ b/packages/unit/test/widget/scrollable_list_horizontal_test.dart @@ -1,4 +1,3 @@ -import 'package:quiver/testing/async.dart'; import 'package:sky/rendering.dart'; import 'package:sky/src/fn3.dart'; import 'package:test/test.dart'; diff --git a/packages/unit/test/widget/scrollable_list_vertical_test.dart b/packages/unit/test/widget/scrollable_list_vertical_test.dart index 358bea52f26..f805e293380 100644 --- a/packages/unit/test/widget/scrollable_list_vertical_test.dart +++ b/packages/unit/test/widget/scrollable_list_vertical_test.dart @@ -1,4 +1,3 @@ -import 'package:quiver/testing/async.dart'; import 'package:sky/src/fn3.dart'; import 'package:test/test.dart'; diff --git a/packages/unit/test/widget/set_state_3_test.dart b/packages/unit/test/widget/set_state_3_test.dart index f36d6093bf7..98fcea6d49a 100644 --- a/packages/unit/test/widget/set_state_3_test.dart +++ b/packages/unit/test/widget/set_state_3_test.dart @@ -20,8 +20,8 @@ class Changer extends StatefulComponent { class ChangerState extends State { bool _state = false; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); changer = this; } diff --git a/packages/unit/test/widget/stateful_components_test.dart b/packages/unit/test/widget/stateful_components_test.dart index c83653ace52..7eda7c44c49 100644 --- a/packages/unit/test/widget/stateful_components_test.dart +++ b/packages/unit/test/widget/stateful_components_test.dart @@ -11,8 +11,8 @@ class InnerComponent extends StatefulComponent { class InnerComponentState extends State { bool _didInitState = false; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); _didInitState = true; } diff --git a/packages/unit/test/widget/syncing_test.dart b/packages/unit/test/widget/syncing_test.dart index 6e96d822b9c..d666d2eaf83 100644 --- a/packages/unit/test/widget/syncing_test.dart +++ b/packages/unit/test/widget/syncing_test.dart @@ -18,8 +18,8 @@ class TestWidgetState extends State { int syncedState; int updates = 0; - void initState(BuildContext context) { - super.initState(context); + void initState() { + super.initState(); persistentState = config.persistentState; syncedState = config.syncedState; }