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_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested # - prefer_constructors_over_static_methods # not yet tested
- prefer_contains - 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_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_fields
- prefer_final_locals - prefer_final_locals

View File

@ -115,7 +115,7 @@ linter:
- prefer_const_literals_to_create_immutables - prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested # - prefer_constructors_over_static_methods # not yet tested
- prefer_contains - 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_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_fields
- prefer_final_locals - prefer_final_locals

View File

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

View File

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

View File

@ -144,7 +144,7 @@ class _TaskRunner {
/// A result of running a single task. /// A result of running a single task.
class TaskResult { class TaskResult {
/// Constructs a successful result. /// Constructs a successful result.
TaskResult.success(this.data, {this.benchmarkScoreKeys: const <String>[]}) TaskResult.success(this.data, {this.benchmarkScoreKeys = const <String>[]})
: this.succeeded = true, : this.succeeded = true,
this.message = 'success' { this.message = 'success' {
const JsonEncoder prettyJson = const JsonEncoder.withIndent(' '); 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 /// Running the task in [silent] mode will suppress standard output from task
/// processes and only print standard errors. /// 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'; final String taskExecutable = 'bin/tasks/$taskName.dart';
if (!file(taskExecutable).existsSync()) if (!file(taskExecutable).existsSync())

View File

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

View File

@ -12,13 +12,13 @@ import '../framework/framework.dart';
import '../framework/ios.dart'; import '../framework/ios.dart';
import '../framework/utils.dart'; import '../framework/utils.dart';
TaskFunction createGalleryTransitionTest({ bool semanticsEnabled: false }) { TaskFunction createGalleryTransitionTest({ bool semanticsEnabled = false }) {
return new GalleryTransitionTest(semanticsEnabled: semanticsEnabled); return new GalleryTransitionTest(semanticsEnabled: semanticsEnabled);
} }
class GalleryTransitionTest { class GalleryTransitionTest {
GalleryTransitionTest({ this.semanticsEnabled: false }); GalleryTransitionTest({ this.semanticsEnabled = false });
final bool semanticsEnabled; 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 _editedFlutterGalleryDir = dir(path.join(Directory.systemTemp.path, 'edited_flutter_gallery'));
final Directory flutterGalleryDir = dir(path.join(flutterDirectory.path, 'examples/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 { return () async {
final Device device = await devices.workingDevice; final Device device = await devices.workingDevice;
await device.unlock(); await device.unlock();

View File

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

View File

@ -108,7 +108,7 @@ TaskFunction createBasicMaterialCompileTest() {
class StartupTest { class StartupTest {
static const Duration _startupTimeout = const Duration(minutes: 5); 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 String testDirectory;
final bool reportMetrics; 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. // Generate blobs instead of assembly.
await flutter('clean'); await flutter('clean');
final Stopwatch watch = new Stopwatch()..start(); final Stopwatch watch = new Stopwatch()..start();
@ -258,7 +258,7 @@ class CompileTest {
return metrics; 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'); await flutter('clean');
final Stopwatch watch = new Stopwatch(); final Stopwatch watch = new Stopwatch();
int releaseSizeInBytes; 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'); await flutter('clean');
final Stopwatch watch = new Stopwatch(); final Stopwatch watch = new Stopwatch();
final List<String> options = <String>['--debug']; 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( return new ListTile(
onTap: enabled ? callback : null, onTap: enabled ? callback : null,
title: new Text(label), 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( return new ListTile(
leading: new Icon(icon), leading: new Icon(icon),
title: new Text(label), 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( return new ListTile(
leading: new Icon(icon), leading: new Icon(icon),
title: new Text(label), 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( return new ListTile(
leading: new Icon(icon), leading: new Icon(icon),
title: new Text(label), title: new Text(label),

View File

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

View File

@ -59,9 +59,9 @@ class _MarkerPainter extends CustomPainter {
class Marker extends StatelessWidget { class Marker extends StatelessWidget {
const Marker({ const Marker({
Key key, Key key,
this.type: MarkerType.touch, this.type = MarkerType.touch,
this.position, this.position,
this.size: 40.0, this.size = 40.0,
}) : super(key: key); }) : super(key: key);
final Offset position; 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: // The following three tables are derived from UnicodeData.txt:
// http://unicode.org/Public/UNIDATA/UnicodeData.txt // http://unicode.org/Public/UNIDATA/UnicodeData.txt
// There are three groups, character classes Mc, Me, and Mn. // 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. /// Returns import or on-disk paths for all libraries in the Flutter SDK.
/// ///
/// diskPath toggles between import paths vs. disk paths. /// 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()) { for (Directory dir in findPackages()) {
final String dirName = path.basename(dir.path); final String dirName = path.basename(dir.path);
for (FileSystemEntity file in new Directory('${dir.path}/lib').listSync()) { 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(prefix != null);
assert(filter != null); assert(filter != null);
stream stream

View File

@ -157,7 +157,7 @@ class CardItem extends StatelessWidget {
@required this.animation, @required this.animation,
this.onTap, this.onTap,
@required this.item, @required this.item,
this.selected: false this.selected = false
}) : assert(animation != null), }) : assert(animation != null),
assert(item != null && item >= 0), assert(item != null && item >= 0),
assert(selected != null), 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( return new SpinnerButton(
rowOrder: rowOrder, rowOrder: rowOrder,
columnOrder: columnOrder, columnOrder: columnOrder,

View File

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

View File

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

View File

@ -99,7 +99,7 @@ class SectionTitle extends StatelessWidget {
// Small horizontal bar that indicates the selected section. // Small horizontal bar that indicates the selected section.
class SectionIndicator extends StatelessWidget { 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; final double opacity;

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@ class SliderDemo extends StatefulWidget {
_SliderDemoState createState() => new _SliderDemoState(); _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 Path thumbPath = new Path();
final double height = math.sqrt(3.0) / 2.0; final double height = math.sqrt(3.0) / 2.0;
final double halfSide = size / 2.0; final double halfSide = size / 2.0;

View File

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

View File

@ -70,7 +70,7 @@ class Product {
} }
class Order { 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(product != null),
assert(quantity != null && quantity >= 0), assert(quantity != null && quantity >= 0),
assert(inCart != null); assert(inCart != null);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@ import 'package:flutter/rendering.dart';
import '../rendering/src/solid_color_box.dart'; import '../rendering/src/solid_color_box.dart';
// Solid colour, RenderObject version // 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); final RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor);
parent.add(child); parent.add(child);
final FlexParentData childParentData = child.parentData; final FlexParentData childParentData = child.parentData;

View File

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

View File

@ -95,7 +95,7 @@ class Interval extends Curve {
/// Creates an interval curve. /// Creates an interval curve.
/// ///
/// The arguments must not be null. /// 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(begin != null),
assert(end != null), assert(end != null),
assert(curve != null); assert(curve != null);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -239,7 +239,7 @@ class CachingIterable<E> extends IterableBase<E> {
} }
@override @override
List<E> toList({ bool growable: true }) { List<E> toList({ bool growable = true }) {
_precacheEntireList(); _precacheEntireList();
return new List<E>.from(_results, growable: growable); 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 /// See [https://docs.flutter.io/flutter/foundation/foundation-library.html] for
/// a complete list. /// a complete list.
bool debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debugPrintOverride: debugPrintThrottled }) { bool debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debugPrintOverride = debugPrintThrottled }) {
assert(() { assert(() {
if (debugPrint != debugPrintOverride || if (debugPrint != debugPrintOverride ||
debugDefaultTargetPlatformOverride != null) debugDefaultTargetPlatformOverride != null)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -32,7 +32,7 @@ class ScaleStartDetails {
/// Creates details for [GestureScaleStartCallback]. /// Creates details for [GestureScaleStartCallback].
/// ///
/// The [focalPoint] argument must not be null. /// The [focalPoint] argument must not be null.
ScaleStartDetails({ this.focalPoint: Offset.zero }) ScaleStartDetails({ this.focalPoint = Offset.zero })
: assert(focalPoint != null); : assert(focalPoint != null);
/// The initial focal point of the pointers in contact with the screen. /// 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] /// The [focalPoint] and [scale] arguments must not be null. The [scale]
/// argument must be greater than or equal to zero. /// argument must be greater than or equal to zero.
ScaleUpdateDetails({ ScaleUpdateDetails({
this.focalPoint: Offset.zero, this.focalPoint = Offset.zero,
this.scale: 1.0, this.scale = 1.0,
}) : assert(focalPoint != null), }) : assert(focalPoint != null),
assert(scale != null && scale >= 0.0); assert(scale != null && scale >= 0.0);
@ -72,7 +72,7 @@ class ScaleEndDetails {
/// Creates details for [GestureScaleEndCallback]. /// Creates details for [GestureScaleEndCallback].
/// ///
/// The [velocity] argument must not be null. /// The [velocity] argument must not be null.
ScaleEndDetails({ this.velocity: Velocity.zero }) ScaleEndDetails({ this.velocity = Velocity.zero })
: assert(velocity != null); : assert(velocity != null);
/// The velocity of the last pointer to be lifted off of the screen. /// 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]. /// Creates details for a [GestureTapDownCallback].
/// ///
/// The [globalPosition] argument must not be null. /// The [globalPosition] argument must not be null.
TapDownDetails({ this.globalPosition: Offset.zero }) TapDownDetails({ this.globalPosition = Offset.zero })
: assert(globalPosition != null); : assert(globalPosition != null);
/// The global position at which the pointer contacted the screen. /// The global position at which the pointer contacted the screen.
@ -33,7 +33,7 @@ class TapUpDetails {
/// Creates details for a [GestureTapUpCallback]. /// Creates details for a [GestureTapUpCallback].
/// ///
/// The [globalPosition] argument must not be null. /// The [globalPosition] argument must not be null.
TapUpDetails({ this.globalPosition: Offset.zero }) TapUpDetails({ this.globalPosition = Offset.zero })
: assert(globalPosition != null); : assert(globalPosition != null);
/// The global position at which the pointer contacted the screen. /// 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. /// values default to the empty string.
const AboutListTile({ const AboutListTile({
Key key, Key key,
this.icon: const Icon(null), this.icon = const Icon(null),
this.child, this.child,
this.applicationName, this.applicationName,
this.applicationVersion, this.applicationVersion,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -29,9 +29,9 @@ class ButtonBar extends StatelessWidget {
/// The alignment argument defaults to [MainAxisAlignment.end]. /// The alignment argument defaults to [MainAxisAlignment.end].
const ButtonBar({ const ButtonBar({
Key key, Key key,
this.alignment: MainAxisAlignment.end, this.alignment = MainAxisAlignment.end,
this.mainAxisSize: MainAxisSize.max, this.mainAxisSize = MainAxisSize.max,
this.children: const <Widget>[], this.children = const <Widget>[],
}) : super(key: key); }) : super(key: key);
/// How the children should be placed along the horizontal axis. /// 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. /// The [textTheme], [minWidth], and [height] arguments must not be null.
ButtonTheme({ ButtonTheme({
Key key, Key key,
ButtonTextTheme textTheme: ButtonTextTheme.normal, ButtonTextTheme textTheme = ButtonTextTheme.normal,
double minWidth: 88.0, double minWidth = 88.0,
double height: 36.0, double height = 36.0,
EdgeInsetsGeometry padding, EdgeInsetsGeometry padding,
ShapeBorder shape, ShapeBorder shape,
bool alignedDropdown: false, bool alignedDropdown = false,
Widget child, Widget child,
}) : assert(textTheme != null), }) : assert(textTheme != null),
assert(minWidth != null && minWidth >= 0.0), assert(minWidth != null && minWidth >= 0.0),
@ -106,12 +106,12 @@ class ButtonTheme extends InheritedWidget {
/// button theme. /// button theme.
ButtonTheme.bar({ ButtonTheme.bar({
Key key, Key key,
ButtonTextTheme textTheme: ButtonTextTheme.accent, ButtonTextTheme textTheme = ButtonTextTheme.accent,
double minWidth: 64.0, double minWidth = 64.0,
double height: 36.0, double height = 36.0,
EdgeInsetsGeometry padding: const EdgeInsets.symmetric(horizontal: 8.0), EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 8.0),
ShapeBorder shape, ShapeBorder shape,
bool alignedDropdown: false, bool alignedDropdown = false,
Widget child, Widget child,
}) : assert(textTheme != null), }) : assert(textTheme != null),
assert(minWidth != null && minWidth >= 0.0), assert(minWidth != null && minWidth >= 0.0),
@ -157,12 +157,12 @@ class ButtonThemeData extends Diagnosticable {
/// ///
/// The [textTheme], [minWidth], and [height] parameters must not be null. /// The [textTheme], [minWidth], and [height] parameters must not be null.
const ButtonThemeData({ const ButtonThemeData({
this.textTheme: ButtonTextTheme.normal, this.textTheme = ButtonTextTheme.normal,
this.minWidth: 88.0, this.minWidth = 88.0,
this.height: 36.0, this.height = 36.0,
EdgeInsetsGeometry padding, EdgeInsetsGeometry padding,
ShapeBorder shape, ShapeBorder shape,
this.alignedDropdown: false, this.alignedDropdown = false,
}) : assert(textTheme != null), }) : assert(textTheme != null),
assert(minWidth != null && minWidth >= 0.0), assert(minWidth != null && minWidth >= 0.0),
assert(height != null && height >= 0.0), assert(height != null && height >= 0.0),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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