enable lint prefer_equal_for_default_values (#18156)

This commit is contained in:
Alexandre Ardhuin
2018-06-05 08:50:40 +02:00
committed by GitHub
parent 6be81ebf9b
commit 09276bea25
390 changed files with 1920 additions and 1920 deletions

View File

@@ -77,7 +77,7 @@ class _StatusBarPaddingSliver extends SingleChildRenderObjectWidget {
const _StatusBarPaddingSliver({
Key key,
@required this.maxHeight,
this.scrollFactor: 5.0,
this.scrollFactor = 5.0,
}) : assert(maxHeight != null && maxHeight >= 0.0),
assert(scrollFactor != null && scrollFactor >= 1.0),
super(key: key);
@@ -265,7 +265,7 @@ class _AllSectionsView extends AnimatedWidget {
this.minHeight,
this.midHeight,
this.maxHeight,
this.sectionCards: const <Widget>[],
this.sectionCards = const <Widget>[],
}) : assert(sections != null),
assert(sectionCards != null),
assert(sectionCards.length == sections.length),

View File

@@ -99,7 +99,7 @@ class SectionTitle extends StatelessWidget {
// Small horizontal bar that indicates the selected section.
class SectionIndicator extends StatelessWidget {
const SectionIndicator({ Key key, this.opacity: 1.0 }) : super(key: key);
const SectionIndicator({ Key key, this.opacity = 1.0 }) : super(key: key);
final double opacity;

View File

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
const double kColorItemHeight = 48.0;
class Palette {
Palette({ this.name, this.primary, this.accent, this.threshold: 900});
Palette({ this.name, this.primary, this.accent, this.threshold = 900});
final String name;
final MaterialColor primary;
@@ -45,7 +45,7 @@ class ColorItem extends StatelessWidget {
Key key,
@required this.index,
@required this.color,
this.prefix: '',
this.prefix = '',
}) : assert(index != null),
assert(color != null),
assert(prefix != null),

View File

@@ -402,7 +402,7 @@ class _DemoDrawer extends StatelessWidget {
class _DiamondFab extends StatefulWidget {
const _DiamondFab({
this.child,
this.notchMargin: 6.0,
this.notchMargin = 6.0,
this.onPressed,
});

View File

@@ -77,7 +77,7 @@ class DualHeaderWithHint extends StatelessWidget {
class CollapsibleBody extends StatelessWidget {
const CollapsibleBody({
this.margin: EdgeInsets.zero,
this.margin = EdgeInsets.zero,
this.child,
this.onSave,
this.onCancel

View File

@@ -21,7 +21,7 @@ class Photo {
this.assetPackage,
this.title,
this.caption,
this.isFavorite: false,
this.isFavorite = false,
});
final String assetName;

View File

@@ -13,7 +13,7 @@ class SliderDemo extends StatefulWidget {
_SliderDemoState createState() => new _SliderDemoState();
}
Path _triangle(double size, Offset thumbCenter, {bool invert: false}) {
Path _triangle(double size, Offset thumbCenter, {bool invert = false}) {
final Path thumbPath = new Path();
final double height = math.sqrt(3.0) / 2.0;
final double halfSide = size / 2.0;

View File

@@ -45,9 +45,9 @@ class PestoFavorites extends StatelessWidget {
class PestoStyle extends TextStyle {
const PestoStyle({
double fontSize: 12.0,
double fontSize = 12.0,
FontWeight fontWeight,
Color color: Colors.black87,
Color color = Colors.black87,
double letterSpacing,
double height,
}) : super(

View File

@@ -70,7 +70,7 @@ class Product {
}
class Order {
Order({ @required this.product, this.quantity: 1, this.inCart: false })
Order({ @required this.product, this.quantity = 1, this.inCart = false })
: assert(product != null),
assert(quantity != null && quantity >= 0),
assert(inCart != null);

View File

@@ -206,7 +206,7 @@ class FadeAnimation extends StatefulWidget {
const FadeAnimation({
this.child,
this.duration: const Duration(milliseconds: 500),
this.duration = const Duration(milliseconds: 500),
});
@override

View File

@@ -21,11 +21,11 @@ class GalleryApp extends StatefulWidget {
const GalleryApp({
Key key,
this.updateUrlFetcher,
this.enablePerformanceOverlay: true,
this.enableRasterCacheImagesCheckerboard: true,
this.enableOffscreenLayersCheckerboard: true,
this.enablePerformanceOverlay = true,
this.enableRasterCacheImagesCheckerboard = true,
this.enableOffscreenLayersCheckerboard = true,
this.onSendFeedback,
this.testMode: false,
this.testMode = false,
}) : super(key: key);
final UpdateUrlFetcher updateUrlFetcher;

View File

@@ -79,7 +79,7 @@ class _TappableWhileStatusIsState extends State<_TappableWhileStatusIs> {
class _CrossFadeTransition extends AnimatedWidget {
const _CrossFadeTransition({
Key key,
this.alignment: Alignment.center,
this.alignment = Alignment.center,
Animation<double> progress,
this.child0,
this.child1,
@@ -130,7 +130,7 @@ class _CrossFadeTransition extends AnimatedWidget {
class _BackAppBar extends StatelessWidget {
const _BackAppBar({
Key key,
this.leading: const SizedBox(width: 56.0),
this.leading = const SizedBox(width: 56.0),
@required this.title,
this.trailing,
}) : assert(leading != null), assert(title != null), super(key: key);

View File

@@ -270,7 +270,7 @@ class GalleryHome extends StatefulWidget {
const GalleryHome({
Key key,
this.testMode: false,
this.testMode = false,
this.optionsPage,
}) : super(key: key);

View File

@@ -12,12 +12,12 @@ class GalleryOptions {
GalleryOptions({
this.theme,
this.textScaleFactor,
this.textDirection: TextDirection.ltr,
this.timeDilation: 1.0,
this.textDirection = TextDirection.ltr,
this.timeDilation = 1.0,
this.platform,
this.showOffscreenLayersCheckerboard: false,
this.showRasterCacheImagesCheckerboard: false,
this.showPerformanceOverlay: false,
this.showOffscreenLayersCheckerboard = false,
this.showRasterCacheImagesCheckerboard = false,
this.showPerformanceOverlay = false,
});
final GalleryTheme theme;

View File

@@ -44,7 +44,7 @@ class TestAssetBundle extends AssetBundle {
Future<ByteData> load(String key) => null;
@override
Future<String> loadString(String key, { bool cache: true }) {
Future<String> loadString(String key, { bool cache = true }) {
if (key == 'lib/gallery/example_code.dart')
return new Future<String>.value(testCodeFile);
return null;