apply the upcoming rule unnecessary_this (#8838)
This commit is contained in:
committed by
GitHub
parent
90aa2957fe
commit
a0769f2488
@@ -130,9 +130,9 @@ class CommandArgs {
|
||||
return false;
|
||||
|
||||
final CommandArgs otherCmd = other;
|
||||
return otherCmd.command == this.command &&
|
||||
const ListEquality<String>().equals(otherCmd.arguments, this.arguments) &&
|
||||
const MapEquality<String, String>().equals(otherCmd.environment, this.environment);
|
||||
return otherCmd.command == command &&
|
||||
const ListEquality<String>().equals(otherCmd.arguments, arguments) &&
|
||||
const MapEquality<String, String>().equals(otherCmd.environment, environment);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ class ColorSwatch {
|
||||
final Map<int, Color> 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<ColorSwatch> colorSwatches = <ColorSwatch>[
|
||||
|
||||
@@ -592,9 +592,9 @@ abstract class CompoundAnimation<T> extends Animation<T>
|
||||
|
||||
AnimationStatus _lastStatus;
|
||||
void _maybeNotifyStatusListeners(AnimationStatus _) {
|
||||
if (this.status != _lastStatus) {
|
||||
_lastStatus = this.status;
|
||||
notifyStatusListeners(this.status);
|
||||
if (status != _lastStatus) {
|
||||
_lastStatus = status;
|
||||
notifyStatusListeners(status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.'
|
||||
);
|
||||
|
||||
@@ -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.'
|
||||
);
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -73,12 +73,12 @@ class TriggerableState extends State<TriggerableWidget> {
|
||||
@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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user