Commit a0769f24 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

apply the upcoming rule unnecessary_this (#8838)

parent 90aa2957
...@@ -130,9 +130,9 @@ class CommandArgs { ...@@ -130,9 +130,9 @@ class CommandArgs {
return false; return false;
final CommandArgs otherCmd = other; final CommandArgs otherCmd = other;
return otherCmd.command == this.command && return otherCmd.command == command &&
const ListEquality<String>().equals(otherCmd.arguments, this.arguments) && const ListEquality<String>().equals(otherCmd.arguments, arguments) &&
const MapEquality<String, String>().equals(otherCmd.environment, this.environment); const MapEquality<String, String>().equals(otherCmd.environment, environment);
} }
@override @override
......
...@@ -231,7 +231,7 @@ class KeyRow extends StatelessWidget { ...@@ -231,7 +231,7 @@ class KeyRow extends StatelessWidget {
return new Expanded( return new Expanded(
child: new Row( child: new Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: this.keys children: keys
) )
); );
} }
...@@ -248,10 +248,10 @@ class CalcKey extends StatelessWidget { ...@@ -248,10 +248,10 @@ class CalcKey extends StatelessWidget {
final Orientation orientation = MediaQuery.of(context).orientation; final Orientation orientation = MediaQuery.of(context).orientation;
return new Expanded( return new Expanded(
child: new InkResponse( child: new InkResponse(
onTap: this.onTap, onTap: onTap,
child: new Center( child: new Center(
child: new Text( child: new Text(
this.text, text,
style: new TextStyle( style: new TextStyle(
fontSize: (orientation == Orientation.portrait) ? 32.0 : 24.0 fontSize: (orientation == Orientation.portrait) ? 32.0 : 24.0
) )
......
...@@ -14,7 +14,7 @@ class ColorSwatch { ...@@ -14,7 +14,7 @@ class ColorSwatch {
final Map<int, Color> accentColors; final Map<int, Color> accentColors;
final int threshold; // titles for indices > threshold are white, otherwise black 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<ColorSwatch> colorSwatches = <ColorSwatch>[ final List<ColorSwatch> colorSwatches = <ColorSwatch>[
......
...@@ -592,9 +592,9 @@ abstract class CompoundAnimation<T> extends Animation<T> ...@@ -592,9 +592,9 @@ abstract class CompoundAnimation<T> extends Animation<T>
AnimationStatus _lastStatus; AnimationStatus _lastStatus;
void _maybeNotifyStatusListeners(AnimationStatus _) { void _maybeNotifyStatusListeners(AnimationStatus _) {
if (this.status != _lastStatus) { if (status != _lastStatus) {
_lastStatus = this.status; _lastStatus = status;
notifyStatusListeners(this.status); notifyStatusListeners(status);
} }
} }
......
...@@ -53,8 +53,8 @@ class BottomNavigationBarItem { ...@@ -53,8 +53,8 @@ class BottomNavigationBarItem {
@required this.title, @required this.title,
this.backgroundColor this.backgroundColor
}) { }) {
assert(this.icon != null); assert(icon != null);
assert(this.title != null); assert(title != null);
} }
/// The icon of the item. /// The icon of the item.
...@@ -492,9 +492,9 @@ class _Circle { ...@@ -492,9 +492,9 @@ class _Circle {
this.color, this.color,
@required TickerProvider vsync, @required TickerProvider vsync,
}) { }) {
assert(this.state != null); assert(state != null);
assert(this.index != null); assert(index != null);
assert(this.color != null); assert(color != null);
controller = new AnimationController( controller = new AnimationController(
duration: kThemeAnimationDuration, duration: kThemeAnimationDuration,
......
...@@ -28,9 +28,9 @@ class ExpandIcon extends StatefulWidget { ...@@ -28,9 +28,9 @@ class ExpandIcon extends StatefulWidget {
@required this.onPressed, @required this.onPressed,
this.padding: const EdgeInsets.all(8.0) this.padding: const EdgeInsets.all(8.0)
}) : super(key: key) { }) : super(key: key) {
assert(this.isExpanded != null); assert(isExpanded != null);
assert(this.size != null); assert(size != null);
assert(this.padding != null); assert(padding != null);
} }
/// Whether the icon is in an expanded state. /// Whether the icon is in an expanded state.
......
...@@ -44,9 +44,9 @@ class ExpansionPanel { ...@@ -44,9 +44,9 @@ class ExpansionPanel {
@required this.body, @required this.body,
this.isExpanded: false this.isExpanded: false
}) { }) {
assert(this.headerBuilder != null); assert(headerBuilder != null);
assert(this.body != null); assert(body != null);
assert(this.isExpanded != null); assert(isExpanded != null);
} }
/// The widget builder that builds the expansion panels' header. /// The widget builder that builds the expansion panels' header.
...@@ -79,8 +79,8 @@ class ExpansionPanelList extends StatelessWidget { ...@@ -79,8 +79,8 @@ class ExpansionPanelList extends StatelessWidget {
this.expansionCallback, this.expansionCallback,
this.animationDuration: kThemeAnimationDuration this.animationDuration: kThemeAnimationDuration
}) : super(key: key) { }) : super(key: key) {
assert(this.children != null); assert(children != null);
assert(this.animationDuration != null); assert(animationDuration != null);
} }
/// The children of the expansion panel list. They are layed in a similar /// The children of the expansion panel list. They are layed in a similar
......
...@@ -81,9 +81,9 @@ class Step { ...@@ -81,9 +81,9 @@ class Step {
this.state: StepState.indexed, this.state: StepState.indexed,
this.isActive: false, this.isActive: false,
}) { }) {
assert(this.title != null); assert(title != null);
assert(this.content != null); assert(content != null);
assert(this.state != null); assert(state != null);
} }
/// The title of the step that typically describes it. /// The title of the step that typically describes it.
...@@ -138,10 +138,10 @@ class Stepper extends StatefulWidget { ...@@ -138,10 +138,10 @@ class Stepper extends StatefulWidget {
this.onStepContinue, this.onStepContinue,
this.onStepCancel, this.onStepCancel,
}) : super(key: key) { }) : super(key: key) {
assert(this.steps != null); assert(steps != null);
assert(this.type != null); assert(type != null);
assert(this.currentStep != null); assert(currentStep != null);
assert(0 <= currentStep && currentStep < this.steps.length); assert(0 <= currentStep && currentStep < steps.length);
} }
/// The steps of the stepper whose titles, subtitles, icons always get shown. /// The steps of the stepper whose titles, subtitles, icons always get shown.
......
...@@ -132,7 +132,7 @@ class Ticker { ...@@ -132,7 +132,7 @@ class Ticker {
throw new FlutterError( throw new FlutterError(
'A ticker was started twice.\n' 'A ticker was started twice.\n'
'A ticker that is already active cannot be started again without first stopping it.\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; return true;
......
...@@ -53,9 +53,9 @@ class AnimatedCrossFade extends StatefulWidget { ...@@ -53,9 +53,9 @@ class AnimatedCrossFade extends StatefulWidget {
@required this.crossFadeState, @required this.crossFadeState,
@required this.duration @required this.duration
}) : super(key: key) { }) : super(key: key) {
assert(this.firstCurve != null); assert(firstCurve != null);
assert(this.secondCurve != null); assert(secondCurve != null);
assert(this.sizeCurve != null); assert(sizeCurve != null);
} }
/// The child that is visible when [crossFadeState] is [showFirst]. It fades /// The child that is visible when [crossFadeState] is [showFirst]. It fades
......
...@@ -26,10 +26,10 @@ abstract class ScrollView extends StatelessWidget { ...@@ -26,10 +26,10 @@ abstract class ScrollView extends StatelessWidget {
this.shrinkWrap: false, this.shrinkWrap: false,
}) : primary = primary ?? controller == null && scrollDirection == Axis.vertical, }) : primary = primary ?? controller == null && scrollDirection == Axis.vertical,
super(key: key) { super(key: key) {
assert(this.reverse != null); assert(reverse != null);
assert(this.shrinkWrap != null); assert(shrinkWrap != null);
assert(this.primary != 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. ' 'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. '
'You cannot both set primary to true and pass an explicit controller.' 'You cannot both set primary to true and pass an explicit controller.'
); );
......
...@@ -49,9 +49,9 @@ class SingleChildScrollView extends StatelessWidget { ...@@ -49,9 +49,9 @@ class SingleChildScrollView extends StatelessWidget {
this.child, this.child,
}) : primary = primary ?? controller == null && scrollDirection == Axis.vertical, }) : primary = primary ?? controller == null && scrollDirection == Axis.vertical,
super(key: key) { super(key: key) {
assert(this.scrollDirection != null); assert(scrollDirection != null);
assert(this.primary != 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. ' 'Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. '
'You cannot both set primary to true and pass an explicit controller.' 'You cannot both set primary to true and pass an explicit controller.'
); );
......
...@@ -122,7 +122,7 @@ class Test1215DismissableWidget extends StatelessWidget { ...@@ -122,7 +122,7 @@ class Test1215DismissableWidget extends StatelessWidget {
key: new ObjectKey(text), key: new ObjectKey(text),
child: new AspectRatio( child: new AspectRatio(
aspectRatio: 1.0, aspectRatio: 1.0,
child: new Text(this.text), child: new Text(text),
), ),
); );
} }
......
...@@ -73,12 +73,12 @@ class TriggerableState extends State<TriggerableWidget> { ...@@ -73,12 +73,12 @@ class TriggerableState extends State<TriggerableWidget> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
config.trigger.callback = this.fire; config.trigger.callback = fire;
} }
@override @override
void didUpdateConfig(TriggerableWidget oldConfig) { void didUpdateConfig(TriggerableWidget oldConfig) {
config.trigger.callback = this.fire; config.trigger.callback = fire;
} }
int _count = 0; int _count = 0;
......
...@@ -156,11 +156,10 @@ class AssetBundle { ...@@ -156,11 +156,10 @@ class AssetBundle {
} }
class _Asset { class _Asset {
_Asset({ this.base, String assetEntry, this.relativePath, this.source }) { _Asset({ this.base, String assetEntry, this.relativePath, this.source })
this._assetEntry = assetEntry; : _assetEntry = assetEntry;
}
String _assetEntry; final String _assetEntry;
final String base; final String base;
......
...@@ -15,11 +15,9 @@ import 'globals.dart'; ...@@ -15,11 +15,9 @@ import 'globals.dart';
/// A wrapper around the `bin/cache/` directory. /// A wrapper around the `bin/cache/` directory.
class Cache { class Cache {
/// [rootOverride] is configurable for testing. /// [rootOverride] is configurable for testing.
Cache({ Directory rootOverride }) { Cache({ Directory rootOverride }) : _rootOverride = rootOverride;
this._rootOverride = rootOverride;
}
Directory _rootOverride; final Directory _rootOverride;
// Initialized by FlutterCommandRunner on startup. // Initialized by FlutterCommandRunner on startup.
static String flutterRoot; static String flutterRoot;
......
...@@ -89,7 +89,7 @@ class DriveCommand extends RunCommandBase { ...@@ -89,7 +89,7 @@ class DriveCommand extends RunCommandBase {
if (testFile == null) if (testFile == null)
throwToolExit(null); throwToolExit(null);
this._device = await targetDeviceFinder(); _device = await targetDeviceFinder();
if (device == null) if (device == null)
throwToolExit(null); throwToolExit(null);
......
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