diff --git a/dev/devicelab/test/adb_test.dart b/dev/devicelab/test/adb_test.dart index ca72310e1b..0f7a827a49 100644 --- a/dev/devicelab/test/adb_test.dart +++ b/dev/devicelab/test/adb_test.dart @@ -130,9 +130,9 @@ class CommandArgs { return false; final CommandArgs otherCmd = other; - return otherCmd.command == this.command && - const ListEquality().equals(otherCmd.arguments, this.arguments) && - const MapEquality().equals(otherCmd.environment, this.environment); + return otherCmd.command == command && + const ListEquality().equals(otherCmd.arguments, arguments) && + const MapEquality().equals(otherCmd.environment, environment); } @override diff --git a/examples/flutter_gallery/lib/demo/calculator/home.dart b/examples/flutter_gallery/lib/demo/calculator/home.dart index 2d833c5156..8df9e8c0f1 100644 --- a/examples/flutter_gallery/lib/demo/calculator/home.dart +++ b/examples/flutter_gallery/lib/demo/calculator/home.dart @@ -231,7 +231,7 @@ class KeyRow extends StatelessWidget { return new Expanded( child: new Row( mainAxisAlignment: MainAxisAlignment.center, - children: this.keys + children: keys ) ); } @@ -248,10 +248,10 @@ class CalcKey extends StatelessWidget { final Orientation orientation = MediaQuery.of(context).orientation; return new Expanded( child: new InkResponse( - onTap: this.onTap, + onTap: onTap, child: new Center( child: new Text( - this.text, + text, style: new TextStyle( fontSize: (orientation == Orientation.portrait) ? 32.0 : 24.0 ) diff --git a/examples/flutter_gallery/lib/demo/colors_demo.dart b/examples/flutter_gallery/lib/demo/colors_demo.dart index 9ef44d6ddc..f28b08c6e5 100644 --- a/examples/flutter_gallery/lib/demo/colors_demo.dart +++ b/examples/flutter_gallery/lib/demo/colors_demo.dart @@ -14,7 +14,7 @@ class ColorSwatch { final Map accentColors; final int threshold; // titles for indices > threshold are white, otherwise black - bool get isValid => this.name != null && this.colors != null && threshold != null; + bool get isValid => name != null && colors != null && threshold != null; } final List colorSwatches = [ diff --git a/packages/flutter/lib/src/animation/animations.dart b/packages/flutter/lib/src/animation/animations.dart index 040982e49a..d57321666c 100644 --- a/packages/flutter/lib/src/animation/animations.dart +++ b/packages/flutter/lib/src/animation/animations.dart @@ -592,9 +592,9 @@ abstract class CompoundAnimation extends Animation AnimationStatus _lastStatus; void _maybeNotifyStatusListeners(AnimationStatus _) { - if (this.status != _lastStatus) { - _lastStatus = this.status; - notifyStatusListeners(this.status); + if (status != _lastStatus) { + _lastStatus = status; + notifyStatusListeners(status); } } diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index d0c82f0ab4..02263a0dc4 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -53,8 +53,8 @@ class BottomNavigationBarItem { @required this.title, this.backgroundColor }) { - assert(this.icon != null); - assert(this.title != null); + assert(icon != null); + assert(title != null); } /// The icon of the item. @@ -492,9 +492,9 @@ class _Circle { this.color, @required TickerProvider vsync, }) { - assert(this.state != null); - assert(this.index != null); - assert(this.color != null); + assert(state != null); + assert(index != null); + assert(color != null); controller = new AnimationController( duration: kThemeAnimationDuration, diff --git a/packages/flutter/lib/src/material/expand_icon.dart b/packages/flutter/lib/src/material/expand_icon.dart index 727fe20201..d00c781ba5 100644 --- a/packages/flutter/lib/src/material/expand_icon.dart +++ b/packages/flutter/lib/src/material/expand_icon.dart @@ -28,9 +28,9 @@ class ExpandIcon extends StatefulWidget { @required this.onPressed, this.padding: const EdgeInsets.all(8.0) }) : super(key: key) { - assert(this.isExpanded != null); - assert(this.size != null); - assert(this.padding != null); + assert(isExpanded != null); + assert(size != null); + assert(padding != null); } /// Whether the icon is in an expanded state. diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index ea01ec0ae0..2bfbb11bb0 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart @@ -44,9 +44,9 @@ class ExpansionPanel { @required this.body, this.isExpanded: false }) { - assert(this.headerBuilder != null); - assert(this.body != null); - assert(this.isExpanded != null); + assert(headerBuilder != null); + assert(body != null); + assert(isExpanded != null); } /// The widget builder that builds the expansion panels' header. @@ -79,8 +79,8 @@ class ExpansionPanelList extends StatelessWidget { this.expansionCallback, this.animationDuration: kThemeAnimationDuration }) : super(key: key) { - assert(this.children != null); - assert(this.animationDuration != null); + assert(children != null); + assert(animationDuration != null); } /// The children of the expansion panel list. They are layed in a similar diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart index 7ac5f54805..0ac62ec6bc 100644 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -81,9 +81,9 @@ class Step { this.state: StepState.indexed, this.isActive: false, }) { - assert(this.title != null); - assert(this.content != null); - assert(this.state != null); + assert(title != null); + assert(content != null); + assert(state != null); } /// The title of the step that typically describes it. @@ -138,10 +138,10 @@ class Stepper extends StatefulWidget { this.onStepContinue, this.onStepCancel, }) : super(key: key) { - assert(this.steps != null); - assert(this.type != null); - assert(this.currentStep != null); - assert(0 <= currentStep && currentStep < this.steps.length); + assert(steps != null); + assert(type != null); + assert(currentStep != null); + assert(0 <= currentStep && currentStep < steps.length); } /// The steps of the stepper whose titles, subtitles, icons always get shown. diff --git a/packages/flutter/lib/src/scheduler/ticker.dart b/packages/flutter/lib/src/scheduler/ticker.dart index be7ba6a3ea..82ea376092 100644 --- a/packages/flutter/lib/src/scheduler/ticker.dart +++ b/packages/flutter/lib/src/scheduler/ticker.dart @@ -132,7 +132,7 @@ class Ticker { throw new FlutterError( 'A ticker was started twice.\n' 'A ticker that is already active cannot be started again without first stopping it.\n' - 'The affected ticker was: ${ this.toString(debugIncludeStack: true) }' + 'The affected ticker was: ${ toString(debugIncludeStack: true) }' ); } return true; diff --git a/packages/flutter/lib/src/widgets/animated_cross_fade.dart b/packages/flutter/lib/src/widgets/animated_cross_fade.dart index e6c0847879..07d01e886a 100644 --- a/packages/flutter/lib/src/widgets/animated_cross_fade.dart +++ b/packages/flutter/lib/src/widgets/animated_cross_fade.dart @@ -53,9 +53,9 @@ class AnimatedCrossFade extends StatefulWidget { @required this.crossFadeState, @required this.duration }) : super(key: key) { - assert(this.firstCurve != null); - assert(this.secondCurve != null); - assert(this.sizeCurve != null); + assert(firstCurve != null); + assert(secondCurve != null); + assert(sizeCurve != null); } /// The child that is visible when [crossFadeState] is [showFirst]. It fades diff --git a/packages/flutter/lib/src/widgets/scroll_view.dart b/packages/flutter/lib/src/widgets/scroll_view.dart index f46fff926c..a82941ae4e 100644 --- a/packages/flutter/lib/src/widgets/scroll_view.dart +++ b/packages/flutter/lib/src/widgets/scroll_view.dart @@ -26,10 +26,10 @@ abstract class ScrollView extends StatelessWidget { this.shrinkWrap: false, }) : primary = primary ?? controller == null && scrollDirection == Axis.vertical, super(key: key) { - assert(this.reverse != null); - assert(this.shrinkWrap != null); + assert(reverse != null); + assert(shrinkWrap != null); assert(this.primary != null); - assert(this.controller == null || !this.primary, + assert(controller == null || !this.primary, 'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. ' 'You cannot both set primary to true and pass an explicit controller.' ); diff --git a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart index bfcab84ea6..487f207656 100644 --- a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart @@ -49,9 +49,9 @@ class SingleChildScrollView extends StatelessWidget { this.child, }) : primary = primary ?? controller == null && scrollDirection == Axis.vertical, super(key: key) { - assert(this.scrollDirection != null); + assert(scrollDirection != null); assert(this.primary != null); - assert(this.controller == null || !this.primary, + assert(controller == null || !this.primary, 'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. ' 'You cannot both set primary to true and pass an explicit controller.' ); diff --git a/packages/flutter/test/widgets/dismissable_test.dart b/packages/flutter/test/widgets/dismissable_test.dart index bcae5274c0..d4a6412884 100644 --- a/packages/flutter/test/widgets/dismissable_test.dart +++ b/packages/flutter/test/widgets/dismissable_test.dart @@ -122,7 +122,7 @@ class Test1215DismissableWidget extends StatelessWidget { key: new ObjectKey(text), child: new AspectRatio( aspectRatio: 1.0, - child: new Text(this.text), + child: new Text(text), ), ); } diff --git a/packages/flutter/test/widgets/independent_widget_layout_test.dart b/packages/flutter/test/widgets/independent_widget_layout_test.dart index bc900c6629..7d8ac6edaf 100644 --- a/packages/flutter/test/widgets/independent_widget_layout_test.dart +++ b/packages/flutter/test/widgets/independent_widget_layout_test.dart @@ -73,12 +73,12 @@ class TriggerableState extends State { @override void initState() { super.initState(); - config.trigger.callback = this.fire; + config.trigger.callback = fire; } @override void didUpdateConfig(TriggerableWidget oldConfig) { - config.trigger.callback = this.fire; + config.trigger.callback = fire; } int _count = 0; diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart index f99d31e5f4..818d93d5ef 100644 --- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart @@ -156,11 +156,10 @@ class AssetBundle { } class _Asset { - _Asset({ this.base, String assetEntry, this.relativePath, this.source }) { - this._assetEntry = assetEntry; - } + _Asset({ this.base, String assetEntry, this.relativePath, this.source }) + : _assetEntry = assetEntry; - String _assetEntry; + final String _assetEntry; final String base; diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index 090c2227ec..ea5f7acaa7 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart @@ -15,11 +15,9 @@ import 'globals.dart'; /// A wrapper around the `bin/cache/` directory. class Cache { /// [rootOverride] is configurable for testing. - Cache({ Directory rootOverride }) { - this._rootOverride = rootOverride; - } + Cache({ Directory rootOverride }) : _rootOverride = rootOverride; - Directory _rootOverride; + final Directory _rootOverride; // Initialized by FlutterCommandRunner on startup. static String flutterRoot; diff --git a/packages/flutter_tools/lib/src/commands/drive.dart b/packages/flutter_tools/lib/src/commands/drive.dart index 6c93759ec9..4e7d2bd130 100644 --- a/packages/flutter_tools/lib/src/commands/drive.dart +++ b/packages/flutter_tools/lib/src/commands/drive.dart @@ -89,7 +89,7 @@ class DriveCommand extends RunCommandBase { if (testFile == null) throwToolExit(null); - this._device = await targetDeviceFinder(); + _device = await targetDeviceFinder(); if (device == null) throwToolExit(null);