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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
390 changed files with 1920 additions and 1920 deletions

View File

@ -118,7 +118,7 @@ linter:
- prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested
- prefer_contains
# - prefer_equal_for_default_values # not yet tested
- prefer_equal_for_default_values
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
- prefer_final_fields
- prefer_final_locals

View File

@ -115,7 +115,7 @@ linter:
- prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested
- prefer_contains
# - prefer_equal_for_default_values # not yet tested
- prefer_equal_for_default_values
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
- prefer_final_fields
- prefer_final_locals

View File

@ -78,9 +78,9 @@ Branch fromBranchName(String name) {
class ProcessRunner {
ProcessRunner({
ProcessManager processManager,
this.subprocessOutput: true,
this.subprocessOutput = true,
this.defaultWorkingDirectory,
this.platform: const LocalPlatform(),
this.platform = const LocalPlatform(),
}) : processManager = processManager ?? const LocalProcessManager() {
environment = new Map<String, String>.from(platform.environment);
}
@ -112,7 +112,7 @@ class ProcessRunner {
Future<String> runProcess(
List<String> commandLine, {
Directory workingDirectory,
bool failOk: false,
bool failOk = false,
}) async {
workingDirectory ??= defaultWorkingDirectory ?? Directory.current;
if (subprocessOutput) {
@ -193,8 +193,8 @@ class ArchiveCreator {
this.revision,
this.branch, {
ProcessManager processManager,
bool subprocessOutput: true,
this.platform: const LocalPlatform(),
bool subprocessOutput = true,
this.platform = const LocalPlatform(),
HttpReader httpReader,
}) : assert(revision.length == 40),
flutterRoot = new Directory(path.join(tempDir.path, 'flutter')),
@ -430,8 +430,8 @@ class ArchivePublisher {
this.version,
this.outputFile, {
ProcessManager processManager,
bool subprocessOutput: true,
this.platform: const LocalPlatform(),
bool subprocessOutput = true,
this.platform = const LocalPlatform(),
}) : assert(revision.length == 40),
platformName = platform.operatingSystem.toLowerCase(),
metadataGsPath = '$gsReleaseFolder/${getMetadataFilename(platform)}',
@ -528,7 +528,7 @@ class ArchivePublisher {
Future<String> _runGsUtil(
List<String> args, {
Directory workingDirectory,
bool failOk: false,
bool failOk = false,
}) async {
return _processRunner.runProcess(
<String>['gsutil']..addAll(args),

View File

@ -274,7 +274,7 @@ class EvalResult {
Future<EvalResult> _evalCommand(String executable, List<String> arguments, {
String workingDirectory,
Map<String, String> environment,
bool skip: false,
bool skip = false,
}) async {
final String commandDescription = '${path.relative(executable, from: workingDirectory)} ${arguments.join(' ')}';
final String relativeWorkingDir = path.relative(workingDirectory);
@ -315,10 +315,10 @@ Future<EvalResult> _evalCommand(String executable, List<String> arguments, {
Future<Null> _runCommand(String executable, List<String> arguments, {
String workingDirectory,
Map<String, String> environment,
bool expectFailure: false,
bool printOutput: true,
bool skip: false,
Duration timeout: _kLongTimeout,
bool expectFailure = false,
bool printOutput = true,
bool skip = false,
Duration timeout = _kLongTimeout,
}) async {
final String commandDescription = '${path.relative(executable, from: workingDirectory)} ${arguments.join(' ')}';
final String relativeWorkingDir = path.relative(workingDirectory);
@ -364,11 +364,11 @@ Future<Null> _runCommand(String executable, List<String> arguments, {
Future<Null> _runFlutterTest(String workingDirectory, {
String script,
bool expectFailure: false,
bool printOutput: true,
List<String> options: const <String>[],
bool skip: false,
Duration timeout: _kLongTimeout,
bool expectFailure = false,
bool printOutput = true,
List<String> options = const <String>[],
bool skip = false,
Duration timeout = _kLongTimeout,
}) {
final List<String> args = <String>['test']..addAll(options);
if (flutterTestArgs != null && flutterTestArgs.isNotEmpty)
@ -385,7 +385,7 @@ Future<Null> _runFlutterTest(String workingDirectory, {
}
Future<Null> _runFlutterAnalyze(String workingDirectory, {
List<String> options: const <String>[]
List<String> options = const <String>[]
}) {
return _runCommand(flutter, <String>['analyze']..addAll(options),
workingDirectory: workingDirectory,
@ -464,7 +464,7 @@ bool _matches<T>(List<T> a, List<T> b) {
final RegExp _importPattern = new RegExp(r"import 'package:flutter/([^.]+)\.dart'");
final RegExp _importMetaPattern = new RegExp(r"import 'package:meta/meta.dart'");
Set<String> _findDependencies(String srcPath, List<String> errors, { bool checkForMeta: false }) {
Set<String> _findDependencies(String srcPath, List<String> errors, { bool checkForMeta = false }) {
return new Directory(srcPath).listSync(recursive: true).where((FileSystemEntity entity) {
return entity is File && path.extension(entity.path) == '.dart';
}).map<Set<String>>((FileSystemEntity entity) {

View File

@ -144,7 +144,7 @@ class _TaskRunner {
/// A result of running a single task.
class TaskResult {
/// Constructs a successful result.
TaskResult.success(this.data, {this.benchmarkScoreKeys: const <String>[]})
TaskResult.success(this.data, {this.benchmarkScoreKeys = const <String>[]})
: this.succeeded = true,
this.message = 'success' {
const JsonEncoder prettyJson = const JsonEncoder.withIndent(' ');

View File

@ -22,7 +22,7 @@ const Duration taskTimeoutWithGracePeriod = const Duration(minutes: 26);
///
/// Running the task in [silent] mode will suppress standard output from task
/// processes and only print standard errors.
Future<Map<String, dynamic>> runTask(String taskName, { bool silent: false }) async {
Future<Map<String, dynamic>> runTask(String taskName, { bool silent = false }) async {
final String taskExecutable = 'bin/tasks/$taskName.dart';
if (!file(taskExecutable).existsSync())

View File

@ -231,7 +231,7 @@ Future<int> exec(
String executable,
List<String> arguments, {
Map<String, String> environment,
bool canFail: false,
bool canFail = false,
}) async {
final Process process = await startProcess(executable, arguments, environment: environment);
@ -266,7 +266,7 @@ Future<String> eval(
String executable,
List<String> arguments, {
Map<String, String> environment,
bool canFail: false,
bool canFail = false,
}) async {
final Process process = await startProcess(executable, arguments, environment: environment);
@ -297,8 +297,8 @@ Future<String> eval(
}
Future<int> flutter(String command, {
List<String> options: const <String>[],
bool canFail: false,
List<String> options = const <String>[],
bool canFail = false,
Map<String, String> environment,
}) {
final List<String> args = <String>[command]..addAll(options);
@ -308,8 +308,8 @@ Future<int> flutter(String command, {
/// Runs a `flutter` command and returns the standard output as a string.
Future<String> evalFlutter(String command, {
List<String> options: const <String>[],
bool canFail: false,
List<String> options = const <String>[],
bool canFail = false,
Map<String, String> environment,
}) {
final List<String> args = <String>[command]..addAll(options);

View File

@ -12,13 +12,13 @@ import '../framework/framework.dart';
import '../framework/ios.dart';
import '../framework/utils.dart';
TaskFunction createGalleryTransitionTest({ bool semanticsEnabled: false }) {
TaskFunction createGalleryTransitionTest({ bool semanticsEnabled = false }) {
return new GalleryTransitionTest(semanticsEnabled: semanticsEnabled);
}
class GalleryTransitionTest {
GalleryTransitionTest({ this.semanticsEnabled: false });
GalleryTransitionTest({ this.semanticsEnabled = false });
final bool semanticsEnabled;

View File

@ -16,7 +16,7 @@ import '../framework/utils.dart';
final Directory _editedFlutterGalleryDir = dir(path.join(Directory.systemTemp.path, 'edited_flutter_gallery'));
final Directory flutterGalleryDir = dir(path.join(flutterDirectory.path, 'examples/flutter_gallery'));
TaskFunction createHotModeTest({ bool isPreviewDart2: true }) {
TaskFunction createHotModeTest({ bool isPreviewDart2 = true }) {
return () async {
final Device device = await devices.workingDevice;
await device.unlock();

View File

@ -23,7 +23,7 @@ TaskFunction createMicrobenchmarkTask() {
final Device device = await devices.workingDevice;
await device.unlock();
Future<Map<String, double>> _runMicrobench(String benchmarkPath, {bool previewDart2: true}) async {
Future<Map<String, double>> _runMicrobench(String benchmarkPath, {bool previewDart2 = true}) async {
Future<Map<String, double>> _run() async {
print('Running $benchmarkPath');
final Directory appDir = dir(
@ -86,9 +86,9 @@ TaskFunction createMicrobenchmarkTask() {
}
Future<Process> _startFlutter({
String command: 'run',
List<String> options: const <String>[],
bool canFail: false,
String command = 'run',
List<String> options = const <String>[],
bool canFail = false,
Map<String, String> environment,
}) {
final List<String> args = <String>['run']..addAll(options);

View File

@ -108,7 +108,7 @@ TaskFunction createBasicMaterialCompileTest() {
class StartupTest {
static const Duration _startupTimeout = const Duration(minutes: 5);
const StartupTest(this.testDirectory, { this.reportMetrics: true });
const StartupTest(this.testDirectory, { this.reportMetrics = true });
final String testDirectory;
final bool reportMetrics;
@ -221,7 +221,7 @@ class CompileTest {
);
}
static Future<Map<String, dynamic>> _compileAot({ bool previewDart2: true }) async {
static Future<Map<String, dynamic>> _compileAot({ bool previewDart2 = true }) async {
// Generate blobs instead of assembly.
await flutter('clean');
final Stopwatch watch = new Stopwatch()..start();
@ -258,7 +258,7 @@ class CompileTest {
return metrics;
}
static Future<Map<String, dynamic>> _compileApp({ bool previewDart2: true }) async {
static Future<Map<String, dynamic>> _compileApp({ bool previewDart2 = true }) async {
await flutter('clean');
final Stopwatch watch = new Stopwatch();
int releaseSizeInBytes;
@ -299,7 +299,7 @@ class CompileTest {
};
}
static Future<Map<String, dynamic>> _compileDebug({ bool previewDart2: true }) async {
static Future<Map<String, dynamic>> _compileDebug({ bool previewDart2 = true }) async {
await flutter('clean');
final Stopwatch watch = new Stopwatch();
final List<String> options = <String>['--debug'];

View File

@ -181,7 +181,7 @@ class CardCollectionState extends State<CardCollection> {
});
}
Widget buildDrawerCheckbox(String label, bool value, void callback(), { bool enabled: true }) {
Widget buildDrawerCheckbox(String label, bool value, void callback(), { bool enabled = true }) {
return new ListTile(
onTap: enabled ? callback : null,
title: new Text(label),
@ -192,7 +192,7 @@ class CardCollectionState extends State<CardCollection> {
);
}
Widget buildDrawerColorRadioItem(String label, MaterialColor itemValue, MaterialColor currentValue, ValueChanged<MaterialColor> onChanged, { IconData icon, bool enabled: true }) {
Widget buildDrawerColorRadioItem(String label, MaterialColor itemValue, MaterialColor currentValue, ValueChanged<MaterialColor> onChanged, { IconData icon, bool enabled = true }) {
return new ListTile(
leading: new Icon(icon),
title: new Text(label),
@ -205,7 +205,7 @@ class CardCollectionState extends State<CardCollection> {
);
}
Widget buildDrawerDirectionRadioItem(String label, DismissDirection itemValue, DismissDirection currentValue, ValueChanged<DismissDirection> onChanged, { IconData icon, bool enabled: true }) {
Widget buildDrawerDirectionRadioItem(String label, DismissDirection itemValue, DismissDirection currentValue, ValueChanged<DismissDirection> onChanged, { IconData icon, bool enabled = true }) {
return new ListTile(
leading: new Icon(icon),
title: new Text(label),
@ -218,7 +218,7 @@ class CardCollectionState extends State<CardCollection> {
);
}
Widget buildFontRadioItem(String label, TextAlign itemValue, TextAlign currentValue, ValueChanged<TextAlign> onChanged, { IconData icon, bool enabled: true }) {
Widget buildFontRadioItem(String label, TextAlign itemValue, TextAlign currentValue, ValueChanged<TextAlign> onChanged, { IconData icon, bool enabled = true }) {
return new ListTile(
leading: new Icon(icon),
title: new Text(label),

View File

@ -42,7 +42,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
}
class Dot extends StatefulWidget {
const Dot({ Key key, this.color, this.size, this.child, this.tappable: false }) : super(key: key);
const Dot({ Key key, this.color, this.size, this.child, this.tappable = false }) : super(key: key);
final Color color;
final double size;
@ -77,8 +77,8 @@ class ExampleDragSource extends StatelessWidget {
const ExampleDragSource({
Key key,
this.color,
this.heavy: false,
this.under: true,
this.heavy = false,
this.under = true,
this.child
}) : super(key: key);

View File

@ -59,9 +59,9 @@ class _MarkerPainter extends CustomPainter {
class Marker extends StatelessWidget {
const Marker({
Key key,
this.type: MarkerType.touch,
this.type = MarkerType.touch,
this.position,
this.size: 40.0,
this.size = 40.0,
}) : super(key: key);
final Offset position;

View File

@ -1060,7 +1060,7 @@ class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin
}
}
String zalgo(math.Random random, int targetLength, { bool includeSpacingCombiningMarks: false, String base }) {
String zalgo(math.Random random, int targetLength, { bool includeSpacingCombiningMarks = false, String base }) {
// The following three tables are derived from UnicodeData.txt:
// http://unicode.org/Public/UNIDATA/UnicodeData.txt
// There are three groups, character classes Mc, Me, and Mn.

View File

@ -313,7 +313,7 @@ List<Directory> findPackages() {
/// Returns import or on-disk paths for all libraries in the Flutter SDK.
///
/// diskPath toggles between import paths vs. disk paths.
Iterable<String> libraryRefs({ bool diskPath: false }) sync* {
Iterable<String> libraryRefs({ bool diskPath = false }) sync* {
for (Directory dir in findPackages()) {
final String dirName = path.basename(dir.path);
for (FileSystemEntity file in new Directory('${dir.path}/lib').listSync()) {
@ -336,7 +336,7 @@ Iterable<String> libraryRefs({ bool diskPath: false }) sync* {
}
}
void printStream(Stream<List<int>> stream, { String prefix: '', List<Pattern> filter: const <Pattern>[] }) {
void printStream(Stream<List<int>> stream, { String prefix = '', List<Pattern> filter = const <Pattern>[] }) {
assert(prefix != null);
assert(filter != null);
stream

View File

@ -157,7 +157,7 @@ class CardItem extends StatelessWidget {
@required this.animation,
this.onTap,
@required this.item,
this.selected: false
this.selected = false
}) : assert(animation != null),
assert(item != null && item >= 0),
assert(selected != null),

View File

@ -213,7 +213,7 @@ class CustomTraversalExampleState extends State<CustomTraversalExample> {
);
}
Widget _makeSpinnerButton(int rowOrder, int columnOrder, Field field, {bool increment: true}) {
Widget _makeSpinnerButton(int rowOrder, int columnOrder, Field field, {bool increment = true}) {
return new SpinnerButton(
rowOrder: rowOrder,
columnOrder: columnOrder,

View File

@ -92,12 +92,12 @@ void main() {
}
void expectAdjustable(SemanticsNode node, {
bool hasIncreaseAction: true,
bool hasDecreaseAction: true,
String label: '',
String decreasedValue: '',
String value: '',
String increasedValue: '',
bool hasIncreaseAction = true,
bool hasDecreaseAction = true,
String label = '',
String decreasedValue = '',
String value = '',
String increasedValue = '',
}) {
final SemanticsData semanticsData = node.getSemanticsData();

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;

View File

@ -11,14 +11,14 @@ const double kTwoPi = 2 * math.pi;
class SectorConstraints extends Constraints {
const SectorConstraints({
this.minDeltaRadius: 0.0,
this.maxDeltaRadius: double.infinity,
this.minDeltaTheta: 0.0,
this.maxDeltaTheta: kTwoPi
this.minDeltaRadius = 0.0,
this.maxDeltaRadius = double.infinity,
this.minDeltaTheta = 0.0,
this.maxDeltaTheta = kTwoPi
}) : assert(maxDeltaRadius >= minDeltaRadius),
assert(maxDeltaTheta >= minDeltaTheta);
const SectorConstraints.tight({ double deltaRadius: 0.0, double deltaTheta: 0.0 })
const SectorConstraints.tight({ double deltaRadius = 0.0, double deltaTheta = 0.0 })
: minDeltaRadius = deltaRadius,
maxDeltaRadius = deltaRadius,
minDeltaTheta = deltaTheta,
@ -45,7 +45,7 @@ class SectorConstraints extends Constraints {
@override
bool debugAssertIsValid({
bool isAppliedConstraint: false,
bool isAppliedConstraint = false,
InformationCollector informationCollector
}) {
assert(isNormalized);
@ -54,11 +54,11 @@ class SectorConstraints extends Constraints {
}
class SectorDimensions {
const SectorDimensions({ this.deltaRadius: 0.0, this.deltaTheta: 0.0 });
const SectorDimensions({ this.deltaRadius = 0.0, this.deltaTheta = 0.0 });
factory SectorDimensions.withConstraints(
SectorConstraints constraints,
{ double deltaRadius: 0.0, double deltaTheta: 0.0 }
{ double deltaRadius = 0.0, double deltaTheta = 0.0 }
) {
return new SectorDimensions(
deltaRadius: constraints.constrainDeltaRadius(deltaRadius),
@ -215,8 +215,8 @@ class RenderSectorRing extends RenderSectorWithChildren {
RenderSectorRing({
BoxDecoration decoration,
double deltaRadius: double.infinity,
double padding: 0.0
double deltaRadius = double.infinity,
double padding = 0.0
}) : _padding = padding,
assert(deltaRadius >= 0.0),
_desiredDeltaRadius = deltaRadius,
@ -333,8 +333,8 @@ class RenderSectorSlice extends RenderSectorWithChildren {
RenderSectorSlice({
BoxDecoration decoration,
double deltaTheta: kTwoPi,
double padding: 0.0
double deltaTheta = kTwoPi,
double padding = 0.0
}) : _padding = padding, _desiredDeltaTheta = deltaTheta, super(decoration);
double _desiredDeltaTheta;
@ -440,7 +440,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChildMixin<RenderSector> {
RenderBoxToRenderSectorAdapter({ double innerRadius: 0.0, RenderSector child }) :
RenderBoxToRenderSectorAdapter({ double innerRadius = 0.0, RenderSector child }) :
_innerRadius = innerRadius {
this.child = child;
}
@ -487,8 +487,8 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
}
Size getIntrinsicDimensions({
double width: double.infinity,
double height: double.infinity
double width = double.infinity,
double height = double.infinity
}) {
assert(child is RenderSector);
assert(child.parentData is SectorParentData);
@ -555,8 +555,8 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
class RenderSolidColor extends RenderDecoratedSector {
RenderSolidColor(this.backgroundColor, {
this.desiredDeltaRadius: double.infinity,
this.desiredDeltaTheta: kTwoPi
this.desiredDeltaRadius = double.infinity,
this.desiredDeltaTheta = kTwoPi
}) : super(new BoxDecoration(color: backgroundColor));
double desiredDeltaRadius;

View File

@ -9,7 +9,7 @@ class RenderSolidColorBox extends RenderDecoratedBox {
final Size desiredSize;
final Color backgroundColor;
RenderSolidColorBox(this.backgroundColor, { this.desiredSize: Size.infinite })
RenderSolidColorBox(this.backgroundColor, { this.desiredSize = Size.infinite })
: super(decoration: new BoxDecoration(color: backgroundColor));
@override

View File

@ -8,7 +8,7 @@ import 'package:flutter/rendering.dart';
import '../rendering/src/solid_color_box.dart';
// Solid colour, RenderObject version
void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex: 0 }) {
void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex = 0 }) {
final RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor);
parent.add(child);
final FlexParentData childParentData = child.parentData;

View File

@ -118,8 +118,8 @@ class AnimationController extends Animation<double>
double value,
this.duration,
this.debugLabel,
this.lowerBound: 0.0,
this.upperBound: 1.0,
this.lowerBound = 0.0,
this.upperBound = 1.0,
@required TickerProvider vsync,
}) : assert(lowerBound != null),
assert(upperBound != null),
@ -147,7 +147,7 @@ class AnimationController extends Animation<double>
/// physics simulation, especially when the physics simulation has no
/// pre-determined bounds.
AnimationController.unbounded({
double value: 0.0,
double value = 0.0,
this.duration,
this.debugLabel,
@required TickerProvider vsync,
@ -358,12 +358,12 @@ class AnimationController extends Animation<double>
/// regardless of whether `target` > [value] or not. At the end of the
/// animation, when `target` is reached, [status] is reported as
/// [AnimationStatus.completed].
TickerFuture animateTo(double target, { Duration duration, Curve curve: Curves.linear }) {
TickerFuture animateTo(double target, { Duration duration, Curve curve = Curves.linear }) {
_direction = _AnimationDirection.forward;
return _animateToInternal(target, duration: duration, curve: curve);
}
TickerFuture _animateToInternal(double target, { Duration duration, Curve curve: Curves.linear }) {
TickerFuture _animateToInternal(double target, { Duration duration, Curve curve = Curves.linear }) {
Duration simulationDuration = duration;
if (simulationDuration == null) {
assert(() {
@ -441,7 +441,7 @@ class AnimationController extends Animation<double>
/// The most recently returned [TickerFuture], if any, is marked as having been
/// canceled, meaning the future never completes and its [TickerFuture.orCancel]
/// derivative future completes with a [TickerCanceled] error.
TickerFuture fling({ double velocity: 1.0 }) {
TickerFuture fling({ double velocity = 1.0 }) {
_direction = velocity < 0.0 ? _AnimationDirection.reverse : _AnimationDirection.forward;
final double target = velocity < 0.0 ? lowerBound - _kFlingTolerance.distance
: upperBound + _kFlingTolerance.distance;
@ -493,7 +493,7 @@ class AnimationController extends Animation<double>
/// and which does send notifications.
/// * [forward], [reverse], [animateTo], [animateWith], [fling], and [repeat],
/// which restart the animation controller.
void stop({ bool canceled: true }) {
void stop({ bool canceled = true }) {
_simulation = null;
_lastElapsedDuration = null;
_ticker.stop(canceled: canceled);

View File

@ -95,7 +95,7 @@ class Interval extends Curve {
/// Creates an interval curve.
///
/// The arguments must not be null.
const Interval(this.begin, this.end, { this.curve: Curves.linear })
const Interval(this.begin, this.end, { this.curve = Curves.linear })
: assert(begin != null),
assert(end != null),
assert(curve != null);

View File

@ -19,8 +19,8 @@ class CupertinoActivityIndicator extends StatefulWidget {
/// Creates an iOS-style activity indicator.
const CupertinoActivityIndicator({
Key key,
this.animating: true,
this.radius: _kDefaultIndicatorRadius,
this.animating = true,
this.radius = _kDefaultIndicatorRadius,
}) : assert(animating != null),
assert(radius != null),
assert(radius > 0),

View File

@ -39,11 +39,11 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget {
Key key,
@required this.items,
this.onTap,
this.currentIndex: 0,
this.backgroundColor: _kDefaultTabBarBackgroundColor,
this.activeColor: CupertinoColors.activeBlue,
this.inactiveColor: CupertinoColors.inactiveGray,
this.iconSize: 30.0,
this.currentIndex = 0,
this.backgroundColor = _kDefaultTabBarBackgroundColor,
this.activeColor = CupertinoColors.activeBlue,
this.inactiveColor = CupertinoColors.inactiveGray,
this.iconSize = 30.0,
}) : assert(items != null),
assert(items.length >= 2),
assert(currentIndex != null),

View File

@ -50,9 +50,9 @@ class CupertinoButton extends StatefulWidget {
@required this.child,
this.padding,
this.color,
this.minSize: 44.0,
this.pressedOpacity: 0.1,
this.borderRadius: const BorderRadius.all(const Radius.circular(8.0)),
this.minSize = 44.0,
this.pressedOpacity = 0.1,
this.borderRadius = const BorderRadius.all(const Radius.circular(8.0)),
@required this.onPressed,
}) : assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0));

View File

@ -134,7 +134,7 @@ class CupertinoAlertDialog extends StatelessWidget {
Key key,
this.title,
this.content,
this.actions: const <Widget>[],
this.actions = const <Widget>[],
this.scrollController,
this.actionScrollController,
}) : assert(actions != null),
@ -229,8 +229,8 @@ class CupertinoDialogAction extends StatelessWidget {
/// Creates an action for an iOS-style dialog.
const CupertinoDialogAction({
this.onPressed,
this.isDefaultAction: false,
this.isDestructiveAction: false,
this.isDefaultAction = false,
this.isDestructiveAction = false,
@required this.child,
}) : assert(child != null);

View File

@ -82,12 +82,12 @@ class CupertinoNavigationBar extends StatelessWidget implements ObstructingPrefe
const CupertinoNavigationBar({
Key key,
this.leading,
this.automaticallyImplyLeading: true,
this.automaticallyImplyLeading = true,
this.middle,
this.trailing,
this.border: _kDefaultNavBarBorder,
this.backgroundColor: _kDefaultNavBarBackgroundColor,
this.actionsForegroundColor: CupertinoColors.activeBlue,
this.border = _kDefaultNavBarBorder,
this.backgroundColor = _kDefaultNavBarBackgroundColor,
this.actionsForegroundColor = CupertinoColors.activeBlue,
}) : assert(automaticallyImplyLeading != null),
super(key: key);
@ -192,11 +192,11 @@ class CupertinoSliverNavigationBar extends StatelessWidget {
Key key,
@required this.largeTitle,
this.leading,
this.automaticallyImplyLeading: true,
this.automaticallyImplyLeading = true,
this.middle,
this.trailing,
this.backgroundColor: _kDefaultNavBarBackgroundColor,
this.actionsForegroundColor: CupertinoColors.activeBlue,
this.backgroundColor = _kDefaultNavBarBackgroundColor,
this.actionsForegroundColor = CupertinoColors.activeBlue,
}) : assert(largeTitle != null),
assert(automaticallyImplyLeading != null),
super(key: key);
@ -447,8 +447,8 @@ class _CupertinoLargeTitleNavigationBarSliverDelegate
this.automaticallyImplyLeading,
this.middle,
this.trailing,
this.border: _kDefaultNavBarBorder,
this.backgroundColor: _kDefaultNavBarBackgroundColor,
this.border = _kDefaultNavBarBorder,
this.backgroundColor = _kDefaultNavBarBackgroundColor,
this.actionsForegroundColor,
}) : assert(persistentHeight != null);

View File

@ -21,7 +21,7 @@ class CupertinoPageScaffold extends StatelessWidget {
const CupertinoPageScaffold({
Key key,
this.navigationBar,
this.backgroundColor: CupertinoColors.white,
this.backgroundColor = CupertinoColors.white,
@required this.child,
}) : assert(child != null),
super(key: key);

View File

@ -40,8 +40,8 @@ class CupertinoPicker extends StatefulWidget {
/// than using [Colors.transparent].
const CupertinoPicker({
Key key,
this.diameterRatio: _kDefaultDiameterRatio,
this.backgroundColor: _kDefaultBackground,
this.diameterRatio = _kDefaultDiameterRatio,
this.backgroundColor = _kDefaultBackground,
this.scrollController,
@required this.itemExtent,
@required this.onSelectedItemChanged,

View File

@ -14,8 +14,8 @@ import 'icons.dart';
class _CupertinoRefreshSliver extends SingleChildRenderObjectWidget {
const _CupertinoRefreshSliver({
this.refreshIndicatorLayoutExtent: 0.0,
this.hasLayoutExtent: false,
this.refreshIndicatorLayoutExtent = 0.0,
this.hasLayoutExtent = false,
Widget child,
}) : assert(refreshIndicatorLayoutExtent != null),
assert(refreshIndicatorLayoutExtent >= 0.0),
@ -266,9 +266,9 @@ class CupertinoRefreshControl extends StatefulWidget {
///
/// [onRefresh] will be called when pulled far enough to trigger a refresh.
const CupertinoRefreshControl({
this.refreshTriggerPullDistance: _defaultRefreshTriggerPullDistance,
this.refreshIndicatorExtent: _defaultRefreshIndicatorExtent,
this.builder: buildSimpleRefreshIndicator,
this.refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance,
this.refreshIndicatorExtent = _defaultRefreshIndicatorExtent,
this.builder = buildSimpleRefreshIndicator,
this.onRefresh,
}) : assert(refreshTriggerPullDistance != null),
assert(refreshTriggerPullDistance > 0.0),

View File

@ -80,8 +80,8 @@ class CupertinoPageRoute<T> extends PageRoute<T> {
CupertinoPageRoute({
@required this.builder,
RouteSettings settings,
this.maintainState: true,
bool fullscreenDialog: false,
this.maintainState = true,
bool fullscreenDialog = false,
this.hostRoute,
}) : assert(builder != null),
assert(maintainState != null),

View File

@ -54,10 +54,10 @@ class CupertinoSlider extends StatefulWidget {
@required this.onChanged,
this.onChangeStart,
this.onChangeEnd,
this.min: 0.0,
this.max: 1.0,
this.min = 0.0,
this.max = 1.0,
this.divisions,
this.activeColor: CupertinoColors.activeBlue,
this.activeColor = CupertinoColors.activeBlue,
}) : assert(value != null),
assert(min != null),
assert(max != null),

View File

@ -51,7 +51,7 @@ class CupertinoSwitch extends StatefulWidget {
Key key,
@required this.value,
@required this.onChanged,
this.activeColor: CupertinoColors.activeGreen,
this.activeColor = CupertinoColors.activeGreen,
}) : super(key: key);
/// Whether this switch is on or off.

View File

@ -41,7 +41,7 @@ class CupertinoTabView extends StatelessWidget {
this.routes,
this.onGenerateRoute,
this.onUnknownRoute,
this.navigatorObservers: const <NavigatorObserver>[],
this.navigatorObservers = const <NavigatorObserver>[],
}) : assert(navigatorObservers != null),
super(key: key);

View File

@ -12,8 +12,8 @@ import 'colors.dart';
class CupertinoThumbPainter {
/// Creates an object that paints an iOS-style slider thumb.
CupertinoThumbPainter({
this.color: CupertinoColors.white,
this.shadowColor: const Color(0x2C000000),
this.color = CupertinoColors.white,
this.shadowColor = const Color(0x2C000000),
}) : _shadowPaint = new BoxShadow(
color: shadowColor,
blurRadius: 1.0,

View File

@ -28,11 +28,11 @@ class FlutterErrorDetails {
const FlutterErrorDetails({
this.exception,
this.stack,
this.library: 'Flutter framework',
this.library = 'Flutter framework',
this.context,
this.stackFilter,
this.informationCollector,
this.silent: false
this.silent = false
});
/// The exception. Often this will be an [AssertionError], maybe specifically
@ -250,7 +250,7 @@ class FlutterError extends AssertionError {
/// had not been called before (so the next message is verbose again).
///
/// The default behavior for the [onError] handler is to call this function.
static void dumpErrorToConsole(FlutterErrorDetails details, { bool forceReport: false }) {
static void dumpErrorToConsole(FlutterErrorDetails details, { bool forceReport = false }) {
assert(details != null);
assert(details.exception != null);
bool reportError = details.silent != true; // could be null

View File

@ -239,7 +239,7 @@ class CachingIterable<E> extends IterableBase<E> {
}
@override
List<E> toList({ bool growable: true }) {
List<E> toList({ bool growable = true }) {
_precacheEntireList();
return new List<E>.from(_results, growable: growable);
}

View File

@ -21,7 +21,7 @@ import 'print.dart';
///
/// See [https://docs.flutter.io/flutter/foundation/foundation-library.html] for
/// a complete list.
bool debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debugPrintOverride: debugPrintThrottled }) {
bool debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debugPrintOverride = debugPrintThrottled }) {
assert(() {
if (debugPrint != debugPrintOverride ||
debugDefaultTargetPlatformOverride != null)

View File

@ -135,19 +135,19 @@ class TextTreeConfiguration {
@required this.linkCharacter,
@required this.propertyPrefixIfChildren,
@required this.propertyPrefixNoChildren,
this.lineBreak: '\n',
this.lineBreakProperties: true,
this.afterName: ':',
this.afterDescriptionIfBody: '',
this.beforeProperties: '',
this.afterProperties: '',
this.propertySeparator: '',
this.bodyIndent: '',
this.footer: '',
this.showChildren: true,
this.addBlankLineIfNoChildren: true,
this.isNameOnOwnLine: false,
this.isBlankLineBetweenPropertiesAndChildren: true,
this.lineBreak = '\n',
this.lineBreakProperties = true,
this.afterName = ':',
this.afterDescriptionIfBody = '',
this.beforeProperties = '',
this.afterProperties = '',
this.propertySeparator = '',
this.bodyIndent = '',
this.footer = '',
this.showChildren = true,
this.addBlankLineIfNoChildren = true,
this.isNameOnOwnLine = false,
this.isBlankLineBetweenPropertiesAndChildren = true,
}) : assert(prefixLineOne != null),
assert(prefixOtherLines != null),
assert(prefixLastChildLineOne != null),
@ -639,8 +639,8 @@ abstract class DiagnosticsNode {
DiagnosticsNode({
@required this.name,
this.style,
this.showName: true,
this.showSeparator: true,
this.showName = true,
this.showSeparator = true,
}) : assert(showName != null),
assert(showSeparator != null),
// A name ending with ':' indicates that the user forgot that the ':' will
@ -659,8 +659,8 @@ abstract class DiagnosticsNode {
/// formatted like a property with a separate name and message.
factory DiagnosticsNode.message(
String message, {
DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level: DiagnosticLevel.info,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level = DiagnosticLevel.info,
}) {
assert(style != null);
assert(level != null);
@ -782,7 +782,7 @@ abstract class DiagnosticsNode {
@override
String toString({
TextTreeConfiguration parentConfiguration,
DiagnosticLevel minLevel: DiagnosticLevel.info,
DiagnosticLevel minLevel = DiagnosticLevel.info,
}) {
assert(style != null);
assert(minLevel != null);
@ -853,10 +853,10 @@ abstract class DiagnosticsNode {
/// * [toStringShallow], for a detailed description of the [value] but not its
/// children.
String toStringDeep({
String prefixLineOne: '',
String prefixLineOne = '',
String prefixOtherLines,
TextTreeConfiguration parentConfiguration,
DiagnosticLevel minLevel: DiagnosticLevel.debug,
DiagnosticLevel minLevel = DiagnosticLevel.debug,
}) {
assert(minLevel != null);
prefixOtherLines ??= prefixLineOne;
@ -1041,7 +1041,7 @@ class MessageProperty extends DiagnosticsProperty<Null> {
///
/// The [name], `message`, and [level] arguments must not be null.
MessageProperty(String name, String message, {
DiagnosticLevel level: DiagnosticLevel.info,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(name != null),
assert(message != null),
assert(level != null),
@ -1061,11 +1061,11 @@ class StringProperty extends DiagnosticsProperty<String> {
StringProperty(String name, String value, {
String description,
String tooltip,
bool showName: true,
Object defaultValue: kNoDefaultValue,
this.quoted: true,
bool showName = true,
Object defaultValue = kNoDefaultValue,
this.quoted = true,
String ifEmpty,
DiagnosticLevel level: DiagnosticLevel.info,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
assert(quoted != null),
assert(level != null),
@ -1118,10 +1118,10 @@ abstract class _NumProperty<T extends num> extends DiagnosticsProperty<T> {
T value, {
String ifNull,
this.unit,
bool showName: true,
Object defaultValue: kNoDefaultValue,
bool showName = true,
Object defaultValue = kNoDefaultValue,
String tooltip,
DiagnosticLevel level: DiagnosticLevel.info,
DiagnosticLevel level = DiagnosticLevel.info,
}) : super(
name,
value,
@ -1136,10 +1136,10 @@ abstract class _NumProperty<T extends num> extends DiagnosticsProperty<T> {
ComputePropertyValueCallback<T> computeValue, {
String ifNull,
this.unit,
bool showName: true,
Object defaultValue: kNoDefaultValue,
bool showName = true,
Object defaultValue = kNoDefaultValue,
String tooltip,
DiagnosticLevel level: DiagnosticLevel.info,
DiagnosticLevel level = DiagnosticLevel.info,
}) : super.lazy(
name,
computeValue,
@ -1189,9 +1189,9 @@ class DoubleProperty extends _NumProperty<double> {
String ifNull,
String unit,
String tooltip,
Object defaultValue: kNoDefaultValue,
bool showName: true,
DiagnosticLevel level: DiagnosticLevel.info,
Object defaultValue = kNoDefaultValue,
bool showName = true,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super(
@ -1215,11 +1215,11 @@ class DoubleProperty extends _NumProperty<double> {
String name,
ComputePropertyValueCallback<double> computeValue, {
String ifNull,
bool showName: true,
bool showName = true,
String unit,
String tooltip,
Object defaultValue: kNoDefaultValue,
DiagnosticLevel level: DiagnosticLevel.info,
Object defaultValue = kNoDefaultValue,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super.lazy(
@ -1246,10 +1246,10 @@ class IntProperty extends _NumProperty<int> {
/// The [showName] and [level] arguments must not be null.
IntProperty(String name, int value, {
String ifNull,
bool showName: true,
bool showName = true,
String unit,
Object defaultValue: kNoDefaultValue,
DiagnosticLevel level: DiagnosticLevel.info,
Object defaultValue = kNoDefaultValue,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super(
@ -1279,10 +1279,10 @@ class PercentProperty extends DoubleProperty {
/// The [showName] and [level] arguments must not be null.
PercentProperty(String name, double fraction, {
String ifNull,
bool showName: true,
bool showName = true,
String tooltip,
String unit,
DiagnosticLevel level : DiagnosticLevel.info,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
super(
@ -1357,9 +1357,9 @@ class FlagProperty extends DiagnosticsProperty<bool> {
@required bool value,
this.ifTrue,
this.ifFalse,
bool showName: false,
bool showName = false,
Object defaultValue,
DiagnosticLevel level: DiagnosticLevel.info,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
assert(level != null),
assert(ifTrue != null || ifFalse != null),
@ -1449,12 +1449,12 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> {
///
/// The [style], [showName], and [level] arguments must not be null.
IterableProperty(String name, Iterable<T> value, {
Object defaultValue: kNoDefaultValue,
Object defaultValue = kNoDefaultValue,
String ifNull,
String ifEmpty: '[]',
DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine,
bool showName: true,
DiagnosticLevel level: DiagnosticLevel.info,
String ifEmpty = '[]',
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine,
bool showName = true,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(style != null),
assert(showName != null),
assert(level != null),
@ -1524,8 +1524,8 @@ class EnumProperty<T> extends DiagnosticsProperty<T> {
///
/// The [level] argument must also not be null.
EnumProperty(String name, T value, {
Object defaultValue: kNoDefaultValue,
DiagnosticLevel level : DiagnosticLevel.info,
Object defaultValue = kNoDefaultValue,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(level != null),
super (
name,
@ -1570,8 +1570,8 @@ class ObjectFlagProperty<T> extends DiagnosticsProperty<T> {
ObjectFlagProperty(String name, T value, {
this.ifPresent,
String ifNull,
bool showName: false,
DiagnosticLevel level : DiagnosticLevel.info,
bool showName = false,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(ifPresent != null || ifNull != null),
assert(showName != null),
assert(level != null),
@ -1592,7 +1592,7 @@ class ObjectFlagProperty<T> extends DiagnosticsProperty<T> {
ObjectFlagProperty.has(
String name,
T value, {
DiagnosticLevel level: DiagnosticLevel.info,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(name != null),
assert(level != null),
ifPresent = 'has $name',
@ -1686,13 +1686,13 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
String description,
String ifNull,
this.ifEmpty,
bool showName: true,
bool showSeparator: true,
this.defaultValue: kNoDefaultValue,
bool showName = true,
bool showSeparator = true,
this.defaultValue = kNoDefaultValue,
this.tooltip,
this.missingIfNull: false,
DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level: DiagnosticLevel.info,
this.missingIfNull = false,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
assert(showSeparator != null),
assert(style != null),
@ -1728,13 +1728,13 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
String description,
String ifNull,
this.ifEmpty,
bool showName: true,
bool showSeparator: true,
this.defaultValue: kNoDefaultValue,
bool showName = true,
bool showSeparator = true,
this.defaultValue = kNoDefaultValue,
this.tooltip,
this.missingIfNull: false,
DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level: DiagnosticLevel.info,
this.missingIfNull = false,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine,
DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
assert(showSeparator != null),
assert(defaultValue == kNoDefaultValue || defaultValue is T),
@ -2117,7 +2117,7 @@ abstract class Diagnosticable {
String toStringShort() => describeIdentity(this);
@override
String toString({ DiagnosticLevel minLevel: DiagnosticLevel.debug }) {
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) {
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
}
@ -2382,8 +2382,8 @@ abstract class DiagnosticableTree extends Diagnosticable {
/// * [toString], for a brief description of the object.
/// * [toStringDeep], for a description of the subtree rooted at this object.
String toStringShallow({
String joiner: ', ',
DiagnosticLevel minLevel: DiagnosticLevel.debug,
String joiner = ', ',
DiagnosticLevel minLevel = DiagnosticLevel.debug,
}) {
final StringBuffer result = new StringBuffer();
result.write(toString());
@ -2415,9 +2415,9 @@ abstract class DiagnosticableTree extends Diagnosticable {
/// * [toStringShallow], for a detailed description of the object but not its
/// children.
String toStringDeep({
String prefixLineOne: '',
String prefixLineOne = '',
String prefixOtherLines,
DiagnosticLevel minLevel: DiagnosticLevel.debug,
DiagnosticLevel minLevel = DiagnosticLevel.debug,
}) {
return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel);
}
@ -2466,14 +2466,14 @@ abstract class DiagnosticableTreeMixin implements DiagnosticableTree {
factory DiagnosticableTreeMixin._() => null;
@override
String toString({ DiagnosticLevel minLevel: DiagnosticLevel.debug }) {
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) {
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
}
@override
String toStringShallow({
String joiner: ', ',
DiagnosticLevel minLevel: DiagnosticLevel.debug,
String joiner = ', ',
DiagnosticLevel minLevel = DiagnosticLevel.debug,
}) {
final StringBuffer result = new StringBuffer();
result.write(toStringShort());
@ -2488,9 +2488,9 @@ abstract class DiagnosticableTreeMixin implements DiagnosticableTree {
@override
String toStringDeep({
String prefixLineOne: '',
String prefixLineOne = '',
String prefixOtherLines,
DiagnosticLevel minLevel: DiagnosticLevel.debug,
DiagnosticLevel minLevel = DiagnosticLevel.debug,
}) {
return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel);
}

View File

@ -103,7 +103,7 @@ enum _WordWrapParseMode { inSpace, inWord, atBreak }
/// and so forth. It is only intended for formatting error messages.
///
/// The default [debugPrint] implementation uses this for its line wrapping.
Iterable<String> debugWordWrap(String message, int width, { String wrapIndent: '' }) sync* {
Iterable<String> debugWordWrap(String message, int width, { String wrapIndent = '' }) sync* {
if (message.length < width || message.trimLeft()[0] == '#') {
yield message;
return;

View File

@ -168,7 +168,7 @@ class FlutterErrorDetailsForPointerEventDispatcher extends FlutterErrorDetails {
this.event,
this.hitTestEntry,
InformationCollector informationCollector,
bool silent: false
bool silent = false
}) : super(
exception: exception,
stack: stack,

View File

@ -20,7 +20,7 @@ class DragDownDetails {
/// Creates details for a [GestureDragDownCallback].
///
/// The [globalPosition] argument must not be null.
DragDownDetails({ this.globalPosition: Offset.zero })
DragDownDetails({ this.globalPosition = Offset.zero })
: assert(globalPosition != null);
/// The global position at which the pointer contacted the screen.
@ -52,7 +52,7 @@ class DragStartDetails {
/// Creates details for a [GestureDragStartCallback].
///
/// The [globalPosition] argument must not be null.
DragStartDetails({ this.sourceTimeStamp, this.globalPosition: Offset.zero })
DragStartDetails({ this.sourceTimeStamp, this.globalPosition = Offset.zero })
: assert(globalPosition != null);
/// Recorded timestamp of the source pointer event that triggered the drag
@ -101,7 +101,7 @@ class DragUpdateDetails {
/// The [globalPosition] argument must be provided and must not be null.
DragUpdateDetails({
this.sourceTimeStamp,
this.delta: Offset.zero,
this.delta = Offset.zero,
this.primaryDelta,
@required this.globalPosition
}) : assert(delta != null),
@ -165,7 +165,7 @@ class DragEndDetails {
///
/// The [velocity] argument must not be null.
DragEndDetails({
this.velocity: Velocity.zero,
this.velocity = Velocity.zero,
this.primaryVelocity,
}) : assert(velocity != null),
assert(primaryVelocity == null

View File

@ -94,27 +94,27 @@ abstract class PointerEvent {
/// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions.
const PointerEvent({
this.timeStamp: Duration.zero,
this.pointer: 0,
this.kind: PointerDeviceKind.touch,
this.device: 0,
this.position: Offset.zero,
this.delta: Offset.zero,
this.buttons: 0,
this.down: false,
this.obscured: false,
this.pressure: 1.0,
this.pressureMin: 1.0,
this.pressureMax: 1.0,
this.distance: 0.0,
this.distanceMax: 0.0,
this.radiusMajor: 0.0,
this.radiusMinor: 0.0,
this.radiusMin: 0.0,
this.radiusMax: 0.0,
this.orientation: 0.0,
this.tilt: 0.0,
this.synthesized: false,
this.timeStamp = Duration.zero,
this.pointer = 0,
this.kind = PointerDeviceKind.touch,
this.device = 0,
this.position = Offset.zero,
this.delta = Offset.zero,
this.buttons = 0,
this.down = false,
this.obscured = false,
this.pressure = 1.0,
this.pressureMin = 1.0,
this.pressureMax = 1.0,
this.distance = 0.0,
this.distanceMax = 0.0,
this.radiusMajor = 0.0,
this.radiusMinor = 0.0,
this.radiusMin = 0.0,
this.radiusMax = 0.0,
this.orientation = 0.0,
this.tilt = 0.0,
this.synthesized = false,
});
/// Time of event dispatch, relative to an arbitrary timeline.
@ -289,19 +289,19 @@ class PointerAddedEvent extends PointerEvent {
///
/// All of the argument must be non-null.
const PointerAddedEvent({
Duration timeStamp: Duration.zero,
PointerDeviceKind kind: PointerDeviceKind.touch,
int device: 0,
Offset position: Offset.zero,
bool obscured: false,
double pressureMin: 1.0,
double pressureMax: 1.0,
double distance: 0.0,
double distanceMax: 0.0,
double radiusMin: 0.0,
double radiusMax: 0.0,
double orientation: 0.0,
double tilt: 0.0
Duration timeStamp = Duration.zero,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = Offset.zero,
bool obscured = false,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
double distanceMax = 0.0,
double radiusMin = 0.0,
double radiusMax = 0.0,
double orientation = 0.0,
double tilt = 0.0
}) : super(
timeStamp: timeStamp,
kind: kind,
@ -328,15 +328,15 @@ class PointerRemovedEvent extends PointerEvent {
///
/// All of the argument must be non-null.
const PointerRemovedEvent({
Duration timeStamp: Duration.zero,
PointerDeviceKind kind: PointerDeviceKind.touch,
int device: 0,
bool obscured: false,
double pressureMin: 1.0,
double pressureMax: 1.0,
double distanceMax: 0.0,
double radiusMin: 0.0,
double radiusMax: 0.0
Duration timeStamp = Duration.zero,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
bool obscured = false,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distanceMax = 0.0,
double radiusMin = 0.0,
double radiusMax = 0.0
}) : super(
timeStamp: timeStamp,
kind: kind,
@ -363,24 +363,24 @@ class PointerHoverEvent extends PointerEvent {
///
/// All of the argument must be non-null.
const PointerHoverEvent({
Duration timeStamp: Duration.zero,
PointerDeviceKind kind: PointerDeviceKind.touch,
int device: 0,
Offset position: Offset.zero,
Offset delta: Offset.zero,
int buttons: 0,
bool obscured: false,
double pressureMin: 1.0,
double pressureMax: 1.0,
double distance: 0.0,
double distanceMax: 0.0,
double radiusMajor: 0.0,
double radiusMinor: 0.0,
double radiusMin: 0.0,
double radiusMax: 0.0,
double orientation: 0.0,
double tilt: 0.0,
bool synthesized: false,
Duration timeStamp = Duration.zero,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = Offset.zero,
Offset delta = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
double distanceMax = 0.0,
double radiusMajor = 0.0,
double radiusMinor = 0.0,
double radiusMin = 0.0,
double radiusMax = 0.0,
double orientation = 0.0,
double tilt = 0.0,
bool synthesized = false,
}) : super(
timeStamp: timeStamp,
kind: kind,
@ -410,23 +410,23 @@ class PointerDownEvent extends PointerEvent {
///
/// All of the argument must be non-null.
const PointerDownEvent({
Duration timeStamp: Duration.zero,
int pointer: 0,
PointerDeviceKind kind: PointerDeviceKind.touch,
int device: 0,
Offset position: Offset.zero,
int buttons: 0,
bool obscured: false,
double pressure: 1.0,
double pressureMin: 1.0,
double pressureMax: 1.0,
double distanceMax: 0.0,
double radiusMajor: 0.0,
double radiusMinor: 0.0,
double radiusMin: 0.0,
double radiusMax: 0.0,
double orientation: 0.0,
double tilt: 0.0
Duration timeStamp = Duration.zero,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressure = 1.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distanceMax = 0.0,
double radiusMajor = 0.0,
double radiusMinor = 0.0,
double radiusMin = 0.0,
double radiusMax = 0.0,
double orientation = 0.0,
double tilt = 0.0
}) : super(
timeStamp: timeStamp,
pointer: pointer,
@ -462,25 +462,25 @@ class PointerMoveEvent extends PointerEvent {
///
/// All of the argument must be non-null.
const PointerMoveEvent({
Duration timeStamp: Duration.zero,
int pointer: 0,
PointerDeviceKind kind: PointerDeviceKind.touch,
int device: 0,
Offset position: Offset.zero,
Offset delta: Offset.zero,
int buttons: 0,
bool obscured: false,
double pressure: 1.0,
double pressureMin: 1.0,
double pressureMax: 1.0,
double distanceMax: 0.0,
double radiusMajor: 0.0,
double radiusMinor: 0.0,
double radiusMin: 0.0,
double radiusMax: 0.0,
double orientation: 0.0,
double tilt: 0.0,
bool synthesized: false,
Duration timeStamp = Duration.zero,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = Offset.zero,
Offset delta = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressure = 1.0,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distanceMax = 0.0,
double radiusMajor = 0.0,
double radiusMinor = 0.0,
double radiusMin = 0.0,
double radiusMax = 0.0,
double orientation = 0.0,
double tilt = 0.0,
bool synthesized = false,
}) : super(
timeStamp: timeStamp,
pointer: pointer,
@ -512,21 +512,21 @@ class PointerUpEvent extends PointerEvent {
///
/// All of the argument must be non-null.
const PointerUpEvent({
Duration timeStamp: Duration.zero,
int pointer: 0,
PointerDeviceKind kind: PointerDeviceKind.touch,
int device: 0,
Offset position: Offset.zero,
int buttons: 0,
bool obscured: false,
double pressureMin: 1.0,
double pressureMax: 1.0,
double distance: 0.0,
double distanceMax: 0.0,
double radiusMin: 0.0,
double radiusMax: 0.0,
double orientation: 0.0,
double tilt: 0.0
Duration timeStamp = Duration.zero,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
double distanceMax = 0.0,
double radiusMin = 0.0,
double radiusMax = 0.0,
double orientation = 0.0,
double tilt = 0.0
}) : super(
timeStamp: timeStamp,
pointer: pointer,
@ -553,21 +553,21 @@ class PointerCancelEvent extends PointerEvent {
///
/// All of the argument must be non-null.
const PointerCancelEvent({
Duration timeStamp: Duration.zero,
int pointer: 0,
PointerDeviceKind kind: PointerDeviceKind.touch,
int device: 0,
Offset position: Offset.zero,
int buttons: 0,
bool obscured: false,
double pressureMin: 1.0,
double pressureMax: 1.0,
double distance: 0.0,
double distanceMax: 0.0,
double radiusMin: 0.0,
double radiusMax: 0.0,
double orientation: 0.0,
double tilt: 0.0
Duration timeStamp = Duration.zero,
int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = Offset.zero,
int buttons = 0,
bool obscured = false,
double pressureMin = 1.0,
double pressureMax = 1.0,
double distance = 0.0,
double distanceMax = 0.0,
double radiusMin = 0.0,
double radiusMax = 0.0,
double orientation = 0.0,
double tilt = 0.0
}) : super(
timeStamp: timeStamp,
pointer: pointer,

View File

@ -526,7 +526,7 @@ class DelayedMultiDragGestureRecognizer extends MultiDragGestureRecognizer<_Dela
/// defaults to [kLongPressTimeout] to match [LongPressGestureRecognizer] but
/// can be changed for specific behaviors.
DelayedMultiDragGestureRecognizer({
this.delay: kLongPressTimeout,
this.delay = kLongPressTimeout,
Object debugOwner,
}) : assert(delay != null),
super(debugOwner: debugOwner);

View File

@ -316,7 +316,7 @@ class MultiTapGestureRecognizer extends GestureRecognizer {
/// The [longTapDelay] defaults to [Duration.zero], which means
/// [onLongTapDown] is called immediately after [onTapDown].
MultiTapGestureRecognizer({
this.longTapDelay: Duration.zero,
this.longTapDelay = Duration.zero,
Object debugOwner,
}) : super(debugOwner: debugOwner);

View File

@ -128,7 +128,7 @@ class FlutterErrorDetailsForPointerRouter extends FlutterErrorDetails {
this.route,
this.event,
InformationCollector informationCollector,
bool silent: false
bool silent = false
}) : super(
exception: exception,
stack: stack,

View File

@ -32,7 +32,7 @@ class ScaleStartDetails {
/// Creates details for [GestureScaleStartCallback].
///
/// The [focalPoint] argument must not be null.
ScaleStartDetails({ this.focalPoint: Offset.zero })
ScaleStartDetails({ this.focalPoint = Offset.zero })
: assert(focalPoint != null);
/// The initial focal point of the pointers in contact with the screen.
@ -50,8 +50,8 @@ class ScaleUpdateDetails {
/// The [focalPoint] and [scale] arguments must not be null. The [scale]
/// argument must be greater than or equal to zero.
ScaleUpdateDetails({
this.focalPoint: Offset.zero,
this.scale: 1.0,
this.focalPoint = Offset.zero,
this.scale = 1.0,
}) : assert(focalPoint != null),
assert(scale != null && scale >= 0.0);
@ -72,7 +72,7 @@ class ScaleEndDetails {
/// Creates details for [GestureScaleEndCallback].
///
/// The [velocity] argument must not be null.
ScaleEndDetails({ this.velocity: Velocity.zero })
ScaleEndDetails({ this.velocity = Velocity.zero })
: assert(velocity != null);
/// The velocity of the last pointer to be lifted off of the screen.

View File

@ -14,7 +14,7 @@ class TapDownDetails {
/// Creates details for a [GestureTapDownCallback].
///
/// The [globalPosition] argument must not be null.
TapDownDetails({ this.globalPosition: Offset.zero })
TapDownDetails({ this.globalPosition = Offset.zero })
: assert(globalPosition != null);
/// The global position at which the pointer contacted the screen.
@ -33,7 +33,7 @@ class TapUpDetails {
/// Creates details for a [GestureTapUpCallback].
///
/// The [globalPosition] argument must not be null.
TapUpDetails({ this.globalPosition: Offset.zero })
TapUpDetails({ this.globalPosition = Offset.zero })
: assert(globalPosition != null);
/// The global position at which the pointer contacted the screen.

View File

@ -41,7 +41,7 @@ class AboutListTile extends StatelessWidget {
/// values default to the empty string.
const AboutListTile({
Key key,
this.icon: const Icon(null),
this.icon = const Icon(null),
this.child,
this.applicationName,
this.applicationVersion,

View File

@ -83,26 +83,26 @@ class MaterialApp extends StatefulWidget {
Key key,
this.navigatorKey,
this.home,
this.routes: const <String, WidgetBuilder>{},
this.routes = const <String, WidgetBuilder>{},
this.initialRoute,
this.onGenerateRoute,
this.onUnknownRoute,
this.navigatorObservers: const <NavigatorObserver>[],
this.navigatorObservers = const <NavigatorObserver>[],
this.builder,
this.title: '',
this.title = '',
this.onGenerateTitle,
this.color,
this.theme,
this.locale,
this.localizationsDelegates,
this.localeResolutionCallback,
this.supportedLocales: const <Locale>[const Locale('en', 'US')],
this.debugShowMaterialGrid: false,
this.showPerformanceOverlay: false,
this.checkerboardRasterCacheImages: false,
this.checkerboardOffscreenLayers: false,
this.showSemanticsDebugger: false,
this.debugShowCheckedModeBanner: true,
this.supportedLocales = const <Locale>[const Locale('en', 'US')],
this.debugShowMaterialGrid = false,
this.showPerformanceOverlay = false,
this.checkerboardRasterCacheImages = false,
this.checkerboardOffscreenLayers = false,
this.showSemanticsDebugger = false,
this.debugShowCheckedModeBanner = true,
}) : assert(routes != null),
assert(navigatorObservers != null),
assert(

View File

@ -135,21 +135,21 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
AppBar({
Key key,
this.leading,
this.automaticallyImplyLeading: true,
this.automaticallyImplyLeading = true,
this.title,
this.actions,
this.flexibleSpace,
this.bottom,
this.elevation: 4.0,
this.elevation = 4.0,
this.backgroundColor,
this.brightness,
this.iconTheme,
this.textTheme,
this.primary: true,
this.primary = true,
this.centerTitle,
this.titleSpacing: NavigationToolbar.kMiddleSpacing,
this.toolbarOpacity: 1.0,
this.bottomOpacity: 1.0,
this.titleSpacing = NavigationToolbar.kMiddleSpacing,
this.toolbarOpacity = 1.0,
this.bottomOpacity = 1.0,
}) : assert(automaticallyImplyLeading != null),
assert(elevation != null),
assert(primary != null),
@ -731,24 +731,24 @@ class SliverAppBar extends StatefulWidget {
const SliverAppBar({
Key key,
this.leading,
this.automaticallyImplyLeading: true,
this.automaticallyImplyLeading = true,
this.title,
this.actions,
this.flexibleSpace,
this.bottom,
this.elevation,
this.forceElevated: false,
this.forceElevated = false,
this.backgroundColor,
this.brightness,
this.iconTheme,
this.textTheme,
this.primary: true,
this.primary = true,
this.centerTitle,
this.titleSpacing: NavigationToolbar.kMiddleSpacing,
this.titleSpacing = NavigationToolbar.kMiddleSpacing,
this.expandedHeight,
this.floating: false,
this.pinned: false,
this.snap: false,
this.floating = false,
this.pinned = false,
this.snap = false,
}) : assert(automaticallyImplyLeading != null),
assert(forceElevated != null),
assert(primary != null),

View File

@ -45,8 +45,8 @@ class BottomAppBar extends StatefulWidget {
const BottomAppBar({
Key key,
this.color,
this.elevation: 8.0,
this.hasNotch: true,
this.elevation = 8.0,
this.hasNotch = true,
this.child,
}) : assert(elevation != null),
assert(elevation >= 0.0),

View File

@ -88,10 +88,10 @@ class BottomNavigationBar extends StatefulWidget {
Key key,
@required this.items,
this.onTap,
this.currentIndex: 0,
this.currentIndex = 0,
BottomNavigationBarType type,
this.fixedColor,
this.iconSize: 24.0,
this.iconSize = 24.0,
}) : assert(items != null),
assert(items.length >= 2),
assert(0 <= currentIndex && currentIndex < items.length),
@ -146,7 +146,7 @@ class _BottomNavigationTile extends StatelessWidget {
this.onTap,
this.colorTween,
this.flex,
this.selected: false,
this.selected = false,
this.indexLabel,
}
): assert(selected != null);

View File

@ -35,14 +35,14 @@ class RawMaterialButton extends StatefulWidget {
this.fillColor,
this.highlightColor,
this.splashColor,
this.elevation: 2.0,
this.highlightElevation: 8.0,
this.disabledElevation: 0.0,
this.elevation = 2.0,
this.highlightElevation = 8.0,
this.disabledElevation = 0.0,
this.outerPadding,
this.padding: EdgeInsets.zero,
this.constraints: const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
this.shape: const RoundedRectangleBorder(),
this.animationDuration: kThemeChangeDuration,
this.padding = EdgeInsets.zero,
this.constraints = const BoxConstraints(minWidth: 88.0, minHeight: 36.0),
this.shape = const RoundedRectangleBorder(),
this.animationDuration = kThemeChangeDuration,
this.child,
}) : assert(shape != null),
assert(elevation != null),

View File

@ -29,9 +29,9 @@ class ButtonBar extends StatelessWidget {
/// The alignment argument defaults to [MainAxisAlignment.end].
const ButtonBar({
Key key,
this.alignment: MainAxisAlignment.end,
this.mainAxisSize: MainAxisSize.max,
this.children: const <Widget>[],
this.alignment = MainAxisAlignment.end,
this.mainAxisSize = MainAxisSize.max,
this.children = const <Widget>[],
}) : super(key: key);
/// How the children should be placed along the horizontal axis.

View File

@ -59,12 +59,12 @@ class ButtonTheme extends InheritedWidget {
/// The [textTheme], [minWidth], and [height] arguments must not be null.
ButtonTheme({
Key key,
ButtonTextTheme textTheme: ButtonTextTheme.normal,
double minWidth: 88.0,
double height: 36.0,
ButtonTextTheme textTheme = ButtonTextTheme.normal,
double minWidth = 88.0,
double height = 36.0,
EdgeInsetsGeometry padding,
ShapeBorder shape,
bool alignedDropdown: false,
bool alignedDropdown = false,
Widget child,
}) : assert(textTheme != null),
assert(minWidth != null && minWidth >= 0.0),
@ -106,12 +106,12 @@ class ButtonTheme extends InheritedWidget {
/// button theme.
ButtonTheme.bar({
Key key,
ButtonTextTheme textTheme: ButtonTextTheme.accent,
double minWidth: 64.0,
double height: 36.0,
EdgeInsetsGeometry padding: const EdgeInsets.symmetric(horizontal: 8.0),
ButtonTextTheme textTheme = ButtonTextTheme.accent,
double minWidth = 64.0,
double height = 36.0,
EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 8.0),
ShapeBorder shape,
bool alignedDropdown: false,
bool alignedDropdown = false,
Widget child,
}) : assert(textTheme != null),
assert(minWidth != null && minWidth >= 0.0),
@ -157,12 +157,12 @@ class ButtonThemeData extends Diagnosticable {
///
/// The [textTheme], [minWidth], and [height] parameters must not be null.
const ButtonThemeData({
this.textTheme: ButtonTextTheme.normal,
this.minWidth: 88.0,
this.height: 36.0,
this.textTheme = ButtonTextTheme.normal,
this.minWidth = 88.0,
this.height = 36.0,
EdgeInsetsGeometry padding,
ShapeBorder shape,
this.alignedDropdown: false,
this.alignedDropdown = false,
}) : assert(textTheme != null),
assert(minWidth != null && minWidth >= 0.0),
assert(height != null && height >= 0.0),

View File

@ -65,7 +65,7 @@ class Card extends StatelessWidget {
this.color,
this.elevation,
this.shape,
this.margin: const EdgeInsets.all(4.0),
this.margin = const EdgeInsets.all(4.0),
this.child,
}) : super(key: key);

View File

@ -55,7 +55,7 @@ class Checkbox extends StatefulWidget {
const Checkbox({
Key key,
@required this.value,
this.tristate: false,
this.tristate = false,
@required this.onChanged,
this.activeColor,
}) : assert(tristate != null),

View File

@ -82,11 +82,11 @@ class CheckboxListTile extends StatelessWidget {
this.activeColor,
this.title,
this.subtitle,
this.isThreeLine: false,
this.isThreeLine = false,
this.dense,
this.secondary,
this.selected: false,
this.controlAffinity: ListTileControlAffinity.platform,
this.selected = false,
this.controlAffinity = ListTileControlAffinity.platform,
}) : assert(value != null),
assert(isThreeLine != null),
assert(!isThreeLine || subtitle != null),

View File

@ -533,8 +533,8 @@ class InputChip extends StatelessWidget
@required this.label,
this.labelStyle,
this.labelPadding,
this.selected: false,
this.isEnabled: true,
this.selected = false,
this.isEnabled = true,
this.onSelected,
this.deleteIcon,
this.onDeleted,
@ -844,7 +844,7 @@ class FilterChip extends StatelessWidget
@required this.label,
this.labelStyle,
this.labelPadding,
this.selected: false,
this.selected = false,
@required this.onSelected,
this.disabledColor,
this.selectedColor,
@ -1067,10 +1067,10 @@ class RawChip extends StatefulWidget
this.deleteButtonTooltipMessage,
this.onPressed,
this.onSelected,
this.tapEnabled: true,
this.tapEnabled = true,
this.selected,
this.showCheckmark: true,
this.isEnabled: true,
this.showCheckmark = true,
this.isEnabled = true,
this.disabledColor,
this.selectedColor,
this.tooltip,

View File

@ -36,7 +36,7 @@ class DataColumn {
const DataColumn({
@required this.label,
this.tooltip,
this.numeric: false,
this.numeric = false,
this.onSort,
}) : assert(label != null);
@ -87,7 +87,7 @@ class DataRow {
/// The [cells] argument must not be null.
const DataRow({
this.key,
this.selected: false,
this.selected = false,
this.onSelectChanged,
@required this.cells,
}) : assert(cells != null);
@ -98,7 +98,7 @@ class DataRow {
/// The [cells] argument must not be null.
DataRow.byIndex({
int index,
this.selected: false,
this.selected = false,
this.onSelectChanged,
@required this.cells,
}) : assert(cells != null),
@ -163,8 +163,8 @@ class DataCell {
/// text should be provided instead, and then the [placeholder]
/// argument should be set to true.
const DataCell(this.child, {
this.placeholder: false,
this.showEditIcon: false,
this.placeholder = false,
this.showEditIcon = false,
this.onTap,
}) : assert(child != null);
@ -259,7 +259,7 @@ class DataTable extends StatelessWidget {
Key key,
@required this.columns,
this.sortColumnIndex,
this.sortAscending: true,
this.sortAscending = true,
this.onSelectAll,
@required this.rows,
}) : assert(columns != null),

View File

@ -1044,7 +1044,7 @@ Future<DateTime> showDatePicker({
@required DateTime firstDate,
@required DateTime lastDate,
SelectableDayPredicate selectableDayPredicate,
DatePickerMode initialDatePickerMode: DatePickerMode.day,
DatePickerMode initialDatePickerMode = DatePickerMode.day,
Locale locale,
TextDirection textDirection,
}) async {

View File

@ -39,8 +39,8 @@ class Dialog extends StatelessWidget {
const Dialog({
Key key,
this.child,
this.insetAnimationDuration: const Duration(milliseconds: 100),
this.insetAnimationCurve: Curves.decelerate,
this.insetAnimationDuration = const Duration(milliseconds: 100),
this.insetAnimationCurve = Curves.decelerate,
}) : super(key: key);
/// The widget below this widget in the tree.
@ -164,7 +164,7 @@ class AlertDialog extends StatelessWidget {
this.title,
this.titlePadding,
this.content,
this.contentPadding: const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),
this.contentPadding = const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),
this.actions,
this.semanticLabel,
}) : assert(contentPadding != null),
@ -430,9 +430,9 @@ class SimpleDialog extends StatelessWidget {
const SimpleDialog({
Key key,
this.title,
this.titlePadding: const EdgeInsets.fromLTRB(24.0, 24.0, 24.0, 0.0),
this.titlePadding = const EdgeInsets.fromLTRB(24.0, 24.0, 24.0, 0.0),
this.children,
this.contentPadding: const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),
this.contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),
this.semanticLabel,
}) : assert(titlePadding != null),
assert(contentPadding != null),
@ -546,7 +546,7 @@ class SimpleDialog extends StatelessWidget {
class _DialogRoute<T> extends PopupRoute<T> {
_DialogRoute({
@required this.theme,
bool barrierDismissible: true,
bool barrierDismissible = true,
this.barrierLabel,
@required this.child,
RouteSettings settings,
@ -630,7 +630,7 @@ class _DialogRoute<T> extends PopupRoute<T> {
/// * <https://material.google.com/components/dialogs.html>
Future<T> showDialog<T>({
@required BuildContext context,
bool barrierDismissible: true,
bool barrierDismissible = true,
@Deprecated(
'Instead of using the "child" argument, return the child from a closure '
'provided to the "builder" argument. This will ensure that the BuildContext '

View File

@ -29,8 +29,8 @@ class Divider extends StatelessWidget {
/// The height must be positive.
const Divider({
Key key,
this.height: 16.0,
this.indent: 0.0,
this.height = 16.0,
this.indent = 0.0,
this.color
}) : assert(height >= 0.0),
super(key: key);
@ -85,7 +85,7 @@ class Divider extends StatelessWidget {
/// // child: ...
/// )
/// ```
static BorderSide createBorderSide(BuildContext context, { Color color, double width: 0.0 }) {
static BorderSide createBorderSide(BuildContext context, { Color color, double width = 0.0 }) {
assert(width != null);
return new BorderSide(
color: color ?? Theme.of(context).dividerColor,

View File

@ -84,7 +84,7 @@ class Drawer extends StatelessWidget {
/// Typically used in the [Scaffold.drawer] property.
const Drawer({
Key key,
this.elevation: 16.0,
this.elevation = 16.0,
this.child,
this.semanticLabel,
}) : super(key: key);

View File

@ -31,10 +31,10 @@ class DrawerHeader extends StatelessWidget {
const DrawerHeader({
Key key,
this.decoration,
this.margin: const EdgeInsets.only(bottom: 8.0),
this.padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 8.0),
this.duration: const Duration(milliseconds: 250),
this.curve: Curves.fastOutSlowIn,
this.margin = const EdgeInsets.only(bottom: 8.0),
this.padding = const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 8.0),
this.duration = const Duration(milliseconds: 250),
this.curve = Curves.fastOutSlowIn,
@required this.child,
}) : super(key: key);

View File

@ -288,7 +288,7 @@ class _DropdownRoute<T> extends PopupRoute<_DropdownRouteResult<T>> {
this.padding,
this.buttonRect,
this.selectedIndex,
this.elevation: 8,
this.elevation = 8,
this.theme,
@required this.style,
this.barrierLabel,
@ -473,10 +473,10 @@ class DropdownButton<T> extends StatefulWidget {
this.value,
this.hint,
@required this.onChanged,
this.elevation: 8,
this.elevation = 8,
this.style,
this.iconSize: 24.0,
this.isDense: false,
this.iconSize = 24.0,
this.isDense = false,
}) : assert(items != null),
assert(value == null || items.where((DropdownMenuItem<T> item) => item.value == value).length == 1),
super(key: key);

View File

@ -22,10 +22,10 @@ class ExpandIcon extends StatefulWidget {
/// triggered when the icon is pressed.
const ExpandIcon({
Key key,
this.isExpanded: false,
this.size: 24.0,
this.isExpanded = false,
this.size = 24.0,
@required this.onPressed,
this.padding: const EdgeInsets.all(8.0)
this.padding = const EdgeInsets.all(8.0)
}) : assert(isExpanded != null),
assert(size != null),
assert(padding != null),

View File

@ -67,7 +67,7 @@ class ExpansionPanel {
ExpansionPanel({
@required this.headerBuilder,
@required this.body,
this.isExpanded: false
this.isExpanded = false
}) : assert(headerBuilder != null),
assert(body != null),
assert(isExpanded != null);
@ -98,9 +98,9 @@ class ExpansionPanelList extends StatelessWidget {
/// triggered when an expansion panel expand/collapse button is pushed.
const ExpansionPanelList({
Key key,
this.children: const <ExpansionPanel>[],
this.children = const <ExpansionPanel>[],
this.expansionCallback,
this.animationDuration: kThemeAnimationDuration
this.animationDuration = kThemeAnimationDuration
}) : assert(children != null),
assert(animationDuration != null),
super(key: key);

View File

@ -37,9 +37,9 @@ class ExpansionTile extends StatefulWidget {
@required this.title,
this.backgroundColor,
this.onExpansionChanged,
this.children: const <Widget>[],
this.children = const <Widget>[],
this.trailing,
this.initiallyExpanded: false,
this.initiallyExpanded = false,
}) : assert(initiallyExpanded != null),
super(key: key);

View File

@ -70,14 +70,14 @@ class FloatingActionButton extends StatefulWidget {
this.tooltip,
this.foregroundColor,
this.backgroundColor,
this.heroTag: const _DefaultHeroTag(),
this.elevation: 6.0,
this.highlightElevation: 12.0,
this.heroTag = const _DefaultHeroTag(),
this.elevation = 6.0,
this.highlightElevation = 12.0,
@required this.onPressed,
this.mini: false,
this.notchMargin: 4.0,
this.shape: const CircleBorder(),
this.isExtended: false,
this.mini = false,
this.notchMargin = 4.0,
this.shape = const CircleBorder(),
this.isExtended = false,
}) : assert(elevation != null),
assert(highlightElevation != null),
assert(mini != null),
@ -97,13 +97,13 @@ class FloatingActionButton extends StatefulWidget {
this.tooltip,
this.foregroundColor,
this.backgroundColor,
this.heroTag: const _DefaultHeroTag(),
this.elevation: 6.0,
this.highlightElevation: 12.0,
this.heroTag = const _DefaultHeroTag(),
this.elevation = 6.0,
this.highlightElevation = 12.0,
@required this.onPressed,
this.notchMargin: 4.0,
this.shape: const StadiumBorder(),
this.isExtended: true,
this.notchMargin = 4.0,
this.shape = const StadiumBorder(),
this.isExtended = true,
@required Widget icon,
@required Widget label,
}) : assert(elevation != null),

View File

@ -21,10 +21,10 @@ class FlutterLogo extends StatelessWidget {
Key key,
this.size,
this.colors,
this.textColor: const Color(0xFF616161),
this.style: FlutterLogoStyle.markOnly,
this.duration: const Duration(milliseconds: 750),
this.curve: Curves.fastOutSlowIn,
this.textColor = const Color(0xFF616161),
this.style = FlutterLogoStyle.markOnly,
this.duration = const Duration(milliseconds: 750),
this.curve = Curves.fastOutSlowIn,
}) : super(key: key);
/// The size of the logo in logical pixels.

View File

@ -71,9 +71,9 @@ class IconButton extends StatelessWidget {
/// or an [ImageIcon].
const IconButton({
Key key,
this.iconSize: 24.0,
this.padding: const EdgeInsets.all(8.0),
this.alignment: Alignment.center,
this.iconSize = 24.0,
this.padding = const EdgeInsets.all(8.0),
this.alignment = Alignment.center,
@required this.icon,
this.color,
this.highlightColor,

View File

@ -148,10 +148,10 @@ class Ink extends StatefulWidget {
@required ImageProvider image,
ColorFilter colorFilter,
BoxFit fit,
AlignmentGeometry alignment: Alignment.center,
AlignmentGeometry alignment = Alignment.center,
Rect centerSlice,
ImageRepeat repeat: ImageRepeat.noRepeat,
bool matchTextDirection: false,
ImageRepeat repeat = ImageRepeat.noRepeat,
bool matchTextDirection = false,
this.width,
this.height,
this.child,

View File

@ -39,7 +39,7 @@ class InkHighlight extends InteractiveInkFeature {
@required MaterialInkController controller,
@required RenderBox referenceBox,
@required Color color,
BoxShape shape: BoxShape.rectangle,
BoxShape shape = BoxShape.rectangle,
BorderRadius borderRadius,
RectCallback rectCallback,
VoidCallback onRemoved,

View File

@ -45,7 +45,7 @@ class _InkRippleFactory extends InteractiveInkFeatureFactory {
@required RenderBox referenceBox,
@required Offset position,
@required Color color,
bool containedInkWell: false,
bool containedInkWell = false,
RectCallback rectCallback,
BorderRadius borderRadius,
double radius,
@ -112,7 +112,7 @@ class InkRipple extends InteractiveInkFeature {
@required RenderBox referenceBox,
@required Offset position,
@required Color color,
bool containedInkWell: false,
bool containedInkWell = false,
RectCallback rectCallback,
BorderRadius borderRadius,
double radius,

View File

@ -51,7 +51,7 @@ class _InkSplashFactory extends InteractiveInkFeatureFactory {
@required RenderBox referenceBox,
@required Offset position,
@required Color color,
bool containedInkWell: false,
bool containedInkWell = false,
RectCallback rectCallback,
BorderRadius borderRadius,
double radius,
@ -116,7 +116,7 @@ class InkSplash extends InteractiveInkFeature {
@required RenderBox referenceBox,
Offset position,
Color color,
bool containedInkWell: false,
bool containedInkWell = false,
RectCallback rectCallback,
BorderRadius borderRadius,
double radius,

View File

@ -92,7 +92,7 @@ abstract class InteractiveInkFeatureFactory {
@required RenderBox referenceBox,
@required Offset position,
@required Color color,
bool containedInkWell: false,
bool containedInkWell = false,
RectCallback rectCallback,
BorderRadius borderRadius,
double radius,
@ -197,15 +197,15 @@ class InkResponse extends StatefulWidget {
this.onDoubleTap,
this.onLongPress,
this.onHighlightChanged,
this.containedInkWell: false,
this.highlightShape: BoxShape.circle,
this.containedInkWell = false,
this.highlightShape = BoxShape.circle,
this.radius,
this.borderRadius,
this.highlightColor,
this.splashColor,
this.splashFactory,
this.enableFeedback: true,
this.excludeFromSemantics: false,
this.enableFeedback = true,
this.excludeFromSemantics = false,
}) : assert(containedInkWell != null),
assert(highlightShape != null),
assert(enableFeedback != null),
@ -626,8 +626,8 @@ class InkWell extends InkResponse {
InteractiveInkFeatureFactory splashFactory,
double radius,
BorderRadius borderRadius,
bool enableFeedback: true,
bool excludeFromSemantics: false,
bool enableFeedback = true,
bool excludeFromSemantics = false,
}) : super(
key: key,
child: child,

View File

@ -42,7 +42,7 @@ abstract class InputBorder extends ShapeBorder {
/// substitutes its own, using [copyWith], based on the current theme and
/// [InputDecorator.isFocused].
const InputBorder({
this.borderSide: BorderSide.none,
this.borderSide = BorderSide.none,
}) : assert(borderSide != null);
/// Defines the border line's color and weight.
@ -73,8 +73,8 @@ abstract class InputBorder extends ShapeBorder {
@override
void paint(Canvas canvas, Rect rect, {
double gapStart,
double gapExtent: 0.0,
double gapPercentage: 0.0,
double gapExtent = 0.0,
double gapPercentage = 0.0,
TextDirection textDirection,
});
}
@ -108,8 +108,8 @@ class _NoInputBorder extends InputBorder {
@override
void paint(Canvas canvas, Rect rect, {
double gapStart,
double gapExtent: 0.0,
double gapPercentage: 0.0,
double gapExtent = 0.0,
double gapPercentage = 0.0,
TextDirection textDirection,
}) {
// Do not paint.
@ -139,8 +139,8 @@ class UnderlineInputBorder extends InputBorder {
/// and right corners have a circular radius of 4.0. The [borderRadius]
/// parameter must not be null.
const UnderlineInputBorder({
BorderSide borderSide: BorderSide.none,
this.borderRadius: const BorderRadius.only(
BorderSide borderSide = BorderSide.none,
this.borderRadius = const BorderRadius.only(
topLeft: const Radius.circular(4.0),
topRight: const Radius.circular(4.0),
),
@ -217,8 +217,8 @@ class UnderlineInputBorder extends InputBorder {
@override
void paint(Canvas canvas, Rect rect, {
double gapStart,
double gapExtent: 0.0,
double gapPercentage: 0.0,
double gapExtent = 0.0,
double gapPercentage = 0.0,
TextDirection textDirection,
}) {
if (borderRadius.bottomLeft != Radius.zero || borderRadius.bottomRight != Radius.zero)
@ -266,9 +266,9 @@ class OutlineInputBorder extends InputBorder {
/// must not be null and the corner radii must be circular, i.e. their
/// [Radius.x] and [Radius.y] values must be the same.
const OutlineInputBorder({
BorderSide borderSide: BorderSide.none,
this.borderRadius: const BorderRadius.all(const Radius.circular(4.0)),
this.gapPadding: 4.0,
BorderSide borderSide = BorderSide.none,
this.borderRadius = const BorderRadius.all(const Radius.circular(4.0)),
this.gapPadding = 4.0,
}) : assert(borderRadius != null),
assert(gapPadding != null && gapPadding >= 0.0),
super(borderSide: borderSide);
@ -437,8 +437,8 @@ class OutlineInputBorder extends InputBorder {
@override
void paint(Canvas canvas, Rect rect, {
double gapStart,
double gapExtent: 0.0,
double gapPercentage: 0.0,
double gapExtent = 0.0,
double gapPercentage = 0.0,
TextDirection textDirection,
}) {
assert(gapExtent != null);

View File

@ -1344,8 +1344,8 @@ class InputDecorator extends StatefulWidget {
this.decoration,
this.baseStyle,
this.textAlign,
this.isFocused: false,
this.isEmpty: false,
this.isFocused = false,
this.isEmpty = false,
this.child,
}) : assert(isFocused != null),
assert(isEmpty != null),
@ -1827,7 +1827,7 @@ class InputDecoration {
this.filled,
this.fillColor,
this.border,
this.enabled: true,
this.enabled = true,
}) : assert(enabled != null), isCollapsed = false;
/// Defines an [InputDecorator] that is the same size as the input field.
@ -1838,10 +1838,10 @@ class InputDecoration {
const InputDecoration.collapsed({
@required this.hintText,
this.hintStyle,
this.filled: false,
this.filled = false,
this.fillColor,
this.border: InputBorder.none,
this.enabled: true,
this.border = InputBorder.none,
this.enabled = true,
}) : assert(enabled != null),
icon = null,
labelText = null,
@ -2322,15 +2322,15 @@ class InputDecorationTheme extends Diagnosticable {
this.hintStyle,
this.errorStyle,
this.errorMaxLines,
this.isDense: false,
this.isDense = false,
this.contentPadding,
this.isCollapsed: false,
this.isCollapsed = false,
this.prefixStyle,
this.suffixStyle,
this.counterStyle,
this.filled: false,
this.filled = false,
this.fillColor,
this.border: const UnderlineInputBorder(),
this.border = const UnderlineInputBorder(),
}) : assert(isDense != null),
assert(isCollapsed != null),
assert(filled != null),

View File

@ -41,8 +41,8 @@ class ListTileTheme extends InheritedWidget {
/// [ListTile]s.
const ListTileTheme({
Key key,
this.dense: false,
this.style: ListTileStyle.list,
this.dense = false,
this.style = ListTileStyle.list,
this.selectedColor,
this.iconColor,
this.textColor,
@ -222,13 +222,13 @@ class ListTile extends StatelessWidget {
this.title,
this.subtitle,
this.trailing,
this.isThreeLine: false,
this.isThreeLine = false,
this.dense,
this.contentPadding,
this.enabled: true,
this.enabled = true,
this.onTap,
this.onLongPress,
this.selected: false,
this.selected = false,
}) : assert(isThreeLine != null),
assert(enabled != null),
assert(selected != null),

View File

@ -164,14 +164,14 @@ class Material extends StatefulWidget {
/// catch likely errors.
const Material({
Key key,
this.type: MaterialType.canvas,
this.elevation: 0.0,
this.type = MaterialType.canvas,
this.elevation = 0.0,
this.color,
this.shadowColor: const Color(0xFF000000),
this.shadowColor = const Color(0xFF000000),
this.textStyle,
this.borderRadius,
this.shape,
this.animationDuration: kThemeChangeDuration,
this.animationDuration = kThemeChangeDuration,
this.child,
}) : assert(type != null),
assert(elevation != null),
@ -585,7 +585,7 @@ class _MaterialInterior extends ImplicitlyAnimatedWidget {
@required this.elevation,
@required this.color,
@required this.shadowColor,
Curve curve: Curves.linear,
Curve curve = Curves.linear,
@required Duration duration,
}) : assert(child != null),
assert(shape != null),

View File

@ -168,7 +168,7 @@ abstract class MaterialLocalizations {
///
/// The documentation for [TimeOfDayFormat] enum values provides details on
/// each supported layout.
TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat: false });
TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat = false });
/// Provides geometric text preferences for the current locale.
///
@ -196,7 +196,7 @@ abstract class MaterialLocalizations {
///
/// If [alwaysUse24HourFormat] is true, formats hour using [HourFormat.HH]
/// rather than the default for the current locale.
String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false });
String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false });
/// Formats [TimeOfDay.minute] in the given time of day according to the value
/// of [timeOfDayFormat].
@ -208,7 +208,7 @@ abstract class MaterialLocalizations {
/// rather than the default for the current locale. This value is usually
/// passed from [MediaQueryData.alwaysUse24HourFormat], which has platform-
/// specific behavior.
String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false });
String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false });
/// Full unabbreviated year format, e.g. 2017 rather than 17.
String formatYear(DateTime date);
@ -388,7 +388,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
];
@override
String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }) {
String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false }) {
final TimeOfDayFormat format = timeOfDayFormat(alwaysUse24HourFormat: alwaysUse24HourFormat);
switch (format) {
case TimeOfDayFormat.h_colon_mm_space_a:
@ -473,7 +473,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
}
@override
String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }) {
String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false }) {
// Not using intl.DateFormat for two reasons:
//
// - DateFormat supports more formats than our material time picker does,
@ -622,7 +622,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
String get modalBarrierDismissLabel => 'Dismiss';
@override
TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat: false }) {
TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat = false }) {
return alwaysUse24HourFormat
? TimeOfDayFormat.HH_colon_mm
: TimeOfDayFormat.h_colon_mm_space_a;

Some files were not shown because too many files have changed in this diff Show More