diff --git a/analysis_options.yaml b/analysis_options.yaml index dd883acf7e..dd2c05e76d 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -118,7 +118,7 @@ linter: - prefer_const_literals_to_create_immutables # - prefer_constructors_over_static_methods # not yet tested - prefer_contains - # - prefer_equal_for_default_values # not yet tested + - prefer_equal_for_default_values # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods - prefer_final_fields - prefer_final_locals diff --git a/analysis_options_repo.yaml b/analysis_options_repo.yaml index b0bb0f76d9..427474c335 100644 --- a/analysis_options_repo.yaml +++ b/analysis_options_repo.yaml @@ -115,7 +115,7 @@ linter: - prefer_const_literals_to_create_immutables # - prefer_constructors_over_static_methods # not yet tested - prefer_contains - # - prefer_equal_for_default_values # not yet tested + - prefer_equal_for_default_values # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods - prefer_final_fields - prefer_final_locals diff --git a/dev/bots/prepare_package.dart b/dev/bots/prepare_package.dart index be2a5b9795..756466e74d 100644 --- a/dev/bots/prepare_package.dart +++ b/dev/bots/prepare_package.dart @@ -78,9 +78,9 @@ Branch fromBranchName(String name) { class ProcessRunner { ProcessRunner({ ProcessManager processManager, - this.subprocessOutput: true, + this.subprocessOutput = true, this.defaultWorkingDirectory, - this.platform: const LocalPlatform(), + this.platform = const LocalPlatform(), }) : processManager = processManager ?? const LocalProcessManager() { environment = new Map.from(platform.environment); } @@ -112,7 +112,7 @@ class ProcessRunner { Future runProcess( List commandLine, { Directory workingDirectory, - bool failOk: false, + bool failOk = false, }) async { workingDirectory ??= defaultWorkingDirectory ?? Directory.current; if (subprocessOutput) { @@ -193,8 +193,8 @@ class ArchiveCreator { this.revision, this.branch, { ProcessManager processManager, - bool subprocessOutput: true, - this.platform: const LocalPlatform(), + bool subprocessOutput = true, + this.platform = const LocalPlatform(), HttpReader httpReader, }) : assert(revision.length == 40), flutterRoot = new Directory(path.join(tempDir.path, 'flutter')), @@ -430,8 +430,8 @@ class ArchivePublisher { this.version, this.outputFile, { ProcessManager processManager, - bool subprocessOutput: true, - this.platform: const LocalPlatform(), + bool subprocessOutput = true, + this.platform = const LocalPlatform(), }) : assert(revision.length == 40), platformName = platform.operatingSystem.toLowerCase(), metadataGsPath = '$gsReleaseFolder/${getMetadataFilename(platform)}', @@ -528,7 +528,7 @@ class ArchivePublisher { Future _runGsUtil( List args, { Directory workingDirectory, - bool failOk: false, + bool failOk = false, }) async { return _processRunner.runProcess( ['gsutil']..addAll(args), diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 169c4cf951..11b9631048 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -274,7 +274,7 @@ class EvalResult { Future _evalCommand(String executable, List arguments, { String workingDirectory, Map environment, - bool skip: false, + bool skip = false, }) async { final String commandDescription = '${path.relative(executable, from: workingDirectory)} ${arguments.join(' ')}'; final String relativeWorkingDir = path.relative(workingDirectory); @@ -315,10 +315,10 @@ Future _evalCommand(String executable, List arguments, { Future _runCommand(String executable, List arguments, { String workingDirectory, Map environment, - bool expectFailure: false, - bool printOutput: true, - bool skip: false, - Duration timeout: _kLongTimeout, + bool expectFailure = false, + bool printOutput = true, + bool skip = false, + Duration timeout = _kLongTimeout, }) async { final String commandDescription = '${path.relative(executable, from: workingDirectory)} ${arguments.join(' ')}'; final String relativeWorkingDir = path.relative(workingDirectory); @@ -364,11 +364,11 @@ Future _runCommand(String executable, List arguments, { Future _runFlutterTest(String workingDirectory, { String script, - bool expectFailure: false, - bool printOutput: true, - List options: const [], - bool skip: false, - Duration timeout: _kLongTimeout, + bool expectFailure = false, + bool printOutput = true, + List options = const [], + bool skip = false, + Duration timeout = _kLongTimeout, }) { final List args = ['test']..addAll(options); if (flutterTestArgs != null && flutterTestArgs.isNotEmpty) @@ -385,7 +385,7 @@ Future _runFlutterTest(String workingDirectory, { } Future _runFlutterAnalyze(String workingDirectory, { - List options: const [] + List options = const [] }) { return _runCommand(flutter, ['analyze']..addAll(options), workingDirectory: workingDirectory, @@ -464,7 +464,7 @@ bool _matches(List a, List b) { final RegExp _importPattern = new RegExp(r"import 'package:flutter/([^.]+)\.dart'"); final RegExp _importMetaPattern = new RegExp(r"import 'package:meta/meta.dart'"); -Set _findDependencies(String srcPath, List errors, { bool checkForMeta: false }) { +Set _findDependencies(String srcPath, List errors, { bool checkForMeta = false }) { return new Directory(srcPath).listSync(recursive: true).where((FileSystemEntity entity) { return entity is File && path.extension(entity.path) == '.dart'; }).map>((FileSystemEntity entity) { diff --git a/dev/devicelab/lib/framework/framework.dart b/dev/devicelab/lib/framework/framework.dart index 168d180c63..9eca2d9aec 100644 --- a/dev/devicelab/lib/framework/framework.dart +++ b/dev/devicelab/lib/framework/framework.dart @@ -144,7 +144,7 @@ class _TaskRunner { /// A result of running a single task. class TaskResult { /// Constructs a successful result. - TaskResult.success(this.data, {this.benchmarkScoreKeys: const []}) + TaskResult.success(this.data, {this.benchmarkScoreKeys = const []}) : this.succeeded = true, this.message = 'success' { const JsonEncoder prettyJson = const JsonEncoder.withIndent(' '); diff --git a/dev/devicelab/lib/framework/runner.dart b/dev/devicelab/lib/framework/runner.dart index 10912f690f..0e95cb9750 100644 --- a/dev/devicelab/lib/framework/runner.dart +++ b/dev/devicelab/lib/framework/runner.dart @@ -22,7 +22,7 @@ const Duration taskTimeoutWithGracePeriod = const Duration(minutes: 26); /// /// Running the task in [silent] mode will suppress standard output from task /// processes and only print standard errors. -Future> runTask(String taskName, { bool silent: false }) async { +Future> runTask(String taskName, { bool silent = false }) async { final String taskExecutable = 'bin/tasks/$taskName.dart'; if (!file(taskExecutable).existsSync()) diff --git a/dev/devicelab/lib/framework/utils.dart b/dev/devicelab/lib/framework/utils.dart index eaab51691d..b7bbe96f7b 100644 --- a/dev/devicelab/lib/framework/utils.dart +++ b/dev/devicelab/lib/framework/utils.dart @@ -231,7 +231,7 @@ Future exec( String executable, List arguments, { Map environment, - bool canFail: false, + bool canFail = false, }) async { final Process process = await startProcess(executable, arguments, environment: environment); @@ -266,7 +266,7 @@ Future eval( String executable, List arguments, { Map environment, - bool canFail: false, + bool canFail = false, }) async { final Process process = await startProcess(executable, arguments, environment: environment); @@ -297,8 +297,8 @@ Future eval( } Future flutter(String command, { - List options: const [], - bool canFail: false, + List options = const [], + bool canFail = false, Map environment, }) { final List args = [command]..addAll(options); @@ -308,8 +308,8 @@ Future flutter(String command, { /// Runs a `flutter` command and returns the standard output as a string. Future evalFlutter(String command, { - List options: const [], - bool canFail: false, + List options = const [], + bool canFail = false, Map environment, }) { final List args = [command]..addAll(options); diff --git a/dev/devicelab/lib/tasks/gallery.dart b/dev/devicelab/lib/tasks/gallery.dart index 86146e0951..3179f7700f 100644 --- a/dev/devicelab/lib/tasks/gallery.dart +++ b/dev/devicelab/lib/tasks/gallery.dart @@ -12,13 +12,13 @@ import '../framework/framework.dart'; import '../framework/ios.dart'; import '../framework/utils.dart'; -TaskFunction createGalleryTransitionTest({ bool semanticsEnabled: false }) { +TaskFunction createGalleryTransitionTest({ bool semanticsEnabled = false }) { return new GalleryTransitionTest(semanticsEnabled: semanticsEnabled); } class GalleryTransitionTest { - GalleryTransitionTest({ this.semanticsEnabled: false }); + GalleryTransitionTest({ this.semanticsEnabled = false }); final bool semanticsEnabled; diff --git a/dev/devicelab/lib/tasks/hot_mode_tests.dart b/dev/devicelab/lib/tasks/hot_mode_tests.dart index 32aeffb5bc..a710e80e41 100644 --- a/dev/devicelab/lib/tasks/hot_mode_tests.dart +++ b/dev/devicelab/lib/tasks/hot_mode_tests.dart @@ -16,7 +16,7 @@ import '../framework/utils.dart'; final Directory _editedFlutterGalleryDir = dir(path.join(Directory.systemTemp.path, 'edited_flutter_gallery')); final Directory flutterGalleryDir = dir(path.join(flutterDirectory.path, 'examples/flutter_gallery')); -TaskFunction createHotModeTest({ bool isPreviewDart2: true }) { +TaskFunction createHotModeTest({ bool isPreviewDart2 = true }) { return () async { final Device device = await devices.workingDevice; await device.unlock(); diff --git a/dev/devicelab/lib/tasks/microbenchmarks.dart b/dev/devicelab/lib/tasks/microbenchmarks.dart index 8a4bcb0f6b..1d2a67a712 100644 --- a/dev/devicelab/lib/tasks/microbenchmarks.dart +++ b/dev/devicelab/lib/tasks/microbenchmarks.dart @@ -23,7 +23,7 @@ TaskFunction createMicrobenchmarkTask() { final Device device = await devices.workingDevice; await device.unlock(); - Future> _runMicrobench(String benchmarkPath, {bool previewDart2: true}) async { + Future> _runMicrobench(String benchmarkPath, {bool previewDart2 = true}) async { Future> _run() async { print('Running $benchmarkPath'); final Directory appDir = dir( @@ -86,9 +86,9 @@ TaskFunction createMicrobenchmarkTask() { } Future _startFlutter({ - String command: 'run', - List options: const [], - bool canFail: false, + String command = 'run', + List options = const [], + bool canFail = false, Map environment, }) { final List args = ['run']..addAll(options); diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index fdb52438ac..34748de0ac 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -108,7 +108,7 @@ TaskFunction createBasicMaterialCompileTest() { class StartupTest { static const Duration _startupTimeout = const Duration(minutes: 5); - const StartupTest(this.testDirectory, { this.reportMetrics: true }); + const StartupTest(this.testDirectory, { this.reportMetrics = true }); final String testDirectory; final bool reportMetrics; @@ -221,7 +221,7 @@ class CompileTest { ); } - static Future> _compileAot({ bool previewDart2: true }) async { + static Future> _compileAot({ bool previewDart2 = true }) async { // Generate blobs instead of assembly. await flutter('clean'); final Stopwatch watch = new Stopwatch()..start(); @@ -258,7 +258,7 @@ class CompileTest { return metrics; } - static Future> _compileApp({ bool previewDart2: true }) async { + static Future> _compileApp({ bool previewDart2 = true }) async { await flutter('clean'); final Stopwatch watch = new Stopwatch(); int releaseSizeInBytes; @@ -299,7 +299,7 @@ class CompileTest { }; } - static Future> _compileDebug({ bool previewDart2: true }) async { + static Future> _compileDebug({ bool previewDart2 = true }) async { await flutter('clean'); final Stopwatch watch = new Stopwatch(); final List options = ['--debug']; diff --git a/dev/manual_tests/lib/card_collection.dart b/dev/manual_tests/lib/card_collection.dart index 49f8df7a09..0c7663260f 100644 --- a/dev/manual_tests/lib/card_collection.dart +++ b/dev/manual_tests/lib/card_collection.dart @@ -181,7 +181,7 @@ class CardCollectionState extends State { }); } - Widget buildDrawerCheckbox(String label, bool value, void callback(), { bool enabled: true }) { + Widget buildDrawerCheckbox(String label, bool value, void callback(), { bool enabled = true }) { return new ListTile( onTap: enabled ? callback : null, title: new Text(label), @@ -192,7 +192,7 @@ class CardCollectionState extends State { ); } - Widget buildDrawerColorRadioItem(String label, MaterialColor itemValue, MaterialColor currentValue, ValueChanged onChanged, { IconData icon, bool enabled: true }) { + Widget buildDrawerColorRadioItem(String label, MaterialColor itemValue, MaterialColor currentValue, ValueChanged onChanged, { IconData icon, bool enabled = true }) { return new ListTile( leading: new Icon(icon), title: new Text(label), @@ -205,7 +205,7 @@ class CardCollectionState extends State { ); } - Widget buildDrawerDirectionRadioItem(String label, DismissDirection itemValue, DismissDirection currentValue, ValueChanged onChanged, { IconData icon, bool enabled: true }) { + Widget buildDrawerDirectionRadioItem(String label, DismissDirection itemValue, DismissDirection currentValue, ValueChanged onChanged, { IconData icon, bool enabled = true }) { return new ListTile( leading: new Icon(icon), title: new Text(label), @@ -218,7 +218,7 @@ class CardCollectionState extends State { ); } - Widget buildFontRadioItem(String label, TextAlign itemValue, TextAlign currentValue, ValueChanged onChanged, { IconData icon, bool enabled: true }) { + Widget buildFontRadioItem(String label, TextAlign itemValue, TextAlign currentValue, ValueChanged onChanged, { IconData icon, bool enabled = true }) { return new ListTile( leading: new Icon(icon), title: new Text(label), diff --git a/dev/manual_tests/lib/drag_and_drop.dart b/dev/manual_tests/lib/drag_and_drop.dart index 2d9d69bbce..e3084c965c 100644 --- a/dev/manual_tests/lib/drag_and_drop.dart +++ b/dev/manual_tests/lib/drag_and_drop.dart @@ -42,7 +42,7 @@ class ExampleDragTargetState extends State { } class Dot extends StatefulWidget { - const Dot({ Key key, this.color, this.size, this.child, this.tappable: false }) : super(key: key); + const Dot({ Key key, this.color, this.size, this.child, this.tappable = false }) : super(key: key); final Color color; final double size; @@ -77,8 +77,8 @@ class ExampleDragSource extends StatelessWidget { const ExampleDragSource({ Key key, this.color, - this.heavy: false, - this.under: true, + this.heavy = false, + this.under = true, this.child }) : super(key: key); diff --git a/dev/manual_tests/lib/overlay_geometry.dart b/dev/manual_tests/lib/overlay_geometry.dart index b595c01544..8ec50e121b 100644 --- a/dev/manual_tests/lib/overlay_geometry.dart +++ b/dev/manual_tests/lib/overlay_geometry.dart @@ -59,9 +59,9 @@ class _MarkerPainter extends CustomPainter { class Marker extends StatelessWidget { const Marker({ Key key, - this.type: MarkerType.touch, + this.type = MarkerType.touch, this.position, - this.size: 40.0, + this.size = 40.0, }) : super(key: key); final Offset position; diff --git a/dev/manual_tests/lib/text.dart b/dev/manual_tests/lib/text.dart index 9b2567d0c6..63d4bbb717 100644 --- a/dev/manual_tests/lib/text.dart +++ b/dev/manual_tests/lib/text.dart @@ -1060,7 +1060,7 @@ class _PaintingState extends State with SingleTickerProviderStateMixin } } -String zalgo(math.Random random, int targetLength, { bool includeSpacingCombiningMarks: false, String base }) { +String zalgo(math.Random random, int targetLength, { bool includeSpacingCombiningMarks = false, String base }) { // The following three tables are derived from UnicodeData.txt: // http://unicode.org/Public/UNIDATA/UnicodeData.txt // There are three groups, character classes Mc, Me, and Mn. diff --git a/dev/tools/dartdoc.dart b/dev/tools/dartdoc.dart index b235ece2f0..f634a588ee 100644 --- a/dev/tools/dartdoc.dart +++ b/dev/tools/dartdoc.dart @@ -313,7 +313,7 @@ List findPackages() { /// Returns import or on-disk paths for all libraries in the Flutter SDK. /// /// diskPath toggles between import paths vs. disk paths. -Iterable libraryRefs({ bool diskPath: false }) sync* { +Iterable libraryRefs({ bool diskPath = false }) sync* { for (Directory dir in findPackages()) { final String dirName = path.basename(dir.path); for (FileSystemEntity file in new Directory('${dir.path}/lib').listSync()) { @@ -336,7 +336,7 @@ Iterable libraryRefs({ bool diskPath: false }) sync* { } } -void printStream(Stream> stream, { String prefix: '', List filter: const [] }) { +void printStream(Stream> stream, { String prefix = '', List filter = const [] }) { assert(prefix != null); assert(filter != null); stream diff --git a/examples/catalog/lib/animated_list.dart b/examples/catalog/lib/animated_list.dart index 55f6fe41cb..31d173ab0f 100644 --- a/examples/catalog/lib/animated_list.dart +++ b/examples/catalog/lib/animated_list.dart @@ -157,7 +157,7 @@ class CardItem extends StatelessWidget { @required this.animation, this.onTap, @required this.item, - this.selected: false + this.selected = false }) : assert(animation != null), assert(item != null && item >= 0), assert(selected != null), diff --git a/examples/catalog/lib/custom_a11y_traversal.dart b/examples/catalog/lib/custom_a11y_traversal.dart index 6efdbc1f3b..c6ef15b8cf 100644 --- a/examples/catalog/lib/custom_a11y_traversal.dart +++ b/examples/catalog/lib/custom_a11y_traversal.dart @@ -213,7 +213,7 @@ class CustomTraversalExampleState extends State { ); } - Widget _makeSpinnerButton(int rowOrder, int columnOrder, Field field, {bool increment: true}) { + Widget _makeSpinnerButton(int rowOrder, int columnOrder, Field field, {bool increment = true}) { return new SpinnerButton( rowOrder: rowOrder, columnOrder: columnOrder, diff --git a/examples/catalog/test/custom_semantics_test.dart b/examples/catalog/test/custom_semantics_test.dart index be973705e1..73de657f3a 100644 --- a/examples/catalog/test/custom_semantics_test.dart +++ b/examples/catalog/test/custom_semantics_test.dart @@ -92,12 +92,12 @@ void main() { } void expectAdjustable(SemanticsNode node, { - bool hasIncreaseAction: true, - bool hasDecreaseAction: true, - String label: '', - String decreasedValue: '', - String value: '', - String increasedValue: '', + bool hasIncreaseAction = true, + bool hasDecreaseAction = true, + String label = '', + String decreasedValue = '', + String value = '', + String increasedValue = '', }) { final SemanticsData semanticsData = node.getSemanticsData(); diff --git a/examples/flutter_gallery/lib/demo/animation/home.dart b/examples/flutter_gallery/lib/demo/animation/home.dart index c351f3b5cb..e29a26bd2d 100644 --- a/examples/flutter_gallery/lib/demo/animation/home.dart +++ b/examples/flutter_gallery/lib/demo/animation/home.dart @@ -77,7 +77,7 @@ class _StatusBarPaddingSliver extends SingleChildRenderObjectWidget { const _StatusBarPaddingSliver({ Key key, @required this.maxHeight, - this.scrollFactor: 5.0, + this.scrollFactor = 5.0, }) : assert(maxHeight != null && maxHeight >= 0.0), assert(scrollFactor != null && scrollFactor >= 1.0), super(key: key); @@ -265,7 +265,7 @@ class _AllSectionsView extends AnimatedWidget { this.minHeight, this.midHeight, this.maxHeight, - this.sectionCards: const [], + this.sectionCards = const [], }) : assert(sections != null), assert(sectionCards != null), assert(sectionCards.length == sections.length), diff --git a/examples/flutter_gallery/lib/demo/animation/widgets.dart b/examples/flutter_gallery/lib/demo/animation/widgets.dart index fdd07de461..5f1a2f6ff2 100644 --- a/examples/flutter_gallery/lib/demo/animation/widgets.dart +++ b/examples/flutter_gallery/lib/demo/animation/widgets.dart @@ -99,7 +99,7 @@ class SectionTitle extends StatelessWidget { // Small horizontal bar that indicates the selected section. class SectionIndicator extends StatelessWidget { - const SectionIndicator({ Key key, this.opacity: 1.0 }) : super(key: key); + const SectionIndicator({ Key key, this.opacity = 1.0 }) : super(key: key); final double opacity; diff --git a/examples/flutter_gallery/lib/demo/colors_demo.dart b/examples/flutter_gallery/lib/demo/colors_demo.dart index f3a92d0f8e..f35b35d101 100644 --- a/examples/flutter_gallery/lib/demo/colors_demo.dart +++ b/examples/flutter_gallery/lib/demo/colors_demo.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; const double kColorItemHeight = 48.0; class Palette { - Palette({ this.name, this.primary, this.accent, this.threshold: 900}); + Palette({ this.name, this.primary, this.accent, this.threshold = 900}); final String name; final MaterialColor primary; @@ -45,7 +45,7 @@ class ColorItem extends StatelessWidget { Key key, @required this.index, @required this.color, - this.prefix: '', + this.prefix = '', }) : assert(index != null), assert(color != null), assert(prefix != null), diff --git a/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart b/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart index 36fd59357b..19a0a857cf 100644 --- a/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart @@ -402,7 +402,7 @@ class _DemoDrawer extends StatelessWidget { class _DiamondFab extends StatefulWidget { const _DiamondFab({ this.child, - this.notchMargin: 6.0, + this.notchMargin = 6.0, this.onPressed, }); diff --git a/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart b/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart index e76924428b..68c7258515 100644 --- a/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart @@ -77,7 +77,7 @@ class DualHeaderWithHint extends StatelessWidget { class CollapsibleBody extends StatelessWidget { const CollapsibleBody({ - this.margin: EdgeInsets.zero, + this.margin = EdgeInsets.zero, this.child, this.onSave, this.onCancel diff --git a/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart b/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart index ed7e04cf35..95cc295374 100644 --- a/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart @@ -21,7 +21,7 @@ class Photo { this.assetPackage, this.title, this.caption, - this.isFavorite: false, + this.isFavorite = false, }); final String assetName; diff --git a/examples/flutter_gallery/lib/demo/material/slider_demo.dart b/examples/flutter_gallery/lib/demo/material/slider_demo.dart index cb5ec76e51..644de0b10c 100644 --- a/examples/flutter_gallery/lib/demo/material/slider_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/slider_demo.dart @@ -13,7 +13,7 @@ class SliderDemo extends StatefulWidget { _SliderDemoState createState() => new _SliderDemoState(); } -Path _triangle(double size, Offset thumbCenter, {bool invert: false}) { +Path _triangle(double size, Offset thumbCenter, {bool invert = false}) { final Path thumbPath = new Path(); final double height = math.sqrt(3.0) / 2.0; final double halfSide = size / 2.0; diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart index ff7ef6e63b..b12bc8aacb 100644 --- a/examples/flutter_gallery/lib/demo/pesto_demo.dart +++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart @@ -45,9 +45,9 @@ class PestoFavorites extends StatelessWidget { class PestoStyle extends TextStyle { const PestoStyle({ - double fontSize: 12.0, + double fontSize = 12.0, FontWeight fontWeight, - Color color: Colors.black87, + Color color = Colors.black87, double letterSpacing, double height, }) : super( diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_types.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_types.dart index 7982250602..e87aebab78 100644 --- a/examples/flutter_gallery/lib/demo/shrine/shrine_types.dart +++ b/examples/flutter_gallery/lib/demo/shrine/shrine_types.dart @@ -70,7 +70,7 @@ class Product { } class Order { - Order({ @required this.product, this.quantity: 1, this.inCart: false }) + Order({ @required this.product, this.quantity = 1, this.inCart = false }) : assert(product != null), assert(quantity != null && quantity >= 0), assert(inCart != null); diff --git a/examples/flutter_gallery/lib/demo/video_demo.dart b/examples/flutter_gallery/lib/demo/video_demo.dart index 503cd55a13..d24c596d2a 100644 --- a/examples/flutter_gallery/lib/demo/video_demo.dart +++ b/examples/flutter_gallery/lib/demo/video_demo.dart @@ -206,7 +206,7 @@ class FadeAnimation extends StatefulWidget { const FadeAnimation({ this.child, - this.duration: const Duration(milliseconds: 500), + this.duration = const Duration(milliseconds: 500), }); @override diff --git a/examples/flutter_gallery/lib/gallery/app.dart b/examples/flutter_gallery/lib/gallery/app.dart index 7b18744925..8eba99612b 100644 --- a/examples/flutter_gallery/lib/gallery/app.dart +++ b/examples/flutter_gallery/lib/gallery/app.dart @@ -21,11 +21,11 @@ class GalleryApp extends StatefulWidget { const GalleryApp({ Key key, this.updateUrlFetcher, - this.enablePerformanceOverlay: true, - this.enableRasterCacheImagesCheckerboard: true, - this.enableOffscreenLayersCheckerboard: true, + this.enablePerformanceOverlay = true, + this.enableRasterCacheImagesCheckerboard = true, + this.enableOffscreenLayersCheckerboard = true, this.onSendFeedback, - this.testMode: false, + this.testMode = false, }) : super(key: key); final UpdateUrlFetcher updateUrlFetcher; diff --git a/examples/flutter_gallery/lib/gallery/backdrop.dart b/examples/flutter_gallery/lib/gallery/backdrop.dart index 9cf08ca7b9..26eceef07b 100644 --- a/examples/flutter_gallery/lib/gallery/backdrop.dart +++ b/examples/flutter_gallery/lib/gallery/backdrop.dart @@ -79,7 +79,7 @@ class _TappableWhileStatusIsState extends State<_TappableWhileStatusIs> { class _CrossFadeTransition extends AnimatedWidget { const _CrossFadeTransition({ Key key, - this.alignment: Alignment.center, + this.alignment = Alignment.center, Animation progress, this.child0, this.child1, @@ -130,7 +130,7 @@ class _CrossFadeTransition extends AnimatedWidget { class _BackAppBar extends StatelessWidget { const _BackAppBar({ Key key, - this.leading: const SizedBox(width: 56.0), + this.leading = const SizedBox(width: 56.0), @required this.title, this.trailing, }) : assert(leading != null), assert(title != null), super(key: key); diff --git a/examples/flutter_gallery/lib/gallery/home.dart b/examples/flutter_gallery/lib/gallery/home.dart index f285b0f89e..6cb7c6568d 100644 --- a/examples/flutter_gallery/lib/gallery/home.dart +++ b/examples/flutter_gallery/lib/gallery/home.dart @@ -270,7 +270,7 @@ class GalleryHome extends StatefulWidget { const GalleryHome({ Key key, - this.testMode: false, + this.testMode = false, this.optionsPage, }) : super(key: key); diff --git a/examples/flutter_gallery/lib/gallery/options.dart b/examples/flutter_gallery/lib/gallery/options.dart index a515516f65..303719e4c6 100644 --- a/examples/flutter_gallery/lib/gallery/options.dart +++ b/examples/flutter_gallery/lib/gallery/options.dart @@ -12,12 +12,12 @@ class GalleryOptions { GalleryOptions({ this.theme, this.textScaleFactor, - this.textDirection: TextDirection.ltr, - this.timeDilation: 1.0, + this.textDirection = TextDirection.ltr, + this.timeDilation = 1.0, this.platform, - this.showOffscreenLayersCheckerboard: false, - this.showRasterCacheImagesCheckerboard: false, - this.showPerformanceOverlay: false, + this.showOffscreenLayersCheckerboard = false, + this.showRasterCacheImagesCheckerboard = false, + this.showPerformanceOverlay = false, }); final GalleryTheme theme; diff --git a/examples/flutter_gallery/test/example_code_parser_test.dart b/examples/flutter_gallery/test/example_code_parser_test.dart index 0e583d9754..d8d6ba5b77 100644 --- a/examples/flutter_gallery/test/example_code_parser_test.dart +++ b/examples/flutter_gallery/test/example_code_parser_test.dart @@ -44,7 +44,7 @@ class TestAssetBundle extends AssetBundle { Future load(String key) => null; @override - Future loadString(String key, { bool cache: true }) { + Future loadString(String key, { bool cache = true }) { if (key == 'lib/gallery/example_code.dart') return new Future.value(testCodeFile); return null; diff --git a/examples/layers/rendering/src/sector_layout.dart b/examples/layers/rendering/src/sector_layout.dart index 593aa80918..9c835dc3f1 100644 --- a/examples/layers/rendering/src/sector_layout.dart +++ b/examples/layers/rendering/src/sector_layout.dart @@ -11,14 +11,14 @@ const double kTwoPi = 2 * math.pi; class SectorConstraints extends Constraints { const SectorConstraints({ - this.minDeltaRadius: 0.0, - this.maxDeltaRadius: double.infinity, - this.minDeltaTheta: 0.0, - this.maxDeltaTheta: kTwoPi + this.minDeltaRadius = 0.0, + this.maxDeltaRadius = double.infinity, + this.minDeltaTheta = 0.0, + this.maxDeltaTheta = kTwoPi }) : assert(maxDeltaRadius >= minDeltaRadius), assert(maxDeltaTheta >= minDeltaTheta); - const SectorConstraints.tight({ double deltaRadius: 0.0, double deltaTheta: 0.0 }) + const SectorConstraints.tight({ double deltaRadius = 0.0, double deltaTheta = 0.0 }) : minDeltaRadius = deltaRadius, maxDeltaRadius = deltaRadius, minDeltaTheta = deltaTheta, @@ -45,7 +45,7 @@ class SectorConstraints extends Constraints { @override bool debugAssertIsValid({ - bool isAppliedConstraint: false, + bool isAppliedConstraint = false, InformationCollector informationCollector }) { assert(isNormalized); @@ -54,11 +54,11 @@ class SectorConstraints extends Constraints { } class SectorDimensions { - const SectorDimensions({ this.deltaRadius: 0.0, this.deltaTheta: 0.0 }); + const SectorDimensions({ this.deltaRadius = 0.0, this.deltaTheta = 0.0 }); factory SectorDimensions.withConstraints( SectorConstraints constraints, - { double deltaRadius: 0.0, double deltaTheta: 0.0 } + { double deltaRadius = 0.0, double deltaTheta = 0.0 } ) { return new SectorDimensions( deltaRadius: constraints.constrainDeltaRadius(deltaRadius), @@ -215,8 +215,8 @@ class RenderSectorRing extends RenderSectorWithChildren { RenderSectorRing({ BoxDecoration decoration, - double deltaRadius: double.infinity, - double padding: 0.0 + double deltaRadius = double.infinity, + double padding = 0.0 }) : _padding = padding, assert(deltaRadius >= 0.0), _desiredDeltaRadius = deltaRadius, @@ -333,8 +333,8 @@ class RenderSectorSlice extends RenderSectorWithChildren { RenderSectorSlice({ BoxDecoration decoration, - double deltaTheta: kTwoPi, - double padding: 0.0 + double deltaTheta = kTwoPi, + double padding = 0.0 }) : _padding = padding, _desiredDeltaTheta = deltaTheta, super(decoration); double _desiredDeltaTheta; @@ -440,7 +440,7 @@ class RenderSectorSlice extends RenderSectorWithChildren { class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChildMixin { - RenderBoxToRenderSectorAdapter({ double innerRadius: 0.0, RenderSector child }) : + RenderBoxToRenderSectorAdapter({ double innerRadius = 0.0, RenderSector child }) : _innerRadius = innerRadius { this.child = child; } @@ -487,8 +487,8 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil } Size getIntrinsicDimensions({ - double width: double.infinity, - double height: double.infinity + double width = double.infinity, + double height = double.infinity }) { assert(child is RenderSector); assert(child.parentData is SectorParentData); @@ -555,8 +555,8 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil class RenderSolidColor extends RenderDecoratedSector { RenderSolidColor(this.backgroundColor, { - this.desiredDeltaRadius: double.infinity, - this.desiredDeltaTheta: kTwoPi + this.desiredDeltaRadius = double.infinity, + this.desiredDeltaTheta = kTwoPi }) : super(new BoxDecoration(color: backgroundColor)); double desiredDeltaRadius; diff --git a/examples/layers/rendering/src/solid_color_box.dart b/examples/layers/rendering/src/solid_color_box.dart index 073e298393..9b05baeb4a 100644 --- a/examples/layers/rendering/src/solid_color_box.dart +++ b/examples/layers/rendering/src/solid_color_box.dart @@ -9,7 +9,7 @@ class RenderSolidColorBox extends RenderDecoratedBox { final Size desiredSize; final Color backgroundColor; - RenderSolidColorBox(this.backgroundColor, { this.desiredSize: Size.infinite }) + RenderSolidColorBox(this.backgroundColor, { this.desiredSize = Size.infinite }) : super(decoration: new BoxDecoration(color: backgroundColor)); @override diff --git a/examples/layers/widgets/spinning_mixed.dart b/examples/layers/widgets/spinning_mixed.dart index 62b52189c5..876a73454b 100644 --- a/examples/layers/widgets/spinning_mixed.dart +++ b/examples/layers/widgets/spinning_mixed.dart @@ -8,7 +8,7 @@ import 'package:flutter/rendering.dart'; import '../rendering/src/solid_color_box.dart'; // Solid colour, RenderObject version -void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex: 0 }) { +void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex = 0 }) { final RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor); parent.add(child); final FlexParentData childParentData = child.parentData; diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart index f88030cd15..1f4e480036 100644 --- a/packages/flutter/lib/src/animation/animation_controller.dart +++ b/packages/flutter/lib/src/animation/animation_controller.dart @@ -118,8 +118,8 @@ class AnimationController extends Animation double value, this.duration, this.debugLabel, - this.lowerBound: 0.0, - this.upperBound: 1.0, + this.lowerBound = 0.0, + this.upperBound = 1.0, @required TickerProvider vsync, }) : assert(lowerBound != null), assert(upperBound != null), @@ -147,7 +147,7 @@ class AnimationController extends Animation /// physics simulation, especially when the physics simulation has no /// pre-determined bounds. AnimationController.unbounded({ - double value: 0.0, + double value = 0.0, this.duration, this.debugLabel, @required TickerProvider vsync, @@ -358,12 +358,12 @@ class AnimationController extends Animation /// regardless of whether `target` > [value] or not. At the end of the /// animation, when `target` is reached, [status] is reported as /// [AnimationStatus.completed]. - TickerFuture animateTo(double target, { Duration duration, Curve curve: Curves.linear }) { + TickerFuture animateTo(double target, { Duration duration, Curve curve = Curves.linear }) { _direction = _AnimationDirection.forward; return _animateToInternal(target, duration: duration, curve: curve); } - TickerFuture _animateToInternal(double target, { Duration duration, Curve curve: Curves.linear }) { + TickerFuture _animateToInternal(double target, { Duration duration, Curve curve = Curves.linear }) { Duration simulationDuration = duration; if (simulationDuration == null) { assert(() { @@ -441,7 +441,7 @@ class AnimationController extends Animation /// The most recently returned [TickerFuture], if any, is marked as having been /// canceled, meaning the future never completes and its [TickerFuture.orCancel] /// derivative future completes with a [TickerCanceled] error. - TickerFuture fling({ double velocity: 1.0 }) { + TickerFuture fling({ double velocity = 1.0 }) { _direction = velocity < 0.0 ? _AnimationDirection.reverse : _AnimationDirection.forward; final double target = velocity < 0.0 ? lowerBound - _kFlingTolerance.distance : upperBound + _kFlingTolerance.distance; @@ -493,7 +493,7 @@ class AnimationController extends Animation /// and which does send notifications. /// * [forward], [reverse], [animateTo], [animateWith], [fling], and [repeat], /// which restart the animation controller. - void stop({ bool canceled: true }) { + void stop({ bool canceled = true }) { _simulation = null; _lastElapsedDuration = null; _ticker.stop(canceled: canceled); diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index e943da24eb..58b08d40d8 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -95,7 +95,7 @@ class Interval extends Curve { /// Creates an interval curve. /// /// The arguments must not be null. - const Interval(this.begin, this.end, { this.curve: Curves.linear }) + const Interval(this.begin, this.end, { this.curve = Curves.linear }) : assert(begin != null), assert(end != null), assert(curve != null); diff --git a/packages/flutter/lib/src/cupertino/activity_indicator.dart b/packages/flutter/lib/src/cupertino/activity_indicator.dart index 0922c31b55..d5fd58efd9 100644 --- a/packages/flutter/lib/src/cupertino/activity_indicator.dart +++ b/packages/flutter/lib/src/cupertino/activity_indicator.dart @@ -19,8 +19,8 @@ class CupertinoActivityIndicator extends StatefulWidget { /// Creates an iOS-style activity indicator. const CupertinoActivityIndicator({ Key key, - this.animating: true, - this.radius: _kDefaultIndicatorRadius, + this.animating = true, + this.radius = _kDefaultIndicatorRadius, }) : assert(animating != null), assert(radius != null), assert(radius > 0), diff --git a/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart b/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart index df5f221a43..7504629d0a 100644 --- a/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart +++ b/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart @@ -39,11 +39,11 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget { Key key, @required this.items, this.onTap, - this.currentIndex: 0, - this.backgroundColor: _kDefaultTabBarBackgroundColor, - this.activeColor: CupertinoColors.activeBlue, - this.inactiveColor: CupertinoColors.inactiveGray, - this.iconSize: 30.0, + this.currentIndex = 0, + this.backgroundColor = _kDefaultTabBarBackgroundColor, + this.activeColor = CupertinoColors.activeBlue, + this.inactiveColor = CupertinoColors.inactiveGray, + this.iconSize = 30.0, }) : assert(items != null), assert(items.length >= 2), assert(currentIndex != null), diff --git a/packages/flutter/lib/src/cupertino/button.dart b/packages/flutter/lib/src/cupertino/button.dart index 3b0e982910..56ed28ceaa 100644 --- a/packages/flutter/lib/src/cupertino/button.dart +++ b/packages/flutter/lib/src/cupertino/button.dart @@ -50,9 +50,9 @@ class CupertinoButton extends StatefulWidget { @required this.child, this.padding, this.color, - this.minSize: 44.0, - this.pressedOpacity: 0.1, - this.borderRadius: const BorderRadius.all(const Radius.circular(8.0)), + this.minSize = 44.0, + this.pressedOpacity = 0.1, + this.borderRadius = const BorderRadius.all(const Radius.circular(8.0)), @required this.onPressed, }) : assert(pressedOpacity == null || (pressedOpacity >= 0.0 && pressedOpacity <= 1.0)); diff --git a/packages/flutter/lib/src/cupertino/dialog.dart b/packages/flutter/lib/src/cupertino/dialog.dart index b7914f178f..ef3672ac90 100644 --- a/packages/flutter/lib/src/cupertino/dialog.dart +++ b/packages/flutter/lib/src/cupertino/dialog.dart @@ -134,7 +134,7 @@ class CupertinoAlertDialog extends StatelessWidget { Key key, this.title, this.content, - this.actions: const [], + this.actions = const [], this.scrollController, this.actionScrollController, }) : assert(actions != null), @@ -229,8 +229,8 @@ class CupertinoDialogAction extends StatelessWidget { /// Creates an action for an iOS-style dialog. const CupertinoDialogAction({ this.onPressed, - this.isDefaultAction: false, - this.isDestructiveAction: false, + this.isDefaultAction = false, + this.isDestructiveAction = false, @required this.child, }) : assert(child != null); diff --git a/packages/flutter/lib/src/cupertino/nav_bar.dart b/packages/flutter/lib/src/cupertino/nav_bar.dart index c35b203fdc..1e092a7c31 100644 --- a/packages/flutter/lib/src/cupertino/nav_bar.dart +++ b/packages/flutter/lib/src/cupertino/nav_bar.dart @@ -82,12 +82,12 @@ class CupertinoNavigationBar extends StatelessWidget implements ObstructingPrefe const CupertinoNavigationBar({ Key key, this.leading, - this.automaticallyImplyLeading: true, + this.automaticallyImplyLeading = true, this.middle, this.trailing, - this.border: _kDefaultNavBarBorder, - this.backgroundColor: _kDefaultNavBarBackgroundColor, - this.actionsForegroundColor: CupertinoColors.activeBlue, + this.border = _kDefaultNavBarBorder, + this.backgroundColor = _kDefaultNavBarBackgroundColor, + this.actionsForegroundColor = CupertinoColors.activeBlue, }) : assert(automaticallyImplyLeading != null), super(key: key); @@ -192,11 +192,11 @@ class CupertinoSliverNavigationBar extends StatelessWidget { Key key, @required this.largeTitle, this.leading, - this.automaticallyImplyLeading: true, + this.automaticallyImplyLeading = true, this.middle, this.trailing, - this.backgroundColor: _kDefaultNavBarBackgroundColor, - this.actionsForegroundColor: CupertinoColors.activeBlue, + this.backgroundColor = _kDefaultNavBarBackgroundColor, + this.actionsForegroundColor = CupertinoColors.activeBlue, }) : assert(largeTitle != null), assert(automaticallyImplyLeading != null), super(key: key); @@ -447,8 +447,8 @@ class _CupertinoLargeTitleNavigationBarSliverDelegate this.automaticallyImplyLeading, this.middle, this.trailing, - this.border: _kDefaultNavBarBorder, - this.backgroundColor: _kDefaultNavBarBackgroundColor, + this.border = _kDefaultNavBarBorder, + this.backgroundColor = _kDefaultNavBarBackgroundColor, this.actionsForegroundColor, }) : assert(persistentHeight != null); diff --git a/packages/flutter/lib/src/cupertino/page_scaffold.dart b/packages/flutter/lib/src/cupertino/page_scaffold.dart index db017f6637..efa8458c97 100644 --- a/packages/flutter/lib/src/cupertino/page_scaffold.dart +++ b/packages/flutter/lib/src/cupertino/page_scaffold.dart @@ -21,7 +21,7 @@ class CupertinoPageScaffold extends StatelessWidget { const CupertinoPageScaffold({ Key key, this.navigationBar, - this.backgroundColor: CupertinoColors.white, + this.backgroundColor = CupertinoColors.white, @required this.child, }) : assert(child != null), super(key: key); diff --git a/packages/flutter/lib/src/cupertino/picker.dart b/packages/flutter/lib/src/cupertino/picker.dart index 010655bfa9..1fd1430e6b 100644 --- a/packages/flutter/lib/src/cupertino/picker.dart +++ b/packages/flutter/lib/src/cupertino/picker.dart @@ -40,8 +40,8 @@ class CupertinoPicker extends StatefulWidget { /// than using [Colors.transparent]. const CupertinoPicker({ Key key, - this.diameterRatio: _kDefaultDiameterRatio, - this.backgroundColor: _kDefaultBackground, + this.diameterRatio = _kDefaultDiameterRatio, + this.backgroundColor = _kDefaultBackground, this.scrollController, @required this.itemExtent, @required this.onSelectedItemChanged, diff --git a/packages/flutter/lib/src/cupertino/refresh.dart b/packages/flutter/lib/src/cupertino/refresh.dart index 6e50e14e4f..95298924de 100644 --- a/packages/flutter/lib/src/cupertino/refresh.dart +++ b/packages/flutter/lib/src/cupertino/refresh.dart @@ -14,8 +14,8 @@ import 'icons.dart'; class _CupertinoRefreshSliver extends SingleChildRenderObjectWidget { const _CupertinoRefreshSliver({ - this.refreshIndicatorLayoutExtent: 0.0, - this.hasLayoutExtent: false, + this.refreshIndicatorLayoutExtent = 0.0, + this.hasLayoutExtent = false, Widget child, }) : assert(refreshIndicatorLayoutExtent != null), assert(refreshIndicatorLayoutExtent >= 0.0), @@ -266,9 +266,9 @@ class CupertinoRefreshControl extends StatefulWidget { /// /// [onRefresh] will be called when pulled far enough to trigger a refresh. const CupertinoRefreshControl({ - this.refreshTriggerPullDistance: _defaultRefreshTriggerPullDistance, - this.refreshIndicatorExtent: _defaultRefreshIndicatorExtent, - this.builder: buildSimpleRefreshIndicator, + this.refreshTriggerPullDistance = _defaultRefreshTriggerPullDistance, + this.refreshIndicatorExtent = _defaultRefreshIndicatorExtent, + this.builder = buildSimpleRefreshIndicator, this.onRefresh, }) : assert(refreshTriggerPullDistance != null), assert(refreshTriggerPullDistance > 0.0), diff --git a/packages/flutter/lib/src/cupertino/route.dart b/packages/flutter/lib/src/cupertino/route.dart index 69c61663f8..a282a640d5 100644 --- a/packages/flutter/lib/src/cupertino/route.dart +++ b/packages/flutter/lib/src/cupertino/route.dart @@ -80,8 +80,8 @@ class CupertinoPageRoute extends PageRoute { CupertinoPageRoute({ @required this.builder, RouteSettings settings, - this.maintainState: true, - bool fullscreenDialog: false, + this.maintainState = true, + bool fullscreenDialog = false, this.hostRoute, }) : assert(builder != null), assert(maintainState != null), diff --git a/packages/flutter/lib/src/cupertino/slider.dart b/packages/flutter/lib/src/cupertino/slider.dart index bbcb198b2f..309c9c3933 100644 --- a/packages/flutter/lib/src/cupertino/slider.dart +++ b/packages/flutter/lib/src/cupertino/slider.dart @@ -54,10 +54,10 @@ class CupertinoSlider extends StatefulWidget { @required this.onChanged, this.onChangeStart, this.onChangeEnd, - this.min: 0.0, - this.max: 1.0, + this.min = 0.0, + this.max = 1.0, this.divisions, - this.activeColor: CupertinoColors.activeBlue, + this.activeColor = CupertinoColors.activeBlue, }) : assert(value != null), assert(min != null), assert(max != null), diff --git a/packages/flutter/lib/src/cupertino/switch.dart b/packages/flutter/lib/src/cupertino/switch.dart index 75bd69d67b..b1148e2a3c 100644 --- a/packages/flutter/lib/src/cupertino/switch.dart +++ b/packages/flutter/lib/src/cupertino/switch.dart @@ -51,7 +51,7 @@ class CupertinoSwitch extends StatefulWidget { Key key, @required this.value, @required this.onChanged, - this.activeColor: CupertinoColors.activeGreen, + this.activeColor = CupertinoColors.activeGreen, }) : super(key: key); /// Whether this switch is on or off. diff --git a/packages/flutter/lib/src/cupertino/tab_view.dart b/packages/flutter/lib/src/cupertino/tab_view.dart index e468b839e1..a6ee4ae69a 100644 --- a/packages/flutter/lib/src/cupertino/tab_view.dart +++ b/packages/flutter/lib/src/cupertino/tab_view.dart @@ -41,7 +41,7 @@ class CupertinoTabView extends StatelessWidget { this.routes, this.onGenerateRoute, this.onUnknownRoute, - this.navigatorObservers: const [], + this.navigatorObservers = const [], }) : assert(navigatorObservers != null), super(key: key); diff --git a/packages/flutter/lib/src/cupertino/thumb_painter.dart b/packages/flutter/lib/src/cupertino/thumb_painter.dart index 38a5fd8d8e..f65c7410eb 100644 --- a/packages/flutter/lib/src/cupertino/thumb_painter.dart +++ b/packages/flutter/lib/src/cupertino/thumb_painter.dart @@ -12,8 +12,8 @@ import 'colors.dart'; class CupertinoThumbPainter { /// Creates an object that paints an iOS-style slider thumb. CupertinoThumbPainter({ - this.color: CupertinoColors.white, - this.shadowColor: const Color(0x2C000000), + this.color = CupertinoColors.white, + this.shadowColor = const Color(0x2C000000), }) : _shadowPaint = new BoxShadow( color: shadowColor, blurRadius: 1.0, diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index ff2a3804bd..51297a5e5e 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.dart @@ -28,11 +28,11 @@ class FlutterErrorDetails { const FlutterErrorDetails({ this.exception, this.stack, - this.library: 'Flutter framework', + this.library = 'Flutter framework', this.context, this.stackFilter, this.informationCollector, - this.silent: false + this.silent = false }); /// The exception. Often this will be an [AssertionError], maybe specifically @@ -250,7 +250,7 @@ class FlutterError extends AssertionError { /// had not been called before (so the next message is verbose again). /// /// The default behavior for the [onError] handler is to call this function. - static void dumpErrorToConsole(FlutterErrorDetails details, { bool forceReport: false }) { + static void dumpErrorToConsole(FlutterErrorDetails details, { bool forceReport = false }) { assert(details != null); assert(details.exception != null); bool reportError = details.silent != true; // could be null diff --git a/packages/flutter/lib/src/foundation/basic_types.dart b/packages/flutter/lib/src/foundation/basic_types.dart index 701d37ec0a..990586dfef 100644 --- a/packages/flutter/lib/src/foundation/basic_types.dart +++ b/packages/flutter/lib/src/foundation/basic_types.dart @@ -239,7 +239,7 @@ class CachingIterable extends IterableBase { } @override - List toList({ bool growable: true }) { + List toList({ bool growable = true }) { _precacheEntireList(); return new List.from(_results, growable: growable); } diff --git a/packages/flutter/lib/src/foundation/debug.dart b/packages/flutter/lib/src/foundation/debug.dart index b5f585b7cf..ca9b268513 100644 --- a/packages/flutter/lib/src/foundation/debug.dart +++ b/packages/flutter/lib/src/foundation/debug.dart @@ -21,7 +21,7 @@ import 'print.dart'; /// /// See [https://docs.flutter.io/flutter/foundation/foundation-library.html] for /// a complete list. -bool debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debugPrintOverride: debugPrintThrottled }) { +bool debugAssertAllFoundationVarsUnset(String reason, { DebugPrintCallback debugPrintOverride = debugPrintThrottled }) { assert(() { if (debugPrint != debugPrintOverride || debugDefaultTargetPlatformOverride != null) diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart index 87eab4751b..d929c799e8 100644 --- a/packages/flutter/lib/src/foundation/diagnostics.dart +++ b/packages/flutter/lib/src/foundation/diagnostics.dart @@ -135,19 +135,19 @@ class TextTreeConfiguration { @required this.linkCharacter, @required this.propertyPrefixIfChildren, @required this.propertyPrefixNoChildren, - this.lineBreak: '\n', - this.lineBreakProperties: true, - this.afterName: ':', - this.afterDescriptionIfBody: '', - this.beforeProperties: '', - this.afterProperties: '', - this.propertySeparator: '', - this.bodyIndent: '', - this.footer: '', - this.showChildren: true, - this.addBlankLineIfNoChildren: true, - this.isNameOnOwnLine: false, - this.isBlankLineBetweenPropertiesAndChildren: true, + this.lineBreak = '\n', + this.lineBreakProperties = true, + this.afterName = ':', + this.afterDescriptionIfBody = '', + this.beforeProperties = '', + this.afterProperties = '', + this.propertySeparator = '', + this.bodyIndent = '', + this.footer = '', + this.showChildren = true, + this.addBlankLineIfNoChildren = true, + this.isNameOnOwnLine = false, + this.isBlankLineBetweenPropertiesAndChildren = true, }) : assert(prefixLineOne != null), assert(prefixOtherLines != null), assert(prefixLastChildLineOne != null), @@ -639,8 +639,8 @@ abstract class DiagnosticsNode { DiagnosticsNode({ @required this.name, this.style, - this.showName: true, - this.showSeparator: true, + this.showName = true, + this.showSeparator = true, }) : assert(showName != null), assert(showSeparator != null), // A name ending with ':' indicates that the user forgot that the ':' will @@ -659,8 +659,8 @@ abstract class DiagnosticsNode { /// formatted like a property with a separate name and message. factory DiagnosticsNode.message( String message, { - DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine, - DiagnosticLevel level: DiagnosticLevel.info, + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, + DiagnosticLevel level = DiagnosticLevel.info, }) { assert(style != null); assert(level != null); @@ -782,7 +782,7 @@ abstract class DiagnosticsNode { @override String toString({ TextTreeConfiguration parentConfiguration, - DiagnosticLevel minLevel: DiagnosticLevel.info, + DiagnosticLevel minLevel = DiagnosticLevel.info, }) { assert(style != null); assert(minLevel != null); @@ -853,10 +853,10 @@ abstract class DiagnosticsNode { /// * [toStringShallow], for a detailed description of the [value] but not its /// children. String toStringDeep({ - String prefixLineOne: '', + String prefixLineOne = '', String prefixOtherLines, TextTreeConfiguration parentConfiguration, - DiagnosticLevel minLevel: DiagnosticLevel.debug, + DiagnosticLevel minLevel = DiagnosticLevel.debug, }) { assert(minLevel != null); prefixOtherLines ??= prefixLineOne; @@ -1041,7 +1041,7 @@ class MessageProperty extends DiagnosticsProperty { /// /// The [name], `message`, and [level] arguments must not be null. MessageProperty(String name, String message, { - DiagnosticLevel level: DiagnosticLevel.info, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(name != null), assert(message != null), assert(level != null), @@ -1061,11 +1061,11 @@ class StringProperty extends DiagnosticsProperty { StringProperty(String name, String value, { String description, String tooltip, - bool showName: true, - Object defaultValue: kNoDefaultValue, - this.quoted: true, + bool showName = true, + Object defaultValue = kNoDefaultValue, + this.quoted = true, String ifEmpty, - DiagnosticLevel level: DiagnosticLevel.info, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(quoted != null), assert(level != null), @@ -1118,10 +1118,10 @@ abstract class _NumProperty extends DiagnosticsProperty { T value, { String ifNull, this.unit, - bool showName: true, - Object defaultValue: kNoDefaultValue, + bool showName = true, + Object defaultValue = kNoDefaultValue, String tooltip, - DiagnosticLevel level: DiagnosticLevel.info, + DiagnosticLevel level = DiagnosticLevel.info, }) : super( name, value, @@ -1136,10 +1136,10 @@ abstract class _NumProperty extends DiagnosticsProperty { ComputePropertyValueCallback computeValue, { String ifNull, this.unit, - bool showName: true, - Object defaultValue: kNoDefaultValue, + bool showName = true, + Object defaultValue = kNoDefaultValue, String tooltip, - DiagnosticLevel level: DiagnosticLevel.info, + DiagnosticLevel level = DiagnosticLevel.info, }) : super.lazy( name, computeValue, @@ -1189,9 +1189,9 @@ class DoubleProperty extends _NumProperty { String ifNull, String unit, String tooltip, - Object defaultValue: kNoDefaultValue, - bool showName: true, - DiagnosticLevel level: DiagnosticLevel.info, + Object defaultValue = kNoDefaultValue, + bool showName = true, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(level != null), super( @@ -1215,11 +1215,11 @@ class DoubleProperty extends _NumProperty { String name, ComputePropertyValueCallback computeValue, { String ifNull, - bool showName: true, + bool showName = true, String unit, String tooltip, - Object defaultValue: kNoDefaultValue, - DiagnosticLevel level: DiagnosticLevel.info, + Object defaultValue = kNoDefaultValue, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(level != null), super.lazy( @@ -1246,10 +1246,10 @@ class IntProperty extends _NumProperty { /// The [showName] and [level] arguments must not be null. IntProperty(String name, int value, { String ifNull, - bool showName: true, + bool showName = true, String unit, - Object defaultValue: kNoDefaultValue, - DiagnosticLevel level: DiagnosticLevel.info, + Object defaultValue = kNoDefaultValue, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(level != null), super( @@ -1279,10 +1279,10 @@ class PercentProperty extends DoubleProperty { /// The [showName] and [level] arguments must not be null. PercentProperty(String name, double fraction, { String ifNull, - bool showName: true, + bool showName = true, String tooltip, String unit, - DiagnosticLevel level : DiagnosticLevel.info, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(level != null), super( @@ -1357,9 +1357,9 @@ class FlagProperty extends DiagnosticsProperty { @required bool value, this.ifTrue, this.ifFalse, - bool showName: false, + bool showName = false, Object defaultValue, - DiagnosticLevel level: DiagnosticLevel.info, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(level != null), assert(ifTrue != null || ifFalse != null), @@ -1449,12 +1449,12 @@ class IterableProperty extends DiagnosticsProperty> { /// /// The [style], [showName], and [level] arguments must not be null. IterableProperty(String name, Iterable value, { - Object defaultValue: kNoDefaultValue, + Object defaultValue = kNoDefaultValue, String ifNull, - String ifEmpty: '[]', - DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine, - bool showName: true, - DiagnosticLevel level: DiagnosticLevel.info, + String ifEmpty = '[]', + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, + bool showName = true, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(style != null), assert(showName != null), assert(level != null), @@ -1524,8 +1524,8 @@ class EnumProperty extends DiagnosticsProperty { /// /// The [level] argument must also not be null. EnumProperty(String name, T value, { - Object defaultValue: kNoDefaultValue, - DiagnosticLevel level : DiagnosticLevel.info, + Object defaultValue = kNoDefaultValue, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(level != null), super ( name, @@ -1570,8 +1570,8 @@ class ObjectFlagProperty extends DiagnosticsProperty { ObjectFlagProperty(String name, T value, { this.ifPresent, String ifNull, - bool showName: false, - DiagnosticLevel level : DiagnosticLevel.info, + bool showName = false, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(ifPresent != null || ifNull != null), assert(showName != null), assert(level != null), @@ -1592,7 +1592,7 @@ class ObjectFlagProperty extends DiagnosticsProperty { ObjectFlagProperty.has( String name, T value, { - DiagnosticLevel level: DiagnosticLevel.info, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(name != null), assert(level != null), ifPresent = 'has $name', @@ -1686,13 +1686,13 @@ class DiagnosticsProperty extends DiagnosticsNode { String description, String ifNull, this.ifEmpty, - bool showName: true, - bool showSeparator: true, - this.defaultValue: kNoDefaultValue, + bool showName = true, + bool showSeparator = true, + this.defaultValue = kNoDefaultValue, this.tooltip, - this.missingIfNull: false, - DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine, - DiagnosticLevel level: DiagnosticLevel.info, + this.missingIfNull = false, + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(showSeparator != null), assert(style != null), @@ -1728,13 +1728,13 @@ class DiagnosticsProperty extends DiagnosticsNode { String description, String ifNull, this.ifEmpty, - bool showName: true, - bool showSeparator: true, - this.defaultValue: kNoDefaultValue, + bool showName = true, + bool showSeparator = true, + this.defaultValue = kNoDefaultValue, this.tooltip, - this.missingIfNull: false, - DiagnosticsTreeStyle style: DiagnosticsTreeStyle.singleLine, - DiagnosticLevel level: DiagnosticLevel.info, + this.missingIfNull = false, + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(showSeparator != null), assert(defaultValue == kNoDefaultValue || defaultValue is T), @@ -2117,7 +2117,7 @@ abstract class Diagnosticable { String toStringShort() => describeIdentity(this); @override - String toString({ DiagnosticLevel minLevel: DiagnosticLevel.debug }) { + String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) { return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel); } @@ -2382,8 +2382,8 @@ abstract class DiagnosticableTree extends Diagnosticable { /// * [toString], for a brief description of the object. /// * [toStringDeep], for a description of the subtree rooted at this object. String toStringShallow({ - String joiner: ', ', - DiagnosticLevel minLevel: DiagnosticLevel.debug, + String joiner = ', ', + DiagnosticLevel minLevel = DiagnosticLevel.debug, }) { final StringBuffer result = new StringBuffer(); result.write(toString()); @@ -2415,9 +2415,9 @@ abstract class DiagnosticableTree extends Diagnosticable { /// * [toStringShallow], for a detailed description of the object but not its /// children. String toStringDeep({ - String prefixLineOne: '', + String prefixLineOne = '', String prefixOtherLines, - DiagnosticLevel minLevel: DiagnosticLevel.debug, + DiagnosticLevel minLevel = DiagnosticLevel.debug, }) { return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel); } @@ -2466,14 +2466,14 @@ abstract class DiagnosticableTreeMixin implements DiagnosticableTree { factory DiagnosticableTreeMixin._() => null; @override - String toString({ DiagnosticLevel minLevel: DiagnosticLevel.debug }) { + String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) { return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel); } @override String toStringShallow({ - String joiner: ', ', - DiagnosticLevel minLevel: DiagnosticLevel.debug, + String joiner = ', ', + DiagnosticLevel minLevel = DiagnosticLevel.debug, }) { final StringBuffer result = new StringBuffer(); result.write(toStringShort()); @@ -2488,9 +2488,9 @@ abstract class DiagnosticableTreeMixin implements DiagnosticableTree { @override String toStringDeep({ - String prefixLineOne: '', + String prefixLineOne = '', String prefixOtherLines, - DiagnosticLevel minLevel: DiagnosticLevel.debug, + DiagnosticLevel minLevel = DiagnosticLevel.debug, }) { return toDiagnosticsNode().toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel); } diff --git a/packages/flutter/lib/src/foundation/print.dart b/packages/flutter/lib/src/foundation/print.dart index 9639bf8eaa..5057aaef51 100644 --- a/packages/flutter/lib/src/foundation/print.dart +++ b/packages/flutter/lib/src/foundation/print.dart @@ -103,7 +103,7 @@ enum _WordWrapParseMode { inSpace, inWord, atBreak } /// and so forth. It is only intended for formatting error messages. /// /// The default [debugPrint] implementation uses this for its line wrapping. -Iterable debugWordWrap(String message, int width, { String wrapIndent: '' }) sync* { +Iterable debugWordWrap(String message, int width, { String wrapIndent = '' }) sync* { if (message.length < width || message.trimLeft()[0] == '#') { yield message; return; diff --git a/packages/flutter/lib/src/gestures/binding.dart b/packages/flutter/lib/src/gestures/binding.dart index 07d6133397..a7a4928763 100644 --- a/packages/flutter/lib/src/gestures/binding.dart +++ b/packages/flutter/lib/src/gestures/binding.dart @@ -168,7 +168,7 @@ class FlutterErrorDetailsForPointerEventDispatcher extends FlutterErrorDetails { this.event, this.hitTestEntry, InformationCollector informationCollector, - bool silent: false + bool silent = false }) : super( exception: exception, stack: stack, diff --git a/packages/flutter/lib/src/gestures/drag_details.dart b/packages/flutter/lib/src/gestures/drag_details.dart index d18a05fe74..0a623da80f 100644 --- a/packages/flutter/lib/src/gestures/drag_details.dart +++ b/packages/flutter/lib/src/gestures/drag_details.dart @@ -20,7 +20,7 @@ class DragDownDetails { /// Creates details for a [GestureDragDownCallback]. /// /// The [globalPosition] argument must not be null. - DragDownDetails({ this.globalPosition: Offset.zero }) + DragDownDetails({ this.globalPosition = Offset.zero }) : assert(globalPosition != null); /// The global position at which the pointer contacted the screen. @@ -52,7 +52,7 @@ class DragStartDetails { /// Creates details for a [GestureDragStartCallback]. /// /// The [globalPosition] argument must not be null. - DragStartDetails({ this.sourceTimeStamp, this.globalPosition: Offset.zero }) + DragStartDetails({ this.sourceTimeStamp, this.globalPosition = Offset.zero }) : assert(globalPosition != null); /// Recorded timestamp of the source pointer event that triggered the drag @@ -101,7 +101,7 @@ class DragUpdateDetails { /// The [globalPosition] argument must be provided and must not be null. DragUpdateDetails({ this.sourceTimeStamp, - this.delta: Offset.zero, + this.delta = Offset.zero, this.primaryDelta, @required this.globalPosition }) : assert(delta != null), @@ -165,7 +165,7 @@ class DragEndDetails { /// /// The [velocity] argument must not be null. DragEndDetails({ - this.velocity: Velocity.zero, + this.velocity = Velocity.zero, this.primaryVelocity, }) : assert(velocity != null), assert(primaryVelocity == null diff --git a/packages/flutter/lib/src/gestures/events.dart b/packages/flutter/lib/src/gestures/events.dart index e8eac2dc5b..930be7413e 100644 --- a/packages/flutter/lib/src/gestures/events.dart +++ b/packages/flutter/lib/src/gestures/events.dart @@ -94,27 +94,27 @@ abstract class PointerEvent { /// Abstract const constructor. This constructor enables subclasses to provide /// const constructors so that they can be used in const expressions. const PointerEvent({ - this.timeStamp: Duration.zero, - this.pointer: 0, - this.kind: PointerDeviceKind.touch, - this.device: 0, - this.position: Offset.zero, - this.delta: Offset.zero, - this.buttons: 0, - this.down: false, - this.obscured: false, - this.pressure: 1.0, - this.pressureMin: 1.0, - this.pressureMax: 1.0, - this.distance: 0.0, - this.distanceMax: 0.0, - this.radiusMajor: 0.0, - this.radiusMinor: 0.0, - this.radiusMin: 0.0, - this.radiusMax: 0.0, - this.orientation: 0.0, - this.tilt: 0.0, - this.synthesized: false, + this.timeStamp = Duration.zero, + this.pointer = 0, + this.kind = PointerDeviceKind.touch, + this.device = 0, + this.position = Offset.zero, + this.delta = Offset.zero, + this.buttons = 0, + this.down = false, + this.obscured = false, + this.pressure = 1.0, + this.pressureMin = 1.0, + this.pressureMax = 1.0, + this.distance = 0.0, + this.distanceMax = 0.0, + this.radiusMajor = 0.0, + this.radiusMinor = 0.0, + this.radiusMin = 0.0, + this.radiusMax = 0.0, + this.orientation = 0.0, + this.tilt = 0.0, + this.synthesized = false, }); /// Time of event dispatch, relative to an arbitrary timeline. @@ -289,19 +289,19 @@ class PointerAddedEvent extends PointerEvent { /// /// All of the argument must be non-null. const PointerAddedEvent({ - Duration timeStamp: Duration.zero, - PointerDeviceKind kind: PointerDeviceKind.touch, - int device: 0, - Offset position: Offset.zero, - bool obscured: false, - double pressureMin: 1.0, - double pressureMax: 1.0, - double distance: 0.0, - double distanceMax: 0.0, - double radiusMin: 0.0, - double radiusMax: 0.0, - double orientation: 0.0, - double tilt: 0.0 + Duration timeStamp = Duration.zero, + PointerDeviceKind kind = PointerDeviceKind.touch, + int device = 0, + Offset position = Offset.zero, + bool obscured = false, + double pressureMin = 1.0, + double pressureMax = 1.0, + double distance = 0.0, + double distanceMax = 0.0, + double radiusMin = 0.0, + double radiusMax = 0.0, + double orientation = 0.0, + double tilt = 0.0 }) : super( timeStamp: timeStamp, kind: kind, @@ -328,15 +328,15 @@ class PointerRemovedEvent extends PointerEvent { /// /// All of the argument must be non-null. const PointerRemovedEvent({ - Duration timeStamp: Duration.zero, - PointerDeviceKind kind: PointerDeviceKind.touch, - int device: 0, - bool obscured: false, - double pressureMin: 1.0, - double pressureMax: 1.0, - double distanceMax: 0.0, - double radiusMin: 0.0, - double radiusMax: 0.0 + Duration timeStamp = Duration.zero, + PointerDeviceKind kind = PointerDeviceKind.touch, + int device = 0, + bool obscured = false, + double pressureMin = 1.0, + double pressureMax = 1.0, + double distanceMax = 0.0, + double radiusMin = 0.0, + double radiusMax = 0.0 }) : super( timeStamp: timeStamp, kind: kind, @@ -363,24 +363,24 @@ class PointerHoverEvent extends PointerEvent { /// /// All of the argument must be non-null. const PointerHoverEvent({ - Duration timeStamp: Duration.zero, - PointerDeviceKind kind: PointerDeviceKind.touch, - int device: 0, - Offset position: Offset.zero, - Offset delta: Offset.zero, - int buttons: 0, - bool obscured: false, - double pressureMin: 1.0, - double pressureMax: 1.0, - double distance: 0.0, - double distanceMax: 0.0, - double radiusMajor: 0.0, - double radiusMinor: 0.0, - double radiusMin: 0.0, - double radiusMax: 0.0, - double orientation: 0.0, - double tilt: 0.0, - bool synthesized: false, + Duration timeStamp = Duration.zero, + PointerDeviceKind kind = PointerDeviceKind.touch, + int device = 0, + Offset position = Offset.zero, + Offset delta = Offset.zero, + int buttons = 0, + bool obscured = false, + double pressureMin = 1.0, + double pressureMax = 1.0, + double distance = 0.0, + double distanceMax = 0.0, + double radiusMajor = 0.0, + double radiusMinor = 0.0, + double radiusMin = 0.0, + double radiusMax = 0.0, + double orientation = 0.0, + double tilt = 0.0, + bool synthesized = false, }) : super( timeStamp: timeStamp, kind: kind, @@ -410,23 +410,23 @@ class PointerDownEvent extends PointerEvent { /// /// All of the argument must be non-null. const PointerDownEvent({ - Duration timeStamp: Duration.zero, - int pointer: 0, - PointerDeviceKind kind: PointerDeviceKind.touch, - int device: 0, - Offset position: Offset.zero, - int buttons: 0, - bool obscured: false, - double pressure: 1.0, - double pressureMin: 1.0, - double pressureMax: 1.0, - double distanceMax: 0.0, - double radiusMajor: 0.0, - double radiusMinor: 0.0, - double radiusMin: 0.0, - double radiusMax: 0.0, - double orientation: 0.0, - double tilt: 0.0 + Duration timeStamp = Duration.zero, + int pointer = 0, + PointerDeviceKind kind = PointerDeviceKind.touch, + int device = 0, + Offset position = Offset.zero, + int buttons = 0, + bool obscured = false, + double pressure = 1.0, + double pressureMin = 1.0, + double pressureMax = 1.0, + double distanceMax = 0.0, + double radiusMajor = 0.0, + double radiusMinor = 0.0, + double radiusMin = 0.0, + double radiusMax = 0.0, + double orientation = 0.0, + double tilt = 0.0 }) : super( timeStamp: timeStamp, pointer: pointer, @@ -462,25 +462,25 @@ class PointerMoveEvent extends PointerEvent { /// /// All of the argument must be non-null. const PointerMoveEvent({ - Duration timeStamp: Duration.zero, - int pointer: 0, - PointerDeviceKind kind: PointerDeviceKind.touch, - int device: 0, - Offset position: Offset.zero, - Offset delta: Offset.zero, - int buttons: 0, - bool obscured: false, - double pressure: 1.0, - double pressureMin: 1.0, - double pressureMax: 1.0, - double distanceMax: 0.0, - double radiusMajor: 0.0, - double radiusMinor: 0.0, - double radiusMin: 0.0, - double radiusMax: 0.0, - double orientation: 0.0, - double tilt: 0.0, - bool synthesized: false, + Duration timeStamp = Duration.zero, + int pointer = 0, + PointerDeviceKind kind = PointerDeviceKind.touch, + int device = 0, + Offset position = Offset.zero, + Offset delta = Offset.zero, + int buttons = 0, + bool obscured = false, + double pressure = 1.0, + double pressureMin = 1.0, + double pressureMax = 1.0, + double distanceMax = 0.0, + double radiusMajor = 0.0, + double radiusMinor = 0.0, + double radiusMin = 0.0, + double radiusMax = 0.0, + double orientation = 0.0, + double tilt = 0.0, + bool synthesized = false, }) : super( timeStamp: timeStamp, pointer: pointer, @@ -512,21 +512,21 @@ class PointerUpEvent extends PointerEvent { /// /// All of the argument must be non-null. const PointerUpEvent({ - Duration timeStamp: Duration.zero, - int pointer: 0, - PointerDeviceKind kind: PointerDeviceKind.touch, - int device: 0, - Offset position: Offset.zero, - int buttons: 0, - bool obscured: false, - double pressureMin: 1.0, - double pressureMax: 1.0, - double distance: 0.0, - double distanceMax: 0.0, - double radiusMin: 0.0, - double radiusMax: 0.0, - double orientation: 0.0, - double tilt: 0.0 + Duration timeStamp = Duration.zero, + int pointer = 0, + PointerDeviceKind kind = PointerDeviceKind.touch, + int device = 0, + Offset position = Offset.zero, + int buttons = 0, + bool obscured = false, + double pressureMin = 1.0, + double pressureMax = 1.0, + double distance = 0.0, + double distanceMax = 0.0, + double radiusMin = 0.0, + double radiusMax = 0.0, + double orientation = 0.0, + double tilt = 0.0 }) : super( timeStamp: timeStamp, pointer: pointer, @@ -553,21 +553,21 @@ class PointerCancelEvent extends PointerEvent { /// /// All of the argument must be non-null. const PointerCancelEvent({ - Duration timeStamp: Duration.zero, - int pointer: 0, - PointerDeviceKind kind: PointerDeviceKind.touch, - int device: 0, - Offset position: Offset.zero, - int buttons: 0, - bool obscured: false, - double pressureMin: 1.0, - double pressureMax: 1.0, - double distance: 0.0, - double distanceMax: 0.0, - double radiusMin: 0.0, - double radiusMax: 0.0, - double orientation: 0.0, - double tilt: 0.0 + Duration timeStamp = Duration.zero, + int pointer = 0, + PointerDeviceKind kind = PointerDeviceKind.touch, + int device = 0, + Offset position = Offset.zero, + int buttons = 0, + bool obscured = false, + double pressureMin = 1.0, + double pressureMax = 1.0, + double distance = 0.0, + double distanceMax = 0.0, + double radiusMin = 0.0, + double radiusMax = 0.0, + double orientation = 0.0, + double tilt = 0.0 }) : super( timeStamp: timeStamp, pointer: pointer, diff --git a/packages/flutter/lib/src/gestures/multidrag.dart b/packages/flutter/lib/src/gestures/multidrag.dart index b0adc2571d..5998e236f0 100644 --- a/packages/flutter/lib/src/gestures/multidrag.dart +++ b/packages/flutter/lib/src/gestures/multidrag.dart @@ -526,7 +526,7 @@ class DelayedMultiDragGestureRecognizer extends MultiDragGestureRecognizer<_Dela /// defaults to [kLongPressTimeout] to match [LongPressGestureRecognizer] but /// can be changed for specific behaviors. DelayedMultiDragGestureRecognizer({ - this.delay: kLongPressTimeout, + this.delay = kLongPressTimeout, Object debugOwner, }) : assert(delay != null), super(debugOwner: debugOwner); diff --git a/packages/flutter/lib/src/gestures/multitap.dart b/packages/flutter/lib/src/gestures/multitap.dart index 7fd5205808..35f4a3dae7 100644 --- a/packages/flutter/lib/src/gestures/multitap.dart +++ b/packages/flutter/lib/src/gestures/multitap.dart @@ -316,7 +316,7 @@ class MultiTapGestureRecognizer extends GestureRecognizer { /// The [longTapDelay] defaults to [Duration.zero], which means /// [onLongTapDown] is called immediately after [onTapDown]. MultiTapGestureRecognizer({ - this.longTapDelay: Duration.zero, + this.longTapDelay = Duration.zero, Object debugOwner, }) : super(debugOwner: debugOwner); diff --git a/packages/flutter/lib/src/gestures/pointer_router.dart b/packages/flutter/lib/src/gestures/pointer_router.dart index c8cd758495..184192dc41 100644 --- a/packages/flutter/lib/src/gestures/pointer_router.dart +++ b/packages/flutter/lib/src/gestures/pointer_router.dart @@ -128,7 +128,7 @@ class FlutterErrorDetailsForPointerRouter extends FlutterErrorDetails { this.route, this.event, InformationCollector informationCollector, - bool silent: false + bool silent = false }) : super( exception: exception, stack: stack, diff --git a/packages/flutter/lib/src/gestures/scale.dart b/packages/flutter/lib/src/gestures/scale.dart index 4b10debb21..2d4b197ec9 100644 --- a/packages/flutter/lib/src/gestures/scale.dart +++ b/packages/flutter/lib/src/gestures/scale.dart @@ -32,7 +32,7 @@ class ScaleStartDetails { /// Creates details for [GestureScaleStartCallback]. /// /// The [focalPoint] argument must not be null. - ScaleStartDetails({ this.focalPoint: Offset.zero }) + ScaleStartDetails({ this.focalPoint = Offset.zero }) : assert(focalPoint != null); /// The initial focal point of the pointers in contact with the screen. @@ -50,8 +50,8 @@ class ScaleUpdateDetails { /// The [focalPoint] and [scale] arguments must not be null. The [scale] /// argument must be greater than or equal to zero. ScaleUpdateDetails({ - this.focalPoint: Offset.zero, - this.scale: 1.0, + this.focalPoint = Offset.zero, + this.scale = 1.0, }) : assert(focalPoint != null), assert(scale != null && scale >= 0.0); @@ -72,7 +72,7 @@ class ScaleEndDetails { /// Creates details for [GestureScaleEndCallback]. /// /// The [velocity] argument must not be null. - ScaleEndDetails({ this.velocity: Velocity.zero }) + ScaleEndDetails({ this.velocity = Velocity.zero }) : assert(velocity != null); /// The velocity of the last pointer to be lifted off of the screen. diff --git a/packages/flutter/lib/src/gestures/tap.dart b/packages/flutter/lib/src/gestures/tap.dart index c9034c023a..37c3a75e42 100644 --- a/packages/flutter/lib/src/gestures/tap.dart +++ b/packages/flutter/lib/src/gestures/tap.dart @@ -14,7 +14,7 @@ class TapDownDetails { /// Creates details for a [GestureTapDownCallback]. /// /// The [globalPosition] argument must not be null. - TapDownDetails({ this.globalPosition: Offset.zero }) + TapDownDetails({ this.globalPosition = Offset.zero }) : assert(globalPosition != null); /// The global position at which the pointer contacted the screen. @@ -33,7 +33,7 @@ class TapUpDetails { /// Creates details for a [GestureTapUpCallback]. /// /// The [globalPosition] argument must not be null. - TapUpDetails({ this.globalPosition: Offset.zero }) + TapUpDetails({ this.globalPosition = Offset.zero }) : assert(globalPosition != null); /// The global position at which the pointer contacted the screen. diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index 8fa76cbd72..4ae64f8fb0 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -41,7 +41,7 @@ class AboutListTile extends StatelessWidget { /// values default to the empty string. const AboutListTile({ Key key, - this.icon: const Icon(null), + this.icon = const Icon(null), this.child, this.applicationName, this.applicationVersion, diff --git a/packages/flutter/lib/src/material/app.dart b/packages/flutter/lib/src/material/app.dart index 328cab3368..7ba0242d69 100644 --- a/packages/flutter/lib/src/material/app.dart +++ b/packages/flutter/lib/src/material/app.dart @@ -83,26 +83,26 @@ class MaterialApp extends StatefulWidget { Key key, this.navigatorKey, this.home, - this.routes: const {}, + this.routes = const {}, this.initialRoute, this.onGenerateRoute, this.onUnknownRoute, - this.navigatorObservers: const [], + this.navigatorObservers = const [], this.builder, - this.title: '', + this.title = '', this.onGenerateTitle, this.color, this.theme, this.locale, this.localizationsDelegates, this.localeResolutionCallback, - this.supportedLocales: const [const Locale('en', 'US')], - this.debugShowMaterialGrid: false, - this.showPerformanceOverlay: false, - this.checkerboardRasterCacheImages: false, - this.checkerboardOffscreenLayers: false, - this.showSemanticsDebugger: false, - this.debugShowCheckedModeBanner: true, + this.supportedLocales = const [const Locale('en', 'US')], + this.debugShowMaterialGrid = false, + this.showPerformanceOverlay = false, + this.checkerboardRasterCacheImages = false, + this.checkerboardOffscreenLayers = false, + this.showSemanticsDebugger = false, + this.debugShowCheckedModeBanner = true, }) : assert(routes != null), assert(navigatorObservers != null), assert( diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index e09cb22a66..1b353ab7c7 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -135,21 +135,21 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { AppBar({ Key key, this.leading, - this.automaticallyImplyLeading: true, + this.automaticallyImplyLeading = true, this.title, this.actions, this.flexibleSpace, this.bottom, - this.elevation: 4.0, + this.elevation = 4.0, this.backgroundColor, this.brightness, this.iconTheme, this.textTheme, - this.primary: true, + this.primary = true, this.centerTitle, - this.titleSpacing: NavigationToolbar.kMiddleSpacing, - this.toolbarOpacity: 1.0, - this.bottomOpacity: 1.0, + this.titleSpacing = NavigationToolbar.kMiddleSpacing, + this.toolbarOpacity = 1.0, + this.bottomOpacity = 1.0, }) : assert(automaticallyImplyLeading != null), assert(elevation != null), assert(primary != null), @@ -731,24 +731,24 @@ class SliverAppBar extends StatefulWidget { const SliverAppBar({ Key key, this.leading, - this.automaticallyImplyLeading: true, + this.automaticallyImplyLeading = true, this.title, this.actions, this.flexibleSpace, this.bottom, this.elevation, - this.forceElevated: false, + this.forceElevated = false, this.backgroundColor, this.brightness, this.iconTheme, this.textTheme, - this.primary: true, + this.primary = true, this.centerTitle, - this.titleSpacing: NavigationToolbar.kMiddleSpacing, + this.titleSpacing = NavigationToolbar.kMiddleSpacing, this.expandedHeight, - this.floating: false, - this.pinned: false, - this.snap: false, + this.floating = false, + this.pinned = false, + this.snap = false, }) : assert(automaticallyImplyLeading != null), assert(forceElevated != null), assert(primary != null), diff --git a/packages/flutter/lib/src/material/bottom_app_bar.dart b/packages/flutter/lib/src/material/bottom_app_bar.dart index 11ba91fcd9..b5c008c424 100644 --- a/packages/flutter/lib/src/material/bottom_app_bar.dart +++ b/packages/flutter/lib/src/material/bottom_app_bar.dart @@ -45,8 +45,8 @@ class BottomAppBar extends StatefulWidget { const BottomAppBar({ Key key, this.color, - this.elevation: 8.0, - this.hasNotch: true, + this.elevation = 8.0, + this.hasNotch = true, this.child, }) : assert(elevation != null), assert(elevation >= 0.0), diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index 302b37674a..101a49753a 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -88,10 +88,10 @@ class BottomNavigationBar extends StatefulWidget { Key key, @required this.items, this.onTap, - this.currentIndex: 0, + this.currentIndex = 0, BottomNavigationBarType type, this.fixedColor, - this.iconSize: 24.0, + this.iconSize = 24.0, }) : assert(items != null), assert(items.length >= 2), assert(0 <= currentIndex && currentIndex < items.length), @@ -146,7 +146,7 @@ class _BottomNavigationTile extends StatelessWidget { this.onTap, this.colorTween, this.flex, - this.selected: false, + this.selected = false, this.indexLabel, } ): assert(selected != null); diff --git a/packages/flutter/lib/src/material/button.dart b/packages/flutter/lib/src/material/button.dart index 0c3a5fb49e..afc4c9461c 100644 --- a/packages/flutter/lib/src/material/button.dart +++ b/packages/flutter/lib/src/material/button.dart @@ -35,14 +35,14 @@ class RawMaterialButton extends StatefulWidget { this.fillColor, this.highlightColor, this.splashColor, - this.elevation: 2.0, - this.highlightElevation: 8.0, - this.disabledElevation: 0.0, + this.elevation = 2.0, + this.highlightElevation = 8.0, + this.disabledElevation = 0.0, this.outerPadding, - this.padding: EdgeInsets.zero, - this.constraints: const BoxConstraints(minWidth: 88.0, minHeight: 36.0), - this.shape: const RoundedRectangleBorder(), - this.animationDuration: kThemeChangeDuration, + this.padding = EdgeInsets.zero, + this.constraints = const BoxConstraints(minWidth: 88.0, minHeight: 36.0), + this.shape = const RoundedRectangleBorder(), + this.animationDuration = kThemeChangeDuration, this.child, }) : assert(shape != null), assert(elevation != null), diff --git a/packages/flutter/lib/src/material/button_bar.dart b/packages/flutter/lib/src/material/button_bar.dart index 65be03b173..45e902ebce 100644 --- a/packages/flutter/lib/src/material/button_bar.dart +++ b/packages/flutter/lib/src/material/button_bar.dart @@ -29,9 +29,9 @@ class ButtonBar extends StatelessWidget { /// The alignment argument defaults to [MainAxisAlignment.end]. const ButtonBar({ Key key, - this.alignment: MainAxisAlignment.end, - this.mainAxisSize: MainAxisSize.max, - this.children: const [], + this.alignment = MainAxisAlignment.end, + this.mainAxisSize = MainAxisSize.max, + this.children = const [], }) : super(key: key); /// How the children should be placed along the horizontal axis. diff --git a/packages/flutter/lib/src/material/button_theme.dart b/packages/flutter/lib/src/material/button_theme.dart index 3d9d74b8d7..ef3b954243 100644 --- a/packages/flutter/lib/src/material/button_theme.dart +++ b/packages/flutter/lib/src/material/button_theme.dart @@ -59,12 +59,12 @@ class ButtonTheme extends InheritedWidget { /// The [textTheme], [minWidth], and [height] arguments must not be null. ButtonTheme({ Key key, - ButtonTextTheme textTheme: ButtonTextTheme.normal, - double minWidth: 88.0, - double height: 36.0, + ButtonTextTheme textTheme = ButtonTextTheme.normal, + double minWidth = 88.0, + double height = 36.0, EdgeInsetsGeometry padding, ShapeBorder shape, - bool alignedDropdown: false, + bool alignedDropdown = false, Widget child, }) : assert(textTheme != null), assert(minWidth != null && minWidth >= 0.0), @@ -106,12 +106,12 @@ class ButtonTheme extends InheritedWidget { /// button theme. ButtonTheme.bar({ Key key, - ButtonTextTheme textTheme: ButtonTextTheme.accent, - double minWidth: 64.0, - double height: 36.0, - EdgeInsetsGeometry padding: const EdgeInsets.symmetric(horizontal: 8.0), + ButtonTextTheme textTheme = ButtonTextTheme.accent, + double minWidth = 64.0, + double height = 36.0, + EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 8.0), ShapeBorder shape, - bool alignedDropdown: false, + bool alignedDropdown = false, Widget child, }) : assert(textTheme != null), assert(minWidth != null && minWidth >= 0.0), @@ -157,12 +157,12 @@ class ButtonThemeData extends Diagnosticable { /// /// The [textTheme], [minWidth], and [height] parameters must not be null. const ButtonThemeData({ - this.textTheme: ButtonTextTheme.normal, - this.minWidth: 88.0, - this.height: 36.0, + this.textTheme = ButtonTextTheme.normal, + this.minWidth = 88.0, + this.height = 36.0, EdgeInsetsGeometry padding, ShapeBorder shape, - this.alignedDropdown: false, + this.alignedDropdown = false, }) : assert(textTheme != null), assert(minWidth != null && minWidth >= 0.0), assert(height != null && height >= 0.0), diff --git a/packages/flutter/lib/src/material/card.dart b/packages/flutter/lib/src/material/card.dart index 39bdeeb125..977008bbdb 100644 --- a/packages/flutter/lib/src/material/card.dart +++ b/packages/flutter/lib/src/material/card.dart @@ -65,7 +65,7 @@ class Card extends StatelessWidget { this.color, this.elevation, this.shape, - this.margin: const EdgeInsets.all(4.0), + this.margin = const EdgeInsets.all(4.0), this.child, }) : super(key: key); diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart index 769f2545b7..52e7cefcfb 100644 --- a/packages/flutter/lib/src/material/checkbox.dart +++ b/packages/flutter/lib/src/material/checkbox.dart @@ -55,7 +55,7 @@ class Checkbox extends StatefulWidget { const Checkbox({ Key key, @required this.value, - this.tristate: false, + this.tristate = false, @required this.onChanged, this.activeColor, }) : assert(tristate != null), diff --git a/packages/flutter/lib/src/material/checkbox_list_tile.dart b/packages/flutter/lib/src/material/checkbox_list_tile.dart index 0f3e62c51b..d85d1e8006 100644 --- a/packages/flutter/lib/src/material/checkbox_list_tile.dart +++ b/packages/flutter/lib/src/material/checkbox_list_tile.dart @@ -82,11 +82,11 @@ class CheckboxListTile extends StatelessWidget { this.activeColor, this.title, this.subtitle, - this.isThreeLine: false, + this.isThreeLine = false, this.dense, this.secondary, - this.selected: false, - this.controlAffinity: ListTileControlAffinity.platform, + this.selected = false, + this.controlAffinity = ListTileControlAffinity.platform, }) : assert(value != null), assert(isThreeLine != null), assert(!isThreeLine || subtitle != null), diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index 33f9e2b0bf..cec26a6242 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -533,8 +533,8 @@ class InputChip extends StatelessWidget @required this.label, this.labelStyle, this.labelPadding, - this.selected: false, - this.isEnabled: true, + this.selected = false, + this.isEnabled = true, this.onSelected, this.deleteIcon, this.onDeleted, @@ -844,7 +844,7 @@ class FilterChip extends StatelessWidget @required this.label, this.labelStyle, this.labelPadding, - this.selected: false, + this.selected = false, @required this.onSelected, this.disabledColor, this.selectedColor, @@ -1067,10 +1067,10 @@ class RawChip extends StatefulWidget this.deleteButtonTooltipMessage, this.onPressed, this.onSelected, - this.tapEnabled: true, + this.tapEnabled = true, this.selected, - this.showCheckmark: true, - this.isEnabled: true, + this.showCheckmark = true, + this.isEnabled = true, this.disabledColor, this.selectedColor, this.tooltip, diff --git a/packages/flutter/lib/src/material/data_table.dart b/packages/flutter/lib/src/material/data_table.dart index e3be322c21..03d4a92c8d 100644 --- a/packages/flutter/lib/src/material/data_table.dart +++ b/packages/flutter/lib/src/material/data_table.dart @@ -36,7 +36,7 @@ class DataColumn { const DataColumn({ @required this.label, this.tooltip, - this.numeric: false, + this.numeric = false, this.onSort, }) : assert(label != null); @@ -87,7 +87,7 @@ class DataRow { /// The [cells] argument must not be null. const DataRow({ this.key, - this.selected: false, + this.selected = false, this.onSelectChanged, @required this.cells, }) : assert(cells != null); @@ -98,7 +98,7 @@ class DataRow { /// The [cells] argument must not be null. DataRow.byIndex({ int index, - this.selected: false, + this.selected = false, this.onSelectChanged, @required this.cells, }) : assert(cells != null), @@ -163,8 +163,8 @@ class DataCell { /// text should be provided instead, and then the [placeholder] /// argument should be set to true. const DataCell(this.child, { - this.placeholder: false, - this.showEditIcon: false, + this.placeholder = false, + this.showEditIcon = false, this.onTap, }) : assert(child != null); @@ -259,7 +259,7 @@ class DataTable extends StatelessWidget { Key key, @required this.columns, this.sortColumnIndex, - this.sortAscending: true, + this.sortAscending = true, this.onSelectAll, @required this.rows, }) : assert(columns != null), diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index d19adcad27..3e573e29c3 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -1044,7 +1044,7 @@ Future showDatePicker({ @required DateTime firstDate, @required DateTime lastDate, SelectableDayPredicate selectableDayPredicate, - DatePickerMode initialDatePickerMode: DatePickerMode.day, + DatePickerMode initialDatePickerMode = DatePickerMode.day, Locale locale, TextDirection textDirection, }) async { diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index 0b10724a0c..776fa2b8d8 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -39,8 +39,8 @@ class Dialog extends StatelessWidget { const Dialog({ Key key, this.child, - this.insetAnimationDuration: const Duration(milliseconds: 100), - this.insetAnimationCurve: Curves.decelerate, + this.insetAnimationDuration = const Duration(milliseconds: 100), + this.insetAnimationCurve = Curves.decelerate, }) : super(key: key); /// The widget below this widget in the tree. @@ -164,7 +164,7 @@ class AlertDialog extends StatelessWidget { this.title, this.titlePadding, this.content, - this.contentPadding: const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0), + this.contentPadding = const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0), this.actions, this.semanticLabel, }) : assert(contentPadding != null), @@ -430,9 +430,9 @@ class SimpleDialog extends StatelessWidget { const SimpleDialog({ Key key, this.title, - this.titlePadding: const EdgeInsets.fromLTRB(24.0, 24.0, 24.0, 0.0), + this.titlePadding = const EdgeInsets.fromLTRB(24.0, 24.0, 24.0, 0.0), this.children, - this.contentPadding: const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0), + this.contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0), this.semanticLabel, }) : assert(titlePadding != null), assert(contentPadding != null), @@ -546,7 +546,7 @@ class SimpleDialog extends StatelessWidget { class _DialogRoute extends PopupRoute { _DialogRoute({ @required this.theme, - bool barrierDismissible: true, + bool barrierDismissible = true, this.barrierLabel, @required this.child, RouteSettings settings, @@ -630,7 +630,7 @@ class _DialogRoute extends PopupRoute { /// * Future showDialog({ @required BuildContext context, - bool barrierDismissible: true, + bool barrierDismissible = true, @Deprecated( 'Instead of using the "child" argument, return the child from a closure ' 'provided to the "builder" argument. This will ensure that the BuildContext ' diff --git a/packages/flutter/lib/src/material/divider.dart b/packages/flutter/lib/src/material/divider.dart index 9c8c78a366..f6ddaa6e04 100644 --- a/packages/flutter/lib/src/material/divider.dart +++ b/packages/flutter/lib/src/material/divider.dart @@ -29,8 +29,8 @@ class Divider extends StatelessWidget { /// The height must be positive. const Divider({ Key key, - this.height: 16.0, - this.indent: 0.0, + this.height = 16.0, + this.indent = 0.0, this.color }) : assert(height >= 0.0), super(key: key); @@ -85,7 +85,7 @@ class Divider extends StatelessWidget { /// // child: ... /// ) /// ``` - static BorderSide createBorderSide(BuildContext context, { Color color, double width: 0.0 }) { + static BorderSide createBorderSide(BuildContext context, { Color color, double width = 0.0 }) { assert(width != null); return new BorderSide( color: color ?? Theme.of(context).dividerColor, diff --git a/packages/flutter/lib/src/material/drawer.dart b/packages/flutter/lib/src/material/drawer.dart index f496eb76b9..8d55d9a07f 100644 --- a/packages/flutter/lib/src/material/drawer.dart +++ b/packages/flutter/lib/src/material/drawer.dart @@ -84,7 +84,7 @@ class Drawer extends StatelessWidget { /// Typically used in the [Scaffold.drawer] property. const Drawer({ Key key, - this.elevation: 16.0, + this.elevation = 16.0, this.child, this.semanticLabel, }) : super(key: key); diff --git a/packages/flutter/lib/src/material/drawer_header.dart b/packages/flutter/lib/src/material/drawer_header.dart index 9cb400bf95..d675ab544d 100644 --- a/packages/flutter/lib/src/material/drawer_header.dart +++ b/packages/flutter/lib/src/material/drawer_header.dart @@ -31,10 +31,10 @@ class DrawerHeader extends StatelessWidget { const DrawerHeader({ Key key, this.decoration, - this.margin: const EdgeInsets.only(bottom: 8.0), - this.padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 8.0), - this.duration: const Duration(milliseconds: 250), - this.curve: Curves.fastOutSlowIn, + this.margin = const EdgeInsets.only(bottom: 8.0), + this.padding = const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 8.0), + this.duration = const Duration(milliseconds: 250), + this.curve = Curves.fastOutSlowIn, @required this.child, }) : super(key: key); diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index bcac24de81..c5c6ddcd9b 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -288,7 +288,7 @@ class _DropdownRoute extends PopupRoute<_DropdownRouteResult> { this.padding, this.buttonRect, this.selectedIndex, - this.elevation: 8, + this.elevation = 8, this.theme, @required this.style, this.barrierLabel, @@ -473,10 +473,10 @@ class DropdownButton extends StatefulWidget { this.value, this.hint, @required this.onChanged, - this.elevation: 8, + this.elevation = 8, this.style, - this.iconSize: 24.0, - this.isDense: false, + this.iconSize = 24.0, + this.isDense = false, }) : assert(items != null), assert(value == null || items.where((DropdownMenuItem item) => item.value == value).length == 1), super(key: key); diff --git a/packages/flutter/lib/src/material/expand_icon.dart b/packages/flutter/lib/src/material/expand_icon.dart index 9cb0eea80f..c8928bd389 100644 --- a/packages/flutter/lib/src/material/expand_icon.dart +++ b/packages/flutter/lib/src/material/expand_icon.dart @@ -22,10 +22,10 @@ class ExpandIcon extends StatefulWidget { /// triggered when the icon is pressed. const ExpandIcon({ Key key, - this.isExpanded: false, - this.size: 24.0, + this.isExpanded = false, + this.size = 24.0, @required this.onPressed, - this.padding: const EdgeInsets.all(8.0) + this.padding = const EdgeInsets.all(8.0) }) : assert(isExpanded != null), assert(size != null), assert(padding != null), diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index 6c669a106b..cc46150c08 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart @@ -67,7 +67,7 @@ class ExpansionPanel { ExpansionPanel({ @required this.headerBuilder, @required this.body, - this.isExpanded: false + this.isExpanded = false }) : assert(headerBuilder != null), assert(body != null), assert(isExpanded != null); @@ -98,9 +98,9 @@ class ExpansionPanelList extends StatelessWidget { /// triggered when an expansion panel expand/collapse button is pushed. const ExpansionPanelList({ Key key, - this.children: const [], + this.children = const [], this.expansionCallback, - this.animationDuration: kThemeAnimationDuration + this.animationDuration = kThemeAnimationDuration }) : assert(children != null), assert(animationDuration != null), super(key: key); diff --git a/packages/flutter/lib/src/material/expansion_tile.dart b/packages/flutter/lib/src/material/expansion_tile.dart index d20e51ba6d..636f45191e 100644 --- a/packages/flutter/lib/src/material/expansion_tile.dart +++ b/packages/flutter/lib/src/material/expansion_tile.dart @@ -37,9 +37,9 @@ class ExpansionTile extends StatefulWidget { @required this.title, this.backgroundColor, this.onExpansionChanged, - this.children: const [], + this.children = const [], this.trailing, - this.initiallyExpanded: false, + this.initiallyExpanded = false, }) : assert(initiallyExpanded != null), super(key: key); diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart index 236192a5f9..ac92c4f0c5 100644 --- a/packages/flutter/lib/src/material/floating_action_button.dart +++ b/packages/flutter/lib/src/material/floating_action_button.dart @@ -70,14 +70,14 @@ class FloatingActionButton extends StatefulWidget { this.tooltip, this.foregroundColor, this.backgroundColor, - this.heroTag: const _DefaultHeroTag(), - this.elevation: 6.0, - this.highlightElevation: 12.0, + this.heroTag = const _DefaultHeroTag(), + this.elevation = 6.0, + this.highlightElevation = 12.0, @required this.onPressed, - this.mini: false, - this.notchMargin: 4.0, - this.shape: const CircleBorder(), - this.isExtended: false, + this.mini = false, + this.notchMargin = 4.0, + this.shape = const CircleBorder(), + this.isExtended = false, }) : assert(elevation != null), assert(highlightElevation != null), assert(mini != null), @@ -97,13 +97,13 @@ class FloatingActionButton extends StatefulWidget { this.tooltip, this.foregroundColor, this.backgroundColor, - this.heroTag: const _DefaultHeroTag(), - this.elevation: 6.0, - this.highlightElevation: 12.0, + this.heroTag = const _DefaultHeroTag(), + this.elevation = 6.0, + this.highlightElevation = 12.0, @required this.onPressed, - this.notchMargin: 4.0, - this.shape: const StadiumBorder(), - this.isExtended: true, + this.notchMargin = 4.0, + this.shape = const StadiumBorder(), + this.isExtended = true, @required Widget icon, @required Widget label, }) : assert(elevation != null), diff --git a/packages/flutter/lib/src/material/flutter_logo.dart b/packages/flutter/lib/src/material/flutter_logo.dart index d319247e35..ae0d4590ad 100644 --- a/packages/flutter/lib/src/material/flutter_logo.dart +++ b/packages/flutter/lib/src/material/flutter_logo.dart @@ -21,10 +21,10 @@ class FlutterLogo extends StatelessWidget { Key key, this.size, this.colors, - this.textColor: const Color(0xFF616161), - this.style: FlutterLogoStyle.markOnly, - this.duration: const Duration(milliseconds: 750), - this.curve: Curves.fastOutSlowIn, + this.textColor = const Color(0xFF616161), + this.style = FlutterLogoStyle.markOnly, + this.duration = const Duration(milliseconds: 750), + this.curve = Curves.fastOutSlowIn, }) : super(key: key); /// The size of the logo in logical pixels. diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart index 482b840504..3278256d47 100644 --- a/packages/flutter/lib/src/material/icon_button.dart +++ b/packages/flutter/lib/src/material/icon_button.dart @@ -71,9 +71,9 @@ class IconButton extends StatelessWidget { /// or an [ImageIcon]. const IconButton({ Key key, - this.iconSize: 24.0, - this.padding: const EdgeInsets.all(8.0), - this.alignment: Alignment.center, + this.iconSize = 24.0, + this.padding = const EdgeInsets.all(8.0), + this.alignment = Alignment.center, @required this.icon, this.color, this.highlightColor, diff --git a/packages/flutter/lib/src/material/ink_decoration.dart b/packages/flutter/lib/src/material/ink_decoration.dart index 624e8039b8..f58b1b9f1f 100644 --- a/packages/flutter/lib/src/material/ink_decoration.dart +++ b/packages/flutter/lib/src/material/ink_decoration.dart @@ -148,10 +148,10 @@ class Ink extends StatefulWidget { @required ImageProvider image, ColorFilter colorFilter, BoxFit fit, - AlignmentGeometry alignment: Alignment.center, + AlignmentGeometry alignment = Alignment.center, Rect centerSlice, - ImageRepeat repeat: ImageRepeat.noRepeat, - bool matchTextDirection: false, + ImageRepeat repeat = ImageRepeat.noRepeat, + bool matchTextDirection = false, this.width, this.height, this.child, diff --git a/packages/flutter/lib/src/material/ink_highlight.dart b/packages/flutter/lib/src/material/ink_highlight.dart index b3a0255e8e..e2ba958733 100644 --- a/packages/flutter/lib/src/material/ink_highlight.dart +++ b/packages/flutter/lib/src/material/ink_highlight.dart @@ -39,7 +39,7 @@ class InkHighlight extends InteractiveInkFeature { @required MaterialInkController controller, @required RenderBox referenceBox, @required Color color, - BoxShape shape: BoxShape.rectangle, + BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, RectCallback rectCallback, VoidCallback onRemoved, diff --git a/packages/flutter/lib/src/material/ink_ripple.dart b/packages/flutter/lib/src/material/ink_ripple.dart index e5ef3d0d9b..0adf27b3e7 100644 --- a/packages/flutter/lib/src/material/ink_ripple.dart +++ b/packages/flutter/lib/src/material/ink_ripple.dart @@ -45,7 +45,7 @@ class _InkRippleFactory extends InteractiveInkFeatureFactory { @required RenderBox referenceBox, @required Offset position, @required Color color, - bool containedInkWell: false, + bool containedInkWell = false, RectCallback rectCallback, BorderRadius borderRadius, double radius, @@ -112,7 +112,7 @@ class InkRipple extends InteractiveInkFeature { @required RenderBox referenceBox, @required Offset position, @required Color color, - bool containedInkWell: false, + bool containedInkWell = false, RectCallback rectCallback, BorderRadius borderRadius, double radius, diff --git a/packages/flutter/lib/src/material/ink_splash.dart b/packages/flutter/lib/src/material/ink_splash.dart index e7b3c06b0b..c40d7e11ba 100644 --- a/packages/flutter/lib/src/material/ink_splash.dart +++ b/packages/flutter/lib/src/material/ink_splash.dart @@ -51,7 +51,7 @@ class _InkSplashFactory extends InteractiveInkFeatureFactory { @required RenderBox referenceBox, @required Offset position, @required Color color, - bool containedInkWell: false, + bool containedInkWell = false, RectCallback rectCallback, BorderRadius borderRadius, double radius, @@ -116,7 +116,7 @@ class InkSplash extends InteractiveInkFeature { @required RenderBox referenceBox, Offset position, Color color, - bool containedInkWell: false, + bool containedInkWell = false, RectCallback rectCallback, BorderRadius borderRadius, double radius, diff --git a/packages/flutter/lib/src/material/ink_well.dart b/packages/flutter/lib/src/material/ink_well.dart index ce4f5e9f49..dd8a4007c9 100644 --- a/packages/flutter/lib/src/material/ink_well.dart +++ b/packages/flutter/lib/src/material/ink_well.dart @@ -92,7 +92,7 @@ abstract class InteractiveInkFeatureFactory { @required RenderBox referenceBox, @required Offset position, @required Color color, - bool containedInkWell: false, + bool containedInkWell = false, RectCallback rectCallback, BorderRadius borderRadius, double radius, @@ -197,15 +197,15 @@ class InkResponse extends StatefulWidget { this.onDoubleTap, this.onLongPress, this.onHighlightChanged, - this.containedInkWell: false, - this.highlightShape: BoxShape.circle, + this.containedInkWell = false, + this.highlightShape = BoxShape.circle, this.radius, this.borderRadius, this.highlightColor, this.splashColor, this.splashFactory, - this.enableFeedback: true, - this.excludeFromSemantics: false, + this.enableFeedback = true, + this.excludeFromSemantics = false, }) : assert(containedInkWell != null), assert(highlightShape != null), assert(enableFeedback != null), @@ -626,8 +626,8 @@ class InkWell extends InkResponse { InteractiveInkFeatureFactory splashFactory, double radius, BorderRadius borderRadius, - bool enableFeedback: true, - bool excludeFromSemantics: false, + bool enableFeedback = true, + bool excludeFromSemantics = false, }) : super( key: key, child: child, diff --git a/packages/flutter/lib/src/material/input_border.dart b/packages/flutter/lib/src/material/input_border.dart index 71b66e45a9..79a5b3a7f2 100644 --- a/packages/flutter/lib/src/material/input_border.dart +++ b/packages/flutter/lib/src/material/input_border.dart @@ -42,7 +42,7 @@ abstract class InputBorder extends ShapeBorder { /// substitutes its own, using [copyWith], based on the current theme and /// [InputDecorator.isFocused]. const InputBorder({ - this.borderSide: BorderSide.none, + this.borderSide = BorderSide.none, }) : assert(borderSide != null); /// Defines the border line's color and weight. @@ -73,8 +73,8 @@ abstract class InputBorder extends ShapeBorder { @override void paint(Canvas canvas, Rect rect, { double gapStart, - double gapExtent: 0.0, - double gapPercentage: 0.0, + double gapExtent = 0.0, + double gapPercentage = 0.0, TextDirection textDirection, }); } @@ -108,8 +108,8 @@ class _NoInputBorder extends InputBorder { @override void paint(Canvas canvas, Rect rect, { double gapStart, - double gapExtent: 0.0, - double gapPercentage: 0.0, + double gapExtent = 0.0, + double gapPercentage = 0.0, TextDirection textDirection, }) { // Do not paint. @@ -139,8 +139,8 @@ class UnderlineInputBorder extends InputBorder { /// and right corners have a circular radius of 4.0. The [borderRadius] /// parameter must not be null. const UnderlineInputBorder({ - BorderSide borderSide: BorderSide.none, - this.borderRadius: const BorderRadius.only( + BorderSide borderSide = BorderSide.none, + this.borderRadius = const BorderRadius.only( topLeft: const Radius.circular(4.0), topRight: const Radius.circular(4.0), ), @@ -217,8 +217,8 @@ class UnderlineInputBorder extends InputBorder { @override void paint(Canvas canvas, Rect rect, { double gapStart, - double gapExtent: 0.0, - double gapPercentage: 0.0, + double gapExtent = 0.0, + double gapPercentage = 0.0, TextDirection textDirection, }) { if (borderRadius.bottomLeft != Radius.zero || borderRadius.bottomRight != Radius.zero) @@ -266,9 +266,9 @@ class OutlineInputBorder extends InputBorder { /// must not be null and the corner radii must be circular, i.e. their /// [Radius.x] and [Radius.y] values must be the same. const OutlineInputBorder({ - BorderSide borderSide: BorderSide.none, - this.borderRadius: const BorderRadius.all(const Radius.circular(4.0)), - this.gapPadding: 4.0, + BorderSide borderSide = BorderSide.none, + this.borderRadius = const BorderRadius.all(const Radius.circular(4.0)), + this.gapPadding = 4.0, }) : assert(borderRadius != null), assert(gapPadding != null && gapPadding >= 0.0), super(borderSide: borderSide); @@ -437,8 +437,8 @@ class OutlineInputBorder extends InputBorder { @override void paint(Canvas canvas, Rect rect, { double gapStart, - double gapExtent: 0.0, - double gapPercentage: 0.0, + double gapExtent = 0.0, + double gapPercentage = 0.0, TextDirection textDirection, }) { assert(gapExtent != null); diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index 3caace3560..4dc5d7e2ba 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -1344,8 +1344,8 @@ class InputDecorator extends StatefulWidget { this.decoration, this.baseStyle, this.textAlign, - this.isFocused: false, - this.isEmpty: false, + this.isFocused = false, + this.isEmpty = false, this.child, }) : assert(isFocused != null), assert(isEmpty != null), @@ -1827,7 +1827,7 @@ class InputDecoration { this.filled, this.fillColor, this.border, - this.enabled: true, + this.enabled = true, }) : assert(enabled != null), isCollapsed = false; /// Defines an [InputDecorator] that is the same size as the input field. @@ -1838,10 +1838,10 @@ class InputDecoration { const InputDecoration.collapsed({ @required this.hintText, this.hintStyle, - this.filled: false, + this.filled = false, this.fillColor, - this.border: InputBorder.none, - this.enabled: true, + this.border = InputBorder.none, + this.enabled = true, }) : assert(enabled != null), icon = null, labelText = null, @@ -2322,15 +2322,15 @@ class InputDecorationTheme extends Diagnosticable { this.hintStyle, this.errorStyle, this.errorMaxLines, - this.isDense: false, + this.isDense = false, this.contentPadding, - this.isCollapsed: false, + this.isCollapsed = false, this.prefixStyle, this.suffixStyle, this.counterStyle, - this.filled: false, + this.filled = false, this.fillColor, - this.border: const UnderlineInputBorder(), + this.border = const UnderlineInputBorder(), }) : assert(isDense != null), assert(isCollapsed != null), assert(filled != null), diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index 82ef80c291..81ed238a1c 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -41,8 +41,8 @@ class ListTileTheme extends InheritedWidget { /// [ListTile]s. const ListTileTheme({ Key key, - this.dense: false, - this.style: ListTileStyle.list, + this.dense = false, + this.style = ListTileStyle.list, this.selectedColor, this.iconColor, this.textColor, @@ -222,13 +222,13 @@ class ListTile extends StatelessWidget { this.title, this.subtitle, this.trailing, - this.isThreeLine: false, + this.isThreeLine = false, this.dense, this.contentPadding, - this.enabled: true, + this.enabled = true, this.onTap, this.onLongPress, - this.selected: false, + this.selected = false, }) : assert(isThreeLine != null), assert(enabled != null), assert(selected != null), diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index e11ac163ac..a4cbacc2c8 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -164,14 +164,14 @@ class Material extends StatefulWidget { /// catch likely errors. const Material({ Key key, - this.type: MaterialType.canvas, - this.elevation: 0.0, + this.type = MaterialType.canvas, + this.elevation = 0.0, this.color, - this.shadowColor: const Color(0xFF000000), + this.shadowColor = const Color(0xFF000000), this.textStyle, this.borderRadius, this.shape, - this.animationDuration: kThemeChangeDuration, + this.animationDuration = kThemeChangeDuration, this.child, }) : assert(type != null), assert(elevation != null), @@ -585,7 +585,7 @@ class _MaterialInterior extends ImplicitlyAnimatedWidget { @required this.elevation, @required this.color, @required this.shadowColor, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration, }) : assert(child != null), assert(shape != null), diff --git a/packages/flutter/lib/src/material/material_localizations.dart b/packages/flutter/lib/src/material/material_localizations.dart index 8cf70725c8..d86ad9a022 100644 --- a/packages/flutter/lib/src/material/material_localizations.dart +++ b/packages/flutter/lib/src/material/material_localizations.dart @@ -168,7 +168,7 @@ abstract class MaterialLocalizations { /// /// The documentation for [TimeOfDayFormat] enum values provides details on /// each supported layout. - TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat: false }); + TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat = false }); /// Provides geometric text preferences for the current locale. /// @@ -196,7 +196,7 @@ abstract class MaterialLocalizations { /// /// If [alwaysUse24HourFormat] is true, formats hour using [HourFormat.HH] /// rather than the default for the current locale. - String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }); + String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false }); /// Formats [TimeOfDay.minute] in the given time of day according to the value /// of [timeOfDayFormat]. @@ -208,7 +208,7 @@ abstract class MaterialLocalizations { /// rather than the default for the current locale. This value is usually /// passed from [MediaQueryData.alwaysUse24HourFormat], which has platform- /// specific behavior. - String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }); + String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false }); /// Full unabbreviated year format, e.g. 2017 rather than 17. String formatYear(DateTime date); @@ -388,7 +388,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations { ]; @override - String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }) { + String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false }) { final TimeOfDayFormat format = timeOfDayFormat(alwaysUse24HourFormat: alwaysUse24HourFormat); switch (format) { case TimeOfDayFormat.h_colon_mm_space_a: @@ -473,7 +473,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations { } @override - String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }) { + String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false }) { // Not using intl.DateFormat for two reasons: // // - DateFormat supports more formats than our material time picker does, @@ -622,7 +622,7 @@ class DefaultMaterialLocalizations implements MaterialLocalizations { String get modalBarrierDismissLabel => 'Dismiss'; @override - TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat: false }) { + TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat = false }) { return alwaysUse24HourFormat ? TimeOfDayFormat.HH_colon_mm : TimeOfDayFormat.h_colon_mm_space_a; diff --git a/packages/flutter/lib/src/material/mergeable_material.dart b/packages/flutter/lib/src/material/mergeable_material.dart index 3321cbe7bc..54fc251398 100644 --- a/packages/flutter/lib/src/material/mergeable_material.dart +++ b/packages/flutter/lib/src/material/mergeable_material.dart @@ -62,7 +62,7 @@ class MaterialGap extends MergeableMaterialItem { /// Creates a Material gap with a given size. const MaterialGap({ @required LocalKey key, - this.size: 16.0 + this.size = 16.0 }) : assert(key != null), super(key); @@ -101,10 +101,10 @@ class MergeableMaterial extends StatefulWidget { /// Creates a mergeable Material list of items. const MergeableMaterial({ Key key, - this.mainAxis: Axis.vertical, - this.elevation: 2, - this.hasDividers: false, - this.children: const [] + this.mainAxis = Axis.vertical, + this.elevation = 2, + this.hasDividers = false, + this.children = const [] }) : super(key: key); /// The children of the [MergeableMaterial]. @@ -140,7 +140,7 @@ class _AnimationTuple { this.startAnimation, this.endAnimation, this.gapAnimation, - this.gapStart: 0.0 + this.gapStart = 0.0 }); final AnimationController controller; @@ -646,7 +646,7 @@ class _MergeableMaterialSliceKey extends GlobalKey { class _MergeableMaterialListBody extends ListBody { _MergeableMaterialListBody({ List children, - Axis mainAxis: Axis.vertical, + Axis mainAxis = Axis.vertical, this.items, this.boxShadows }) : super(children: children, mainAxis: mainAxis); @@ -678,7 +678,7 @@ class _MergeableMaterialListBody extends ListBody { class _RenderMergeableMaterialListBody extends RenderListBody { _RenderMergeableMaterialListBody({ List children, - AxisDirection axisDirection: AxisDirection.down, + AxisDirection axisDirection = AxisDirection.down, this.boxShadows }) : super(children: children, axisDirection: axisDirection); diff --git a/packages/flutter/lib/src/material/outline_button.dart b/packages/flutter/lib/src/material/outline_button.dart index 4424d1ed29..4e8d0d8bdd 100644 --- a/packages/flutter/lib/src/material/outline_button.dart +++ b/packages/flutter/lib/src/material/outline_button.dart @@ -62,7 +62,7 @@ class OutlineButton extends StatefulWidget { this.color, this.highlightColor, this.splashColor, - this.highlightElevation: 2.0, + this.highlightElevation = 2.0, this.borderSide, this.disabledBorderColor, this.highlightedBorderColor, @@ -88,7 +88,7 @@ class OutlineButton extends StatefulWidget { this.color, this.highlightColor, this.splashColor, - this.highlightElevation: 2.0, + this.highlightElevation = 2.0, this.borderSide, this.disabledBorderColor, this.highlightedBorderColor, diff --git a/packages/flutter/lib/src/material/page.dart b/packages/flutter/lib/src/material/page.dart index a31647dc3e..2e43d32b56 100644 --- a/packages/flutter/lib/src/material/page.dart +++ b/packages/flutter/lib/src/material/page.dart @@ -79,8 +79,8 @@ class MaterialPageRoute extends PageRoute { MaterialPageRoute({ @required this.builder, RouteSettings settings, - this.maintainState: true, - bool fullscreenDialog: false, + this.maintainState = true, + bool fullscreenDialog = false, }) : assert(builder != null), super(settings: settings, fullscreenDialog: fullscreenDialog) { // ignore: prefer_asserts_in_initializer_lists , https://github.com/dart-lang/sdk/issues/31223 diff --git a/packages/flutter/lib/src/material/paginated_data_table.dart b/packages/flutter/lib/src/material/paginated_data_table.dart index d823ef67c1..4ce12ccca0 100644 --- a/packages/flutter/lib/src/material/paginated_data_table.dart +++ b/packages/flutter/lib/src/material/paginated_data_table.dart @@ -65,12 +65,12 @@ class PaginatedDataTable extends StatefulWidget { this.actions, @required this.columns, this.sortColumnIndex, - this.sortAscending: true, + this.sortAscending = true, this.onSelectAll, - this.initialFirstRowIndex: 0, + this.initialFirstRowIndex = 0, this.onPageChanged, - this.rowsPerPage: defaultRowsPerPage, - this.availableRowsPerPage: const [defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10], + this.rowsPerPage = defaultRowsPerPage, + this.availableRowsPerPage = const [defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10], this.onRowsPerPageChanged, @required this.source }) : assert(header != null), diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart index 0d1e773dc9..ebb4588c3b 100644 --- a/packages/flutter/lib/src/material/popup_menu.dart +++ b/packages/flutter/lib/src/material/popup_menu.dart @@ -96,7 +96,7 @@ class PopupMenuDivider extends PopupMenuEntry { /// Creates a horizontal divider for a popup menu. /// /// By default, the divider has a height of 16 logical pixels. - const PopupMenuDivider({ Key key, this.height: _kMenuDividerHeight }) : super(key: key); + const PopupMenuDivider({ Key key, this.height = _kMenuDividerHeight }) : super(key: key); /// The height of the divider entry. /// @@ -163,8 +163,8 @@ class PopupMenuItem extends PopupMenuEntry { const PopupMenuItem({ Key key, this.value, - this.enabled: true, - this.height: _kMenuItemHeight, + this.enabled = true, + this.height = _kMenuItemHeight, @required this.child, }) : assert(enabled != null), assert(height != null), @@ -341,8 +341,8 @@ class CheckedPopupMenuItem extends PopupMenuItem { const CheckedPopupMenuItem({ Key key, T value, - this.checked: false, - bool enabled: true, + this.checked = false, + bool enabled = true, Widget child, }) : assert(checked != null), super( @@ -708,7 +708,7 @@ Future showMenu({ RelativeRect position, @required List> items, T initialValue, - double elevation: 8.0, + double elevation = 8.0, String semanticLabel, }) { assert(context != null); @@ -814,8 +814,8 @@ class PopupMenuButton extends StatefulWidget { this.onSelected, this.onCanceled, this.tooltip, - this.elevation: 8.0, - this.padding: const EdgeInsets.all(8.0), + this.elevation = 8.0, + this.padding = const EdgeInsets.all(8.0), this.child, this.icon, }) : assert(itemBuilder != null), diff --git a/packages/flutter/lib/src/material/progress_indicator.dart b/packages/flutter/lib/src/material/progress_indicator.dart index f39506b84f..1f39701713 100644 --- a/packages/flutter/lib/src/material/progress_indicator.dart +++ b/packages/flutter/lib/src/material/progress_indicator.dart @@ -340,7 +340,7 @@ class CircularProgressIndicator extends ProgressIndicator { double value, Color backgroundColor, Animation valueColor, - this.strokeWidth: 4.0, + this.strokeWidth = 4.0, }) : super(key: key, value: value, backgroundColor: backgroundColor, valueColor: valueColor); /// The width of the line used to draw the circle. @@ -504,7 +504,7 @@ class RefreshProgressIndicator extends CircularProgressIndicator { double value, Color backgroundColor, Animation valueColor, - double strokeWidth: 2.0, // Different default than CircularProgressIndicator. + double strokeWidth = 2.0, // Different default than CircularProgressIndicator. }) : super( key: key, value: value, diff --git a/packages/flutter/lib/src/material/radio_list_tile.dart b/packages/flutter/lib/src/material/radio_list_tile.dart index dd952cba7e..618c89020b 100644 --- a/packages/flutter/lib/src/material/radio_list_tile.dart +++ b/packages/flutter/lib/src/material/radio_list_tile.dart @@ -96,11 +96,11 @@ class RadioListTile extends StatelessWidget { this.activeColor, this.title, this.subtitle, - this.isThreeLine: false, + this.isThreeLine = false, this.dense, this.secondary, - this.selected: false, - this.controlAffinity: ListTileControlAffinity.platform, + this.selected = false, + this.controlAffinity = ListTileControlAffinity.platform, }) : assert(isThreeLine != null), assert(!isThreeLine || subtitle != null), assert(selected != null), diff --git a/packages/flutter/lib/src/material/raised_button.dart b/packages/flutter/lib/src/material/raised_button.dart index 7fca5b5ea9..df7dfd97df 100644 --- a/packages/flutter/lib/src/material/raised_button.dart +++ b/packages/flutter/lib/src/material/raised_button.dart @@ -57,12 +57,12 @@ class RaisedButton extends StatelessWidget { this.highlightColor, this.splashColor, this.colorBrightness, - this.elevation: 2.0, - this.highlightElevation: 8.0, - this.disabledElevation: 0.0, + this.elevation = 2.0, + this.highlightElevation = 8.0, + this.disabledElevation = 0.0, this.padding, this.shape, - this.animationDuration: kThemeChangeDuration, + this.animationDuration = kThemeChangeDuration, this.child, }) : assert(elevation != null), assert(highlightElevation != null), @@ -90,11 +90,11 @@ class RaisedButton extends StatelessWidget { this.highlightColor, this.splashColor, this.colorBrightness, - this.elevation: 2.0, - this.highlightElevation: 8.0, - this.disabledElevation: 0.0, + this.elevation = 2.0, + this.highlightElevation = 8.0, + this.disabledElevation = 0.0, this.shape, - this.animationDuration: kThemeChangeDuration, + this.animationDuration = kThemeChangeDuration, @required Widget icon, @required Widget label, }) : assert(elevation != null), diff --git a/packages/flutter/lib/src/material/refresh_indicator.dart b/packages/flutter/lib/src/material/refresh_indicator.dart index 374f61e653..5e045e1bb0 100644 --- a/packages/flutter/lib/src/material/refresh_indicator.dart +++ b/packages/flutter/lib/src/material/refresh_indicator.dart @@ -88,11 +88,11 @@ class RefreshIndicator extends StatefulWidget { const RefreshIndicator({ Key key, @required this.child, - this.displacement: 40.0, + this.displacement = 40.0, @required this.onRefresh, this.color, this.backgroundColor, - this.notificationPredicate: defaultScrollNotificationPredicate, + this.notificationPredicate = defaultScrollNotificationPredicate, }) : assert(child != null), assert(onRefresh != null), assert(notificationPredicate != null), @@ -381,7 +381,7 @@ class RefreshIndicatorState extends State with TickerProviderS /// When initiated in this manner, the refresh indicator is independent of any /// actual scroll view. It defaults to showing the indicator at the top. To /// show it at the bottom, set `atTop` to false. - Future show({ bool atTop: true }) { + Future show({ bool atTop = true }) { if (_mode != _RefreshIndicatorMode.refresh && _mode != _RefreshIndicatorMode.snap) { if (_mode == null) diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart index 88a23dd8be..1bc0863210 100644 --- a/packages/flutter/lib/src/material/scaffold.dart +++ b/packages/flutter/lib/src/material/scaffold.dart @@ -764,8 +764,8 @@ class Scaffold extends StatefulWidget { this.endDrawer, this.bottomNavigationBar, this.backgroundColor, - this.resizeToAvoidBottomPadding: true, - this.primary: true, + this.resizeToAvoidBottomPadding = true, + this.primary = true, }) : assert(primary != null), super(key: key); /// An app bar to display at the top of the scaffold. @@ -935,7 +935,7 @@ class Scaffold extends StatefulWidget { /// /// If there is no [Scaffold] in scope, then this will throw an exception. /// To return null if there is no [Scaffold], then pass `nullOk: true`. - static ScaffoldState of(BuildContext context, { bool nullOk: false }) { + static ScaffoldState of(BuildContext context, { bool nullOk = false }) { assert(nullOk != null); assert(context != null); final ScaffoldState result = context.ancestorStateOfType(const TypeMatcher()); @@ -1042,7 +1042,7 @@ class Scaffold extends StatefulWidget { /// See also: /// * [Scaffold.of], which provides access to the [ScaffoldState] object as a /// whole, from which you can show snackbars, bottom sheets, and so forth. - static bool hasDrawer(BuildContext context, { bool registerForUpdates: true }) { + static bool hasDrawer(BuildContext context, { bool registerForUpdates = true }) { assert(registerForUpdates != null); assert(context != null); if (registerForUpdates) { @@ -1179,7 +1179,7 @@ class ScaffoldState extends State with TickerProviderStateMixin { /// /// The removed snack bar does not run its normal exit animation. If there are /// any queued snack bars, they begin their entrance animation immediately. - void removeCurrentSnackBar({ SnackBarClosedReason reason: SnackBarClosedReason.remove }) { + void removeCurrentSnackBar({ SnackBarClosedReason reason = SnackBarClosedReason.remove }) { assert(reason != null); if (_snackBars.isEmpty) return; @@ -1194,7 +1194,7 @@ class ScaffoldState extends State with TickerProviderStateMixin { /// Removes the current [SnackBar] by running its normal exit animation. /// /// The closed completer is called after the animation is complete. - void hideCurrentSnackBar({ SnackBarClosedReason reason: SnackBarClosedReason.hide }) { + void hideCurrentSnackBar({ SnackBarClosedReason reason = SnackBarClosedReason.hide }) { assert(reason != null); if (_snackBars.isEmpty || _snackBarController.status == AnimationStatus.dismissed) return; diff --git a/packages/flutter/lib/src/material/search.dart b/packages/flutter/lib/src/material/search.dart index e1f67cbc22..60b8f04f4c 100644 --- a/packages/flutter/lib/src/material/search.dart +++ b/packages/flutter/lib/src/material/search.dart @@ -48,7 +48,7 @@ import 'theme.dart'; Future showSearch({ @required BuildContext context, @required SearchDelegate delegate, - String query: '', + String query = '', }) { assert(delegate != null); assert(context != null); diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index 10c8348d26..2863b901f3 100644 --- a/packages/flutter/lib/src/material/slider.dart +++ b/packages/flutter/lib/src/material/slider.dart @@ -103,8 +103,8 @@ class Slider extends StatefulWidget { @required this.onChanged, this.onChangeStart, this.onChangeEnd, - this.min: 0.0, - this.max: 1.0, + this.min = 0.0, + this.max = 1.0, this.divisions, this.label, this.activeColor, diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index 6628c99a19..2daa02482c 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -146,7 +146,7 @@ class SnackBar extends StatelessWidget { @required this.content, this.backgroundColor, this.action, - this.duration: _kSnackBarDisplayDuration, + this.duration = _kSnackBarDisplayDuration, this.animation, }) : assert(content != null), super(key: key); diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart index d7839e3b4e..94e34b5bc2 100644 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -83,8 +83,8 @@ class Step { @required this.title, this.subtitle, @required this.content, - this.state: StepState.indexed, - this.isActive: false, + this.state = StepState.indexed, + this.isActive = false, }) : assert(title != null), assert(content != null), assert(state != null); @@ -135,8 +135,8 @@ class Stepper extends StatefulWidget { Stepper({ Key key, @required this.steps, - this.type: StepperType.vertical, - this.currentStep: 0, + this.type = StepperType.vertical, + this.currentStep = 0, this.onStepTapped, this.onStepContinue, this.onStepCancel, diff --git a/packages/flutter/lib/src/material/switch_list_tile.dart b/packages/flutter/lib/src/material/switch_list_tile.dart index 86226e79e1..b9231803ad 100644 --- a/packages/flutter/lib/src/material/switch_list_tile.dart +++ b/packages/flutter/lib/src/material/switch_list_tile.dart @@ -77,10 +77,10 @@ class SwitchListTile extends StatelessWidget { this.inactiveThumbImage, this.title, this.subtitle, - this.isThreeLine: false, + this.isThreeLine = false, this.dense, this.secondary, - this.selected: false, + this.selected = false, }) : assert(value != null), assert(isThreeLine != null), assert(!isThreeLine || subtitle != null), diff --git a/packages/flutter/lib/src/material/tab_controller.dart b/packages/flutter/lib/src/material/tab_controller.dart index 913f26a405..5a8647372d 100644 --- a/packages/flutter/lib/src/material/tab_controller.dart +++ b/packages/flutter/lib/src/material/tab_controller.dart @@ -77,7 +77,7 @@ class TabController extends ChangeNotifier { /// /// The `initialIndex` must be valid given [length] and must not be null. If [length] is /// zero, then `initialIndex` must be 0 (the default). - TabController({ int initialIndex: 0, @required this.length, @required TickerProvider vsync }) + TabController({ int initialIndex = 0, @required this.length, @required TickerProvider vsync }) : assert(length != null && length >= 0), assert(initialIndex != null && initialIndex >= 0 && (length == 0 || initialIndex < length)), _index = initialIndex, @@ -158,7 +158,7 @@ class TabController extends ChangeNotifier { /// /// While the animation is running [indexIsChanging] is true. When the /// animation completes [offset] will be 0.0. - void animateTo(int value, { Duration duration: kTabScrollDuration, Curve curve: Curves.ease }) { + void animateTo(int value, { Duration duration = kTabScrollDuration, Curve curve = Curves.ease }) { _changeIndex(value, duration: duration, curve: curve); } @@ -249,7 +249,7 @@ class DefaultTabController extends StatefulWidget { const DefaultTabController({ Key key, @required this.length, - this.initialIndex: 0, + this.initialIndex = 0, @required this.child, }) : assert(initialIndex != null), super(key: key); diff --git a/packages/flutter/lib/src/material/tab_indicator.dart b/packages/flutter/lib/src/material/tab_indicator.dart index 00b2637520..75147d3b30 100644 --- a/packages/flutter/lib/src/material/tab_indicator.dart +++ b/packages/flutter/lib/src/material/tab_indicator.dart @@ -20,8 +20,8 @@ class UnderlineTabIndicator extends Decoration { /// /// The [borderSide] and [insets] arguments must not be null. const UnderlineTabIndicator({ - this.borderSide: const BorderSide(width: 2.0, color: Colors.white), - this.insets: EdgeInsets.zero, + this.borderSide = const BorderSide(width: 2.0, color: Colors.white), + this.insets = EdgeInsets.zero, }) : assert(borderSide != null), assert(insets != null); /// The color and weight of the horizontal line drawn below the selected tab. diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 1ead76f70f..d89d440821 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -234,7 +234,7 @@ class _TabLabelBarRenderer extends RenderFlex { class _TabLabelBar extends Flex { _TabLabelBar({ Key key, - List children: const [], + List children = const [], this.onPerformLayout, }) : super( key: key, @@ -526,10 +526,10 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { Key key, @required this.tabs, this.controller, - this.isScrollable: false, + this.isScrollable = false, this.indicatorColor, - this.indicatorWeight: 2.0, - this.indicatorPadding: EdgeInsets.zero, + this.indicatorWeight = 2.0, + this.indicatorPadding = EdgeInsets.zero, this.indicator, this.indicatorSize, this.labelColor, @@ -1222,7 +1222,7 @@ class TabPageSelector extends StatelessWidget { const TabPageSelector({ Key key, this.controller, - this.indicatorSize: 12.0, + this.indicatorSize = 12.0, this.color, this.selectedColor, }) : assert(indicatorSize != null && indicatorSize > 0.0), super(key: key); diff --git a/packages/flutter/lib/src/material/text_field.dart b/packages/flutter/lib/src/material/text_field.dart index f049b74eec..f62f58c8f8 100644 --- a/packages/flutter/lib/src/material/text_field.dart +++ b/packages/flutter/lib/src/material/text_field.dart @@ -100,16 +100,16 @@ class TextField extends StatefulWidget { Key key, this.controller, this.focusNode, - this.decoration: const InputDecoration(), - TextInputType keyboardType: TextInputType.text, + this.decoration = const InputDecoration(), + TextInputType keyboardType = TextInputType.text, this.style, - this.textAlign: TextAlign.start, - this.autofocus: false, - this.obscureText: false, - this.autocorrect: true, - this.maxLines: 1, + this.textAlign = TextAlign.start, + this.autofocus = false, + this.obscureText = false, + this.autocorrect = true, + this.maxLines = 1, this.maxLength, - this.maxLengthEnforced: true, + this.maxLengthEnforced = true, this.onChanged, this.onSubmitted, this.inputFormatters, diff --git a/packages/flutter/lib/src/material/text_form_field.dart b/packages/flutter/lib/src/material/text_form_field.dart index 0181c552c5..e8f0aa2c48 100644 --- a/packages/flutter/lib/src/material/text_form_field.dart +++ b/packages/flutter/lib/src/material/text_form_field.dart @@ -53,16 +53,16 @@ class TextFormField extends FormField { this.controller, String initialValue, FocusNode focusNode, - InputDecoration decoration: const InputDecoration(), - TextInputType keyboardType: TextInputType.text, + InputDecoration decoration = const InputDecoration(), + TextInputType keyboardType = TextInputType.text, TextStyle style, - TextAlign textAlign: TextAlign.start, - bool autofocus: false, - bool obscureText: false, - bool autocorrect: true, - bool autovalidate: false, - bool maxLengthEnforced: true, - int maxLines: 1, + TextAlign textAlign = TextAlign.start, + bool autofocus = false, + bool obscureText = false, + bool autocorrect = true, + bool autovalidate = false, + bool maxLengthEnforced = true, + int maxLines = 1, int maxLength, ValueChanged onFieldSubmitted, FormFieldSetter onSaved, diff --git a/packages/flutter/lib/src/material/theme.dart b/packages/flutter/lib/src/material/theme.dart index 3dbd355b73..c8cc018130 100644 --- a/packages/flutter/lib/src/material/theme.dart +++ b/packages/flutter/lib/src/material/theme.dart @@ -39,7 +39,7 @@ class Theme extends StatelessWidget { const Theme({ Key key, @required this.data, - this.isMaterialAppTheme: false, + this.isMaterialAppTheme = false, @required this.child, }) : assert(child != null), assert(data != null), @@ -123,7 +123,7 @@ class Theme extends StatelessWidget { /// ); /// } /// ``` - static ThemeData of(BuildContext context, { bool shadowThemeOnly: false }) { + static ThemeData of(BuildContext context, { bool shadowThemeOnly = false }) { final _InheritedTheme inheritedTheme = context.inheritFromWidgetOfExactType(_InheritedTheme); if (shadowThemeOnly) { @@ -206,9 +206,9 @@ class AnimatedTheme extends ImplicitlyAnimatedWidget { const AnimatedTheme({ Key key, @required this.data, - this.isMaterialAppTheme: false, - Curve curve: Curves.linear, - Duration duration: kThemeAnimationDuration, + this.isMaterialAppTheme = false, + Curve curve = Curves.linear, + Duration duration = kThemeAnimationDuration, @required this.child, }) : assert(child != null), assert(data != null), diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart index 8177c08413..689299719d 100644 --- a/packages/flutter/lib/src/material/time_picker.dart +++ b/packages/flutter/lib/src/material/time_picker.dart @@ -104,7 +104,7 @@ class _TimePickerHeaderFragment { const _TimePickerHeaderFragment({ @required this.layoutId, @required this.widget, - this.startMargin: 0.0, + this.startMargin = 0.0, }) : assert(layoutId != null), assert(widget != null), assert(startMargin != null); @@ -133,7 +133,7 @@ class _TimePickerHeaderPiece { /// /// All arguments must be non-null. If the piece does not contain a pivot /// fragment, use the value -1 as a convention. - const _TimePickerHeaderPiece(this.pivotIndex, this.fragments, { this.bottomMargin: 0.0 }) + const _TimePickerHeaderPiece(this.pivotIndex, this.fragments, { this.bottomMargin = 0.0 }) : assert(pivotIndex != null), assert(fragments != null), assert(bottomMargin != null); @@ -475,7 +475,7 @@ _TimePickerHeaderFormat _buildHeaderFormat(TimeOfDayFormat timeOfDayFormat, _Tim } // Convenience function for creating a time header piece with up to three fragments. - _TimePickerHeaderPiece piece({ int pivotIndex: -1, double bottomMargin: 0.0, + _TimePickerHeaderPiece piece({ int pivotIndex = -1, double bottomMargin = 0.0, _TimePickerHeaderFragment fragment1, _TimePickerHeaderFragment fragment2, _TimePickerHeaderFragment fragment3 }) { final List<_TimePickerHeaderFragment> fragments = <_TimePickerHeaderFragment>[fragment1]; if (fragment2 != null) { diff --git a/packages/flutter/lib/src/material/toggleable.dart b/packages/flutter/lib/src/material/toggleable.dart index fa874a7a32..2a8831433b 100644 --- a/packages/flutter/lib/src/material/toggleable.dart +++ b/packages/flutter/lib/src/material/toggleable.dart @@ -25,7 +25,7 @@ abstract class RenderToggleable extends RenderConstrainedBox { /// null. The [value] can only be null if tristate is true. RenderToggleable({ @required bool value, - bool tristate: false, + bool tristate = false, Size size, @required Color activeColor, @required Color inactiveColor, diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index 0f3c4292ae..038dd1d0f0 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -43,11 +43,11 @@ class Tooltip extends StatefulWidget { const Tooltip({ Key key, @required this.message, - this.height: 32.0, - this.padding: const EdgeInsets.symmetric(horizontal: 16.0), - this.verticalOffset: 24.0, - this.preferBelow: true, - this.excludeFromSemantics: false, + this.height = 32.0, + this.padding = const EdgeInsets.symmetric(horizontal: 16.0), + this.verticalOffset = 24.0, + this.preferBelow = true, + this.excludeFromSemantics = false, this.child, }) : assert(message != null), assert(height != null), diff --git a/packages/flutter/lib/src/material/two_level_list.dart b/packages/flutter/lib/src/material/two_level_list.dart index e23919c081..c0883b5651 100644 --- a/packages/flutter/lib/src/material/two_level_list.dart +++ b/packages/flutter/lib/src/material/two_level_list.dart @@ -46,7 +46,7 @@ class TwoLevelListItem extends StatelessWidget { this.leading, @required this.title, this.trailing, - this.enabled: true, + this.enabled = true, this.onTap, this.onLongPress }) : assert(title != null), @@ -113,7 +113,7 @@ class TwoLevelSublist extends StatefulWidget { @required this.title, this.backgroundColor, this.onOpenChanged, - this.children: const [], + this.children = const [], }) : super(key: key); /// A widget to display before the title. @@ -260,8 +260,8 @@ class TwoLevelList extends StatelessWidget { /// The [type] argument must not be null. const TwoLevelList({ Key key, - this.children: const [], - this.type: MaterialListType.twoLine, + this.children = const [], + this.type = MaterialListType.twoLine, this.padding, }) : assert(type != null), super(key: key); diff --git a/packages/flutter/lib/src/material/typography.dart b/packages/flutter/lib/src/material/typography.dart index e332854c0d..531628d3fe 100644 --- a/packages/flutter/lib/src/material/typography.dart +++ b/packages/flutter/lib/src/material/typography.dart @@ -246,8 +246,8 @@ class TextTheme extends Diagnosticable { /// point. TextTheme apply({ String fontFamily, - double fontSizeFactor: 1.0, - double fontSizeDelta: 0.0, + double fontSizeFactor = 1.0, + double fontSizeDelta = 0.0, Color displayColor, Color bodyColor, TextDecoration decoration, diff --git a/packages/flutter/lib/src/material/user_accounts_drawer_header.dart b/packages/flutter/lib/src/material/user_accounts_drawer_header.dart index 2126163c3c..f95af3e56b 100644 --- a/packages/flutter/lib/src/material/user_accounts_drawer_header.dart +++ b/packages/flutter/lib/src/material/user_accounts_drawer_header.dart @@ -252,7 +252,7 @@ class UserAccountsDrawerHeader extends StatefulWidget { const UserAccountsDrawerHeader({ Key key, this.decoration, - this.margin: const EdgeInsets.only(bottom: 8.0), + this.margin = const EdgeInsets.only(bottom: 8.0), this.currentAccountPicture, this.otherAccountsPictures, @required this.accountName, diff --git a/packages/flutter/lib/src/painting/beveled_rectangle_border.dart b/packages/flutter/lib/src/painting/beveled_rectangle_border.dart index 0ebef7e48a..fca46b5153 100644 --- a/packages/flutter/lib/src/painting/beveled_rectangle_border.dart +++ b/packages/flutter/lib/src/painting/beveled_rectangle_border.dart @@ -22,8 +22,8 @@ class BeveledRectangleBorder extends ShapeBorder { /// /// The arguments must not be null. const BeveledRectangleBorder({ - this.side: BorderSide.none, - this.borderRadius: BorderRadius.zero, + this.side = BorderSide.none, + this.borderRadius = BorderRadius.zero, }) : assert(side != null), assert(borderRadius != null); diff --git a/packages/flutter/lib/src/painting/border_radius.dart b/packages/flutter/lib/src/painting/border_radius.dart index 365610887b..bc10439f17 100644 --- a/packages/flutter/lib/src/painting/border_radius.dart +++ b/packages/flutter/lib/src/painting/border_radius.dart @@ -306,8 +306,8 @@ class BorderRadius extends BorderRadiusGeometry { /// Creates a vertically symmetric border radius where the top and bottom /// sides of the rectangle have the same radii. const BorderRadius.vertical({ - Radius top: Radius.zero, - Radius bottom: Radius.zero, + Radius top = Radius.zero, + Radius bottom = Radius.zero, }) : this.only( topLeft: top, topRight: top, @@ -318,8 +318,8 @@ class BorderRadius extends BorderRadiusGeometry { /// Creates a horizontally symmetrical border radius where the left and right /// sides of the rectangle have the same radii. const BorderRadius.horizontal({ - Radius left: Radius.zero, - Radius right: Radius.zero, + Radius left = Radius.zero, + Radius right = Radius.zero, }) : this.only( topLeft: left, topRight: right, @@ -330,10 +330,10 @@ class BorderRadius extends BorderRadiusGeometry { /// Creates a border radius with only the given non-zero values. The other /// corners will be right angles. const BorderRadius.only({ - this.topLeft: Radius.zero, - this.topRight: Radius.zero, - this.bottomLeft: Radius.zero, - this.bottomRight: Radius.zero, + this.topLeft = Radius.zero, + this.topRight = Radius.zero, + this.bottomLeft = Radius.zero, + this.bottomRight = Radius.zero, }); /// A border radius with all zero radii. @@ -541,8 +541,8 @@ class BorderRadiusDirectional extends BorderRadiusGeometry { /// Creates a vertically symmetric border radius where the top and bottom /// sides of the rectangle have the same radii. const BorderRadiusDirectional.vertical({ - Radius top: Radius.zero, - Radius bottom: Radius.zero, + Radius top = Radius.zero, + Radius bottom = Radius.zero, }) : this.only( topStart: top, topEnd: top, @@ -553,8 +553,8 @@ class BorderRadiusDirectional extends BorderRadiusGeometry { /// Creates a horizontally symmetrical border radius where the start and end /// sides of the rectangle have the same radii. const BorderRadiusDirectional.horizontal({ - Radius start: Radius.zero, - Radius end: Radius.zero, + Radius start = Radius.zero, + Radius end = Radius.zero, }) : this.only( topStart: start, topEnd: end, @@ -565,10 +565,10 @@ class BorderRadiusDirectional extends BorderRadiusGeometry { /// Creates a border radius with only the given non-zero values. The other /// corners will be right angles. const BorderRadiusDirectional.only({ - this.topStart: Radius.zero, - this.topEnd: Radius.zero, - this.bottomStart: Radius.zero, - this.bottomEnd: Radius.zero, + this.topStart = Radius.zero, + this.topEnd = Radius.zero, + this.bottomStart = Radius.zero, + this.bottomEnd = Radius.zero, }); /// A border radius with all zero radii. diff --git a/packages/flutter/lib/src/painting/borders.dart b/packages/flutter/lib/src/painting/borders.dart index eb0f934f44..ab430d20dd 100644 --- a/packages/flutter/lib/src/painting/borders.dart +++ b/packages/flutter/lib/src/painting/borders.dart @@ -59,9 +59,9 @@ class BorderSide { /// /// By default, the border is 1.0 logical pixels wide and solid black. const BorderSide({ - this.color: const Color(0xFF000000), - this.width: 1.0, - this.style: BorderStyle.solid, + this.color = const Color(0xFF000000), + this.width = 1.0, + this.style = BorderStyle.solid, }) : assert(color != null), assert(width != null), assert(width >= 0.0), @@ -306,7 +306,7 @@ abstract class ShapeBorder { /// The `reversed` argument is true if this object was the right operand of /// the `+` operator, and false if it was the left operand. @protected - ShapeBorder add(ShapeBorder other, { bool reversed: false }) => null; + ShapeBorder add(ShapeBorder other, { bool reversed = false }) => null; /// Creates a new border consisting of the two borders on either side of the /// operator. @@ -513,7 +513,7 @@ class _CompoundBorder extends ShapeBorder { } @override - ShapeBorder add(ShapeBorder other, { bool reversed: false }) { + ShapeBorder add(ShapeBorder other, { bool reversed = false }) { // This wraps the list of borders with "other", or, if "reversed" is true, // wraps "other" with the list of borders. // If "reversed" is false, "other" should end up being at the start of the @@ -661,10 +661,10 @@ class _CompoundBorder extends ShapeBorder { /// not uniform. /// * [BoxDecoration], which describes its border using the [Border] class. void paintBorder(Canvas canvas, Rect rect, { - BorderSide top: BorderSide.none, - BorderSide right: BorderSide.none, - BorderSide bottom: BorderSide.none, - BorderSide left: BorderSide.none, + BorderSide top = BorderSide.none, + BorderSide right = BorderSide.none, + BorderSide bottom = BorderSide.none, + BorderSide left = BorderSide.none, }) { assert(canvas != null); assert(rect != null); diff --git a/packages/flutter/lib/src/painting/box_border.dart b/packages/flutter/lib/src/painting/box_border.dart index 54f4b7a004..4ddfb99591 100644 --- a/packages/flutter/lib/src/painting/box_border.dart +++ b/packages/flutter/lib/src/painting/box_border.dart @@ -80,7 +80,7 @@ abstract class BoxBorder extends ShapeBorder { // We override this to tighten the return value, so that callers can assume // that we'll return a [BoxBorder]. @override - BoxBorder add(ShapeBorder other, { bool reversed: false }) => null; + BoxBorder add(ShapeBorder other, { bool reversed = false }) => null; /// Linearly interpolate between two borders. /// @@ -205,7 +205,7 @@ abstract class BoxBorder extends ShapeBorder { @override void paint(Canvas canvas, Rect rect, { TextDirection textDirection, - BoxShape shape: BoxShape.rectangle, + BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, }); @@ -305,10 +305,10 @@ class Border extends BoxBorder { /// /// The arguments must not be null. const Border({ - this.top: BorderSide.none, - this.right: BorderSide.none, - this.bottom: BorderSide.none, - this.left: BorderSide.none, + this.top = BorderSide.none, + this.right = BorderSide.none, + this.bottom = BorderSide.none, + this.left = BorderSide.none, }) : assert(top != null), assert(right != null), assert(bottom != null), @@ -318,9 +318,9 @@ class Border extends BoxBorder { /// /// The sides default to black solid borders, one logical pixel wide. factory Border.all({ - Color color: const Color(0xFF000000), - double width: 1.0, - BorderStyle style: BorderStyle.solid, + Color color = const Color(0xFF000000), + double width = 1.0, + BorderStyle style = BorderStyle.solid, }) { final BorderSide side = new BorderSide(color: color, width: width, style: style); return new Border(top: side, right: side, bottom: side, left: side); @@ -389,7 +389,7 @@ class Border extends BoxBorder { } @override - Border add(ShapeBorder other, { bool reversed: false }) { + Border add(ShapeBorder other, { bool reversed = false }) { if (other is! Border) return null; final Border typedOther = other; @@ -480,7 +480,7 @@ class Border extends BoxBorder { @override void paint(Canvas canvas, Rect rect, { TextDirection textDirection, - BoxShape shape: BoxShape.rectangle, + BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, }) { if (isUniform) { @@ -574,10 +574,10 @@ class BorderDirectional extends BoxBorder { /// /// The arguments must not be null. const BorderDirectional({ - this.top: BorderSide.none, - this.start: BorderSide.none, - this.end: BorderSide.none, - this.bottom: BorderSide.none, + this.top = BorderSide.none, + this.start = BorderSide.none, + this.end = BorderSide.none, + this.bottom = BorderSide.none, }) : assert(top != null), assert(start != null), assert(end != null), @@ -660,7 +660,7 @@ class BorderDirectional extends BoxBorder { } @override - BoxBorder add(ShapeBorder other, { bool reversed: false }) { + BoxBorder add(ShapeBorder other, { bool reversed = false }) { if (other is BorderDirectional) { final BorderDirectional typedOther = other; if (BorderSide.canMerge(top, typedOther.top) && @@ -783,7 +783,7 @@ class BorderDirectional extends BoxBorder { @override void paint(Canvas canvas, Rect rect, { TextDirection textDirection, - BoxShape shape: BoxShape.rectangle, + BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, }) { if (isUniform) { diff --git a/packages/flutter/lib/src/painting/box_decoration.dart b/packages/flutter/lib/src/painting/box_decoration.dart index 8413826462..43e8c0783b 100644 --- a/packages/flutter/lib/src/painting/box_decoration.dart +++ b/packages/flutter/lib/src/painting/box_decoration.dart @@ -79,7 +79,7 @@ class BoxDecoration extends Decoration { this.borderRadius, this.boxShadow, this.gradient, - this.shape: BoxShape.rectangle, + this.shape = BoxShape.rectangle, }) : assert(shape != null); @override diff --git a/packages/flutter/lib/src/painting/box_shadow.dart b/packages/flutter/lib/src/painting/box_shadow.dart index 1387890331..f78b8d058e 100644 --- a/packages/flutter/lib/src/painting/box_shadow.dart +++ b/packages/flutter/lib/src/painting/box_shadow.dart @@ -27,10 +27,10 @@ class BoxShadow { /// By default, the shadow is solid black with zero [offset], [blurRadius], /// and [spreadRadius]. const BoxShadow({ - this.color: const Color(0xFF000000), - this.offset: Offset.zero, - this.blurRadius: 0.0, - this.spreadRadius: 0.0 + this.color = const Color(0xFF000000), + this.offset = Offset.zero, + this.blurRadius = 0.0, + this.spreadRadius = 0.0 }); /// The color of the shadow. diff --git a/packages/flutter/lib/src/painting/circle_border.dart b/packages/flutter/lib/src/painting/circle_border.dart index 575b05bfb2..76396c23c3 100644 --- a/packages/flutter/lib/src/painting/circle_border.dart +++ b/packages/flutter/lib/src/painting/circle_border.dart @@ -25,7 +25,7 @@ class CircleBorder extends ShapeBorder { /// Create a circle border. /// /// The [side] argument must not be null. - const CircleBorder({ this.side: BorderSide.none }) : assert(side != null); + const CircleBorder({ this.side = BorderSide.none }) : assert(side != null); /// The style of this border. final BorderSide side; diff --git a/packages/flutter/lib/src/painting/debug.dart b/packages/flutter/lib/src/painting/debug.dart index 1951a6eb63..aff174a234 100644 --- a/packages/flutter/lib/src/painting/debug.dart +++ b/packages/flutter/lib/src/painting/debug.dart @@ -22,7 +22,7 @@ bool debugDisableShadows = false; /// The `debugDisableShadowsOverride` argument can be provided to override /// the expected value for [debugDisableShadows]. (This exists because the /// test framework itself overrides this value in some cases.) -bool debugAssertAllPaintingVarsUnset(String reason, { bool debugDisableShadowsOverride: false }) { +bool debugAssertAllPaintingVarsUnset(String reason, { bool debugDisableShadowsOverride = false }) { assert(() { if (debugDisableShadows != debugDisableShadowsOverride) { throw new FlutterError(reason); diff --git a/packages/flutter/lib/src/painting/decoration_image.dart b/packages/flutter/lib/src/painting/decoration_image.dart index a0102e2ac4..4102180d4f 100644 --- a/packages/flutter/lib/src/painting/decoration_image.dart +++ b/packages/flutter/lib/src/painting/decoration_image.dart @@ -42,10 +42,10 @@ class DecorationImage { @required this.image, this.colorFilter, this.fit, - this.alignment: Alignment.center, + this.alignment = Alignment.center, this.centerSlice, - this.repeat: ImageRepeat.noRepeat, - this.matchTextDirection: false, + this.repeat = ImageRepeat.noRepeat, + this.matchTextDirection = false, }) : assert(image != null), assert(alignment != null), assert(repeat != null), @@ -353,10 +353,10 @@ void paintImage({ @required ui.Image image, ColorFilter colorFilter, BoxFit fit, - Alignment alignment: Alignment.center, + Alignment alignment = Alignment.center, Rect centerSlice, - ImageRepeat repeat: ImageRepeat.noRepeat, - bool flipHorizontally: false, + ImageRepeat repeat = ImageRepeat.noRepeat, + bool flipHorizontally = false, }) { assert(canvas != null); assert(image != null); diff --git a/packages/flutter/lib/src/painting/edge_insets.dart b/packages/flutter/lib/src/painting/edge_insets.dart index 652dc06432..78cbc4103b 100644 --- a/packages/flutter/lib/src/painting/edge_insets.dart +++ b/packages/flutter/lib/src/painting/edge_insets.dart @@ -346,10 +346,10 @@ class EdgeInsets extends EdgeInsetsGeometry { /// const EdgeInsets.only(left: 40.0) /// ``` const EdgeInsets.only({ - this.left: 0.0, - this.top: 0.0, - this.right: 0.0, - this.bottom: 0.0 + this.left = 0.0, + this.top = 0.0, + this.right = 0.0, + this.bottom = 0.0 }); /// Creates insets with symmetrical vertical and horizontal offsets. @@ -361,8 +361,8 @@ class EdgeInsets extends EdgeInsetsGeometry { /// ```dart /// const EdgeInsets.symmetric(vertical: 8.0) /// ``` - const EdgeInsets.symmetric({ double vertical: 0.0, - double horizontal: 0.0 }) + const EdgeInsets.symmetric({ double vertical = 0.0, + double horizontal = 0.0 }) : left = horizontal, top = vertical, right = horizontal, bottom = vertical; /// Creates insets that match the given window padding. @@ -628,10 +628,10 @@ class EdgeInsetsDirectional extends EdgeInsetsGeometry { /// const EdgeInsetsDirectional.only(start: 40.0) /// ``` const EdgeInsetsDirectional.only({ - this.start: 0.0, - this.top: 0.0, - this.end: 0.0, - this.bottom: 0.0 + this.start = 0.0, + this.top = 0.0, + this.end = 0.0, + this.bottom = 0.0 }); /// An [EdgeInsetsDirectional] with zero offsets in each direction. diff --git a/packages/flutter/lib/src/painting/flutter_logo.dart b/packages/flutter/lib/src/painting/flutter_logo.dart index 29e0b5511e..468097544b 100644 --- a/packages/flutter/lib/src/painting/flutter_logo.dart +++ b/packages/flutter/lib/src/painting/flutter_logo.dart @@ -43,11 +43,11 @@ class FlutterLogoDecoration extends Decoration { /// The [lightColor], [darkColor], [textColor], [style], and [margin] /// arguments must not be null. const FlutterLogoDecoration({ - this.lightColor: const Color(0xFF42A5F5), // Colors.blue[400] - this.darkColor: const Color(0xFF0D47A1), // Colors.blue[900] - this.textColor: const Color(0xFF616161), - this.style: FlutterLogoStyle.markOnly, - this.margin: EdgeInsets.zero, + this.lightColor = const Color(0xFF42A5F5), // Colors.blue[400] + this.darkColor = const Color(0xFF0D47A1), // Colors.blue[900] + this.textColor = const Color(0xFF616161), + this.style = FlutterLogoStyle.markOnly, + this.margin = EdgeInsets.zero, }) : assert(lightColor != null), assert(darkColor != null), assert(textColor != null), diff --git a/packages/flutter/lib/src/painting/geometry.dart b/packages/flutter/lib/src/painting/geometry.dart index d7476e8f43..06c2c57365 100644 --- a/packages/flutter/lib/src/painting/geometry.dart +++ b/packages/flutter/lib/src/painting/geometry.dart @@ -43,8 +43,8 @@ Offset positionDependentBox({ @required Size childSize, @required Offset target, @required bool preferBelow, - double verticalOffset: 0.0, - double margin: 10.0, + double verticalOffset = 0.0, + double margin = 10.0, }) { assert(size != null); assert(childSize != null); diff --git a/packages/flutter/lib/src/painting/gradient.dart b/packages/flutter/lib/src/painting/gradient.dart index 8d29af7fa7..d803ede9c6 100644 --- a/packages/flutter/lib/src/painting/gradient.dart +++ b/packages/flutter/lib/src/painting/gradient.dart @@ -268,11 +268,11 @@ class LinearGradient extends Gradient { /// The [colors] argument must not be null. If [stops] is non-null, it must /// have the same length as [colors]. const LinearGradient({ - this.begin: Alignment.centerLeft, - this.end: Alignment.centerRight, + this.begin = Alignment.centerLeft, + this.end = Alignment.centerRight, @required List colors, List stops, - this.tileMode: TileMode.clamp, + this.tileMode = TileMode.clamp, }) : assert(begin != null), assert(end != null), assert(tileMode != null), @@ -508,13 +508,13 @@ class RadialGradient extends Gradient { /// The [colors] argument must not be null. If [stops] is non-null, it must /// have the same length as [colors]. const RadialGradient({ - this.center: Alignment.center, - this.radius: 0.5, + this.center = Alignment.center, + this.radius = 0.5, @required List colors, List stops, - this.tileMode: TileMode.clamp, + this.tileMode = TileMode.clamp, this.focal, - this.focalRadius: 0.0 + this.focalRadius = 0.0 }) : assert(center != null), assert(radius != null), assert(tileMode != null), @@ -766,12 +766,12 @@ class SweepGradient extends Gradient { /// The [colors] argument must not be null. If [stops] is non-null, it must /// have the same length as [colors]. const SweepGradient({ - this.center: Alignment.center, - this.startAngle: 0.0, - this.endAngle: math.pi * 2, + this.center = Alignment.center, + this.startAngle = 0.0, + this.endAngle = math.pi * 2, @required List colors, List stops, - this.tileMode: TileMode.clamp, + this.tileMode = TileMode.clamp, }) : assert(center != null), assert(startAngle != null), assert(endAngle != null), diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart index c5c093f2d1..be4d20beb3 100644 --- a/packages/flutter/lib/src/painting/image_provider.dart +++ b/packages/flutter/lib/src/painting/image_provider.dart @@ -401,7 +401,7 @@ class NetworkImage extends ImageProvider { /// Creates an object that fetches the image at the given URL. /// /// The arguments must not be null. - const NetworkImage(this.url, { this.scale: 1.0 , this.headers }) + const NetworkImage(this.url, { this.scale = 1.0 , this.headers }) : assert(url != null), assert(scale != null); @@ -478,7 +478,7 @@ class FileImage extends ImageProvider { /// Creates an object that decodes a [File] as an image. /// /// The arguments must not be null. - const FileImage(this.file, { this.scale: 1.0 }) + const FileImage(this.file, { this.scale = 1.0 }) : assert(file != null), assert(scale != null); @@ -546,7 +546,7 @@ class MemoryImage extends ImageProvider { /// Creates an object that decodes a [Uint8List] buffer as an image. /// /// The arguments must not be null. - const MemoryImage(this.bytes, { this.scale: 1.0 }) + const MemoryImage(this.bytes, { this.scale = 1.0 }) : assert(bytes != null), assert(scale != null); @@ -673,7 +673,7 @@ class ExactAssetImage extends AssetBundleImageProvider { /// included in a package. See the documentation for the [ExactAssetImage] class /// itself for details. const ExactAssetImage(this.assetName, { - this.scale: 1.0, + this.scale = 1.0, this.bundle, this.package, }) : assert(assetName != null), diff --git a/packages/flutter/lib/src/painting/image_stream.dart b/packages/flutter/lib/src/painting/image_stream.dart index decef4a631..9edcbcbe76 100644 --- a/packages/flutter/lib/src/painting/image_stream.dart +++ b/packages/flutter/lib/src/painting/image_stream.dart @@ -18,7 +18,7 @@ class ImageInfo { /// Creates an [ImageInfo] object for the given image and scale. /// /// Both the image and the scale must not be null. - const ImageInfo({ @required this.image, this.scale: 1.0 }) + const ImageInfo({ @required this.image, this.scale = 1.0 }) : assert(image != null), assert(scale != null); diff --git a/packages/flutter/lib/src/painting/matrix_utils.dart b/packages/flutter/lib/src/painting/matrix_utils.dart index 2b87271276..1d39a7a6f8 100644 --- a/packages/flutter/lib/src/painting/matrix_utils.dart +++ b/packages/flutter/lib/src/painting/matrix_utils.dart @@ -205,8 +205,8 @@ class MatrixUtils { static Matrix4 createCylindricalProjectionTransform({ @required double radius, @required double angle, - double perspective: 0.001, - Axis orientation: Axis.vertical, + double perspective = 0.001, + Axis orientation = Axis.vertical, }) { assert(radius != null); assert(angle != null); @@ -266,9 +266,9 @@ class TransformProperty extends DiagnosticsProperty { /// /// The [showName] and [level] arguments must not be null. TransformProperty(String name, Matrix4 value, { - bool showName: true, - Object defaultValue: kNoDefaultValue, - DiagnosticLevel level: DiagnosticLevel.info, + bool showName = true, + Object defaultValue = kNoDefaultValue, + DiagnosticLevel level = DiagnosticLevel.info, }) : assert(showName != null), assert(level != null), super( diff --git a/packages/flutter/lib/src/painting/rounded_rectangle_border.dart b/packages/flutter/lib/src/painting/rounded_rectangle_border.dart index a01ab02c3c..009600736b 100644 --- a/packages/flutter/lib/src/painting/rounded_rectangle_border.dart +++ b/packages/flutter/lib/src/painting/rounded_rectangle_border.dart @@ -29,8 +29,8 @@ class RoundedRectangleBorder extends ShapeBorder { /// /// The arguments must not be null. const RoundedRectangleBorder({ - this.side: BorderSide.none, - this.borderRadius: BorderRadius.zero, + this.side = BorderSide.none, + this.borderRadius = BorderRadius.zero, }) : assert(side != null), assert(borderRadius != null); @@ -142,8 +142,8 @@ class RoundedRectangleBorder extends ShapeBorder { class _RoundedRectangleToCircleBorder extends ShapeBorder { const _RoundedRectangleToCircleBorder({ - this.side: BorderSide.none, - this.borderRadius: BorderRadius.zero, + this.side = BorderSide.none, + this.borderRadius = BorderRadius.zero, @required this.circleness, }) : assert(side != null), assert(borderRadius != null), diff --git a/packages/flutter/lib/src/painting/stadium_border.dart b/packages/flutter/lib/src/painting/stadium_border.dart index 13d76c01a8..d69f48905e 100644 --- a/packages/flutter/lib/src/painting/stadium_border.dart +++ b/packages/flutter/lib/src/painting/stadium_border.dart @@ -129,8 +129,8 @@ class StadiumBorder extends ShapeBorder { // Class to help with transitioning to/from a CircleBorder. class _StadiumToCircleBorder extends ShapeBorder { const _StadiumToCircleBorder({ - this.side: BorderSide.none, - this.circleness: 0.0, + this.side = BorderSide.none, + this.circleness = 0.0, }) : assert(side != null), assert(circleness != null); @@ -278,9 +278,9 @@ class _StadiumToCircleBorder extends ShapeBorder { // Class to help with transitioning to/from a RoundedRectBorder. class _StadiumToRoundedRectangleBorder extends ShapeBorder { const _StadiumToRoundedRectangleBorder({ - this.side: BorderSide.none, - this.borderRadius: BorderRadius.zero, - this.rectness: 0.0, + this.side = BorderSide.none, + this.borderRadius = BorderRadius.zero, + this.rectness = 0.0, }) : assert(side != null), assert(borderRadius != null), assert(rectness != null); diff --git a/packages/flutter/lib/src/painting/text_painter.dart b/packages/flutter/lib/src/painting/text_painter.dart index 1cc74f49c3..4704b34f0d 100644 --- a/packages/flutter/lib/src/painting/text_painter.dart +++ b/packages/flutter/lib/src/painting/text_painter.dart @@ -41,9 +41,9 @@ class TextPainter { /// The [maxLines] property, if non-null, must be greater than zero. TextPainter({ TextSpan text, - TextAlign textAlign: TextAlign.start, + TextAlign textAlign = TextAlign.start, TextDirection textDirection, - double textScaleFactor: 1.0, + double textScaleFactor = 1.0, int maxLines, String ellipsis, ui.Locale locale, @@ -341,7 +341,7 @@ class TextPainter { /// /// The [text] and [textDirection] properties must be non-null before this is /// called. - void layout({ double minWidth: 0.0, double maxWidth: double.infinity }) { + void layout({ double minWidth = 0.0, double maxWidth = double.infinity }) { assert(text != null, 'TextPainter.text must be set to a non-null value before using the TextPainter.'); assert(textDirection != null, 'TextPainter.textDirection must be set to a non-null value before using the TextPainter.'); if (!_needsLayout && minWidth == _lastMinWidth && maxWidth == _lastMaxWidth) diff --git a/packages/flutter/lib/src/painting/text_span.dart b/packages/flutter/lib/src/painting/text_span.dart index 52fcdefb23..6b8c79fc14 100644 --- a/packages/flutter/lib/src/painting/text_span.dart +++ b/packages/flutter/lib/src/painting/text_span.dart @@ -161,7 +161,7 @@ class TextSpan extends DiagnosticableTree { /// Rather than using this directly, it's simpler to use the /// [TextPainter] class to paint [TextSpan] objects onto [Canvas] /// objects. - void build(ui.ParagraphBuilder builder, { double textScaleFactor: 1.0 }) { + void build(ui.ParagraphBuilder builder, { double textScaleFactor = 1.0 }) { assert(debugAssertIsValid()); final bool hasStyle = style != null; if (hasStyle) diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index 7ddfdc6d39..36b7f125c0 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -220,7 +220,7 @@ class TextStyle extends Diagnosticable { /// package. It is combined with the `fontFamily` argument to set the /// [fontFamily] property. const TextStyle({ - this.inherit: true, + this.inherit = true, this.color, this.fontSize, this.fontWeight, @@ -403,15 +403,15 @@ class TextStyle extends Diagnosticable { Color decorationColor, TextDecorationStyle decorationStyle, String fontFamily, - double fontSizeFactor: 1.0, - double fontSizeDelta: 0.0, - int fontWeightDelta: 0, - double letterSpacingFactor: 1.0, - double letterSpacingDelta: 0.0, - double wordSpacingFactor: 1.0, - double wordSpacingDelta: 0.0, - double heightFactor: 1.0, - double heightDelta: 0.0, + double fontSizeFactor = 1.0, + double fontSizeDelta = 0.0, + int fontWeightDelta = 0, + double letterSpacingFactor = 1.0, + double letterSpacingDelta = 0.0, + double wordSpacingFactor = 1.0, + double wordSpacingDelta = 0.0, + double heightFactor = 1.0, + double heightDelta = 0.0, }) { assert(fontSizeFactor != null); assert(fontSizeDelta != null); @@ -592,7 +592,7 @@ class TextStyle extends Diagnosticable { } /// The style information for text runs, encoded for use by `dart:ui`. - ui.TextStyle getTextStyle({ double textScaleFactor: 1.0 }) { + ui.TextStyle getTextStyle({ double textScaleFactor = 1.0 }) { return new ui.TextStyle( color: color, decoration: decoration, @@ -622,7 +622,7 @@ class TextStyle extends Diagnosticable { ui.ParagraphStyle getParagraphStyle({ TextAlign textAlign, TextDirection textDirection, - double textScaleFactor: 1.0, + double textScaleFactor = 1.0, String ellipsis, int maxLines, Locale locale, @@ -722,7 +722,7 @@ class TextStyle extends Diagnosticable { /// Adds all properties prefixing property names with the optional `prefix`. @override - void debugFillProperties(DiagnosticPropertiesBuilder properties, { String prefix: '' }) { + void debugFillProperties(DiagnosticPropertiesBuilder properties, { String prefix = '' }) { super.debugFillProperties(properties); if (debugLabel != null) properties.add(new MessageProperty('${prefix}debugLabel', debugLabel)); diff --git a/packages/flutter/lib/src/physics/clamped_simulation.dart b/packages/flutter/lib/src/physics/clamped_simulation.dart index fe97425095..d9224101cd 100644 --- a/packages/flutter/lib/src/physics/clamped_simulation.dart +++ b/packages/flutter/lib/src/physics/clamped_simulation.dart @@ -22,10 +22,10 @@ class ClampedSimulation extends Simulation { /// The named arguments specify the ranges for the clamping behavior, as /// applied to [x] and [dx]. ClampedSimulation(this.simulation, { - this.xMin: double.negativeInfinity, - this.xMax: double.infinity, - this.dxMin: double.negativeInfinity, - this.dxMax: double.infinity + this.xMin = double.negativeInfinity, + this.xMax = double.infinity, + this.dxMin = double.negativeInfinity, + this.dxMax = double.infinity }) : assert(simulation != null), assert(xMax >= xMin), assert(dxMax >= dxMin); diff --git a/packages/flutter/lib/src/physics/friction_simulation.dart b/packages/flutter/lib/src/physics/friction_simulation.dart index ca5052365d..7a56b204eb 100644 --- a/packages/flutter/lib/src/physics/friction_simulation.dart +++ b/packages/flutter/lib/src/physics/friction_simulation.dart @@ -19,7 +19,7 @@ class FrictionSimulation extends Simulation { /// length units as used for [x]; and the initial velocity, in the same /// velocity units as used for [dx]. FrictionSimulation(double drag, double position, double velocity, { - Tolerance tolerance: Tolerance.defaultTolerance, + Tolerance tolerance = Tolerance.defaultTolerance, }) : _drag = drag, _dragLog = math.log(drag), _x = position, diff --git a/packages/flutter/lib/src/physics/simulation.dart b/packages/flutter/lib/src/physics/simulation.dart index 16ef70f726..7802341064 100644 --- a/packages/flutter/lib/src/physics/simulation.dart +++ b/packages/flutter/lib/src/physics/simulation.dart @@ -31,7 +31,7 @@ import 'tolerance.dart'; /// related objects. abstract class Simulation { /// Initializes the [tolerance] field for subclasses. - Simulation({ this.tolerance: Tolerance.defaultTolerance }); + Simulation({ this.tolerance = Tolerance.defaultTolerance }); /// The position of the object in the simulation at the given time. double x(double time); diff --git a/packages/flutter/lib/src/physics/spring_simulation.dart b/packages/flutter/lib/src/physics/spring_simulation.dart index 786886e3e4..137f5602d0 100644 --- a/packages/flutter/lib/src/physics/spring_simulation.dart +++ b/packages/flutter/lib/src/physics/spring_simulation.dart @@ -31,7 +31,7 @@ class SpringDescription { SpringDescription.withDampingRatio({ this.mass, this.stiffness, - double ratio: 1.0 + double ratio = 1.0 }) : damping = ratio * 2.0 * math.sqrt(mass * stiffness); /// The mass of the spring (m). The units are arbitrary, but all springs @@ -92,7 +92,7 @@ class SpringSimulation extends Simulation { double start, double end, double velocity, { - Tolerance tolerance: Tolerance.defaultTolerance, + Tolerance tolerance = Tolerance.defaultTolerance, }) : _endPosition = end, _solution = new _SpringSolution(spring, start - end, velocity), super(tolerance: tolerance); @@ -135,7 +135,7 @@ class ScrollSpringSimulation extends SpringSimulation { double start, double end, double velocity, { - Tolerance tolerance: Tolerance.defaultTolerance, + Tolerance tolerance = Tolerance.defaultTolerance, }) : super(spring, start, end, velocity, tolerance: tolerance); @override diff --git a/packages/flutter/lib/src/physics/tolerance.dart b/packages/flutter/lib/src/physics/tolerance.dart index 7216d21a26..5b73e4eb0b 100644 --- a/packages/flutter/lib/src/physics/tolerance.dart +++ b/packages/flutter/lib/src/physics/tolerance.dart @@ -10,9 +10,9 @@ class Tolerance { /// /// The arguments should all be positive values. const Tolerance({ - this.distance: _epsilonDefault, - this.time: _epsilonDefault, - this.velocity: _epsilonDefault + this.distance = _epsilonDefault, + this.time = _epsilonDefault, + this.velocity = _epsilonDefault }); static const double _epsilonDefault = 1e-3; diff --git a/packages/flutter/lib/src/rendering/animated_size.dart b/packages/flutter/lib/src/rendering/animated_size.dart index 9f1ce79fe2..a543db5236 100644 --- a/packages/flutter/lib/src/rendering/animated_size.dart +++ b/packages/flutter/lib/src/rendering/animated_size.dart @@ -76,8 +76,8 @@ class RenderAnimatedSize extends RenderAligningShiftedBox { RenderAnimatedSize({ @required TickerProvider vsync, @required Duration duration, - Curve curve: Curves.linear, - AlignmentGeometry alignment: Alignment.center, + Curve curve = Curves.linear, + AlignmentGeometry alignment = Alignment.center, TextDirection textDirection, RenderBox child, }) : assert(vsync != null), diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 5c0f7c2c91..296c470ccf 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -82,10 +82,10 @@ class _DebugSize extends Size { class BoxConstraints extends Constraints { /// Creates box constraints with the given constraints. const BoxConstraints({ - this.minWidth: 0.0, - this.maxWidth: double.infinity, - this.minHeight: 0.0, - this.maxHeight: double.infinity + this.minWidth = 0.0, + this.maxWidth = double.infinity, + this.minHeight = 0.0, + this.maxHeight = double.infinity }); /// The minimum width that satisfies the constraints. @@ -134,8 +134,8 @@ class BoxConstraints extends Constraints { /// * [new BoxConstraints.tightFor], which is similar but instead of being /// tight if the value is not infinite, is tight if the value is non-null. const BoxConstraints.tightForFinite({ - double width: double.infinity, - double height: double.infinity + double width = double.infinity, + double height = double.infinity }): minWidth = width != double.infinity ? width : 0.0, maxWidth = width != double.infinity ? width : double.infinity, minHeight = height != double.infinity ? height : 0.0, @@ -457,7 +457,7 @@ class BoxConstraints extends Constraints { @override bool debugAssertIsValid({ - bool isAppliedConstraint: false, + bool isAppliedConstraint = false, InformationCollector informationCollector, }) { assert(() { @@ -1602,7 +1602,7 @@ abstract class RenderBox extends RenderObject { /// /// When implementing a [RenderBox] subclass, to override the baseline /// computation, override [computeDistanceToActualBaseline]. - double getDistanceToBaseline(TextBaseline baseline, { bool onlyReal: false }) { + double getDistanceToBaseline(TextBaseline baseline, { bool onlyReal = false }) { assert(!_debugDoingBaseline, 'Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.'); assert(!debugNeedsLayout); assert(() { diff --git a/packages/flutter/lib/src/rendering/custom_paint.dart b/packages/flutter/lib/src/rendering/custom_paint.dart index 20ebbf216c..4758be525b 100644 --- a/packages/flutter/lib/src/rendering/custom_paint.dart +++ b/packages/flutter/lib/src/rendering/custom_paint.dart @@ -362,9 +362,9 @@ class RenderCustomPaint extends RenderProxyBox { RenderCustomPaint({ CustomPainter painter, CustomPainter foregroundPainter, - Size preferredSize: Size.zero, - this.isComplex: false, - this.willChange: false, + Size preferredSize = Size.zero, + this.isComplex = false, + this.willChange = false, RenderBox child, }) : assert(preferredSize != null), _painter = painter, diff --git a/packages/flutter/lib/src/rendering/debug.dart b/packages/flutter/lib/src/rendering/debug.dart index 82633264f9..104bfd7fa1 100644 --- a/packages/flutter/lib/src/rendering/debug.dart +++ b/packages/flutter/lib/src/rendering/debug.dart @@ -162,7 +162,7 @@ void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color c /// /// Called by [RenderPadding.debugPaintSize] when [debugPaintSizeEnabled] is /// true. -void debugPaintPadding(Canvas canvas, Rect outerRect, Rect innerRect, { double outlineWidth: 2.0 }) { +void debugPaintPadding(Canvas canvas, Rect outerRect, Rect innerRect, { double outlineWidth = 2.0 }) { assert(() { if (innerRect != null && !innerRect.isEmpty) { _debugDrawDoubleRect(canvas, outerRect, innerRect, const Color(0x900090FF)); @@ -187,7 +187,7 @@ void debugPaintPadding(Canvas canvas, Rect outerRect, Rect innerRect, { double o /// The `debugCheckIntrinsicSizesOverride` argument can be provided to override /// the expected value for [debugCheckIntrinsicSizes]. (This exists because the /// test framework itself overrides this value in some cases.) -bool debugAssertAllRenderVarsUnset(String reason, { bool debugCheckIntrinsicSizesOverride: false }) { +bool debugAssertAllRenderVarsUnset(String reason, { bool debugCheckIntrinsicSizesOverride = false }) { assert(() { if (debugPaintSizeEnabled || debugPaintBaselinesEnabled || diff --git a/packages/flutter/lib/src/rendering/debug_overflow_indicator.dart b/packages/flutter/lib/src/rendering/debug_overflow_indicator.dart index 3df67c87bd..f60bbcc8c6 100644 --- a/packages/flutter/lib/src/rendering/debug_overflow_indicator.dart +++ b/packages/flutter/lib/src/rendering/debug_overflow_indicator.dart @@ -23,9 +23,9 @@ enum _OverflowSide { class _OverflowRegionData { const _OverflowRegionData({ this.rect, - this.label: '', - this.labelOffset: Offset.zero, - this.rotation: 0.0, + this.label = '', + this.labelOffset = Offset.zero, + this.rotation = 0.0, this.side, }); diff --git a/packages/flutter/lib/src/rendering/editable.dart b/packages/flutter/lib/src/rendering/editable.dart index 72327ec4fe..6052fed969 100644 --- a/packages/flutter/lib/src/rendering/editable.dart +++ b/packages/flutter/lib/src/rendering/editable.dart @@ -120,19 +120,19 @@ class RenderEditable extends RenderBox { RenderEditable({ TextSpan text, @required TextDirection textDirection, - TextAlign textAlign: TextAlign.start, + TextAlign textAlign = TextAlign.start, Color cursorColor, ValueNotifier showCursor, bool hasFocus, - int maxLines: 1, + int maxLines = 1, Color selectionColor, - double textScaleFactor: 1.0, + double textScaleFactor = 1.0, TextSelection selection, @required ViewportOffset offset, this.onSelectionChanged, this.onCaretChanged, - this.ignorePointer: false, - bool obscureText: false, + this.ignorePointer = false, + bool obscureText = false, }) : assert(textAlign != null), assert(textDirection != null, 'RenderEditable created without a textDirection.'), assert(maxLines == null || maxLines > 0), diff --git a/packages/flutter/lib/src/rendering/flex.dart b/packages/flutter/lib/src/rendering/flex.dart index 71369c8384..97a85ce1db 100644 --- a/packages/flutter/lib/src/rendering/flex.dart +++ b/packages/flutter/lib/src/rendering/flex.dart @@ -270,12 +270,12 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin children, - Axis direction: Axis.horizontal, - MainAxisSize mainAxisSize: MainAxisSize.max, - MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start, - CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center, + Axis direction = Axis.horizontal, + MainAxisSize mainAxisSize = MainAxisSize.max, + MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, + CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, TextDirection textDirection, - VerticalDirection verticalDirection: VerticalDirection.down, + VerticalDirection verticalDirection = VerticalDirection.down, TextBaseline textBaseline, }) : assert(direction != null), assert(mainAxisAlignment != null), diff --git a/packages/flutter/lib/src/rendering/flow.dart b/packages/flutter/lib/src/rendering/flow.dart index 04f147f0ac..d6f764bf17 100644 --- a/packages/flutter/lib/src/rendering/flow.dart +++ b/packages/flutter/lib/src/rendering/flow.dart @@ -39,7 +39,7 @@ abstract class FlowPaintingContext { /// x increasing rightward and y increasing downward. /// /// The container will clip the children to its bounds. - void paintChild(int i, { Matrix4 transform, double opacity: 1.0 }); + void paintChild(int i, { Matrix4 transform, double opacity = 1.0 }); } /// A delegate that controls the appearance of a flow layout. @@ -313,7 +313,7 @@ class RenderFlow extends RenderBox } @override - void paintChild(int i, { Matrix4 transform, double opacity: 1.0 }) { + void paintChild(int i, { Matrix4 transform, double opacity = 1.0 }) { transform ??= new Matrix4.identity(); final RenderBox child = _randomAccessChildren[i]; final FlowParentData childParentData = child.parentData; diff --git a/packages/flutter/lib/src/rendering/image.dart b/packages/flutter/lib/src/rendering/image.dart index 0dbdf4b548..a6fa57a5f7 100644 --- a/packages/flutter/lib/src/rendering/image.dart +++ b/packages/flutter/lib/src/rendering/image.dart @@ -28,14 +28,14 @@ class RenderImage extends RenderBox { ui.Image image, double width, double height, - double scale: 1.0, + double scale = 1.0, Color color, BlendMode colorBlendMode, BoxFit fit, - AlignmentGeometry alignment: Alignment.center, - ImageRepeat repeat: ImageRepeat.noRepeat, + AlignmentGeometry alignment = Alignment.center, + ImageRepeat repeat = ImageRepeat.noRepeat, Rect centerSlice, - bool matchTextDirection: false, + bool matchTextDirection = false, TextDirection textDirection, }) : assert(scale != null), assert(repeat != null), diff --git a/packages/flutter/lib/src/rendering/layer.dart b/packages/flutter/lib/src/rendering/layer.dart index f879a43484..8dce68bb74 100644 --- a/packages/flutter/lib/src/rendering/layer.dart +++ b/packages/flutter/lib/src/rendering/layer.dart @@ -495,7 +495,7 @@ class OffsetLayer extends ContainerLayer { /// /// By default, [offset] is zero. It must be non-null before the compositing /// phase of the pipeline. - OffsetLayer({ this.offset: Offset.zero }); + OffsetLayer({ this.offset = Offset.zero }); /// Offset from parent in the parent's coordinate system. /// @@ -533,7 +533,7 @@ class OffsetLayer extends ContainerLayer { /// /// * [RenderRepaintBoundary.toImage] for a similar API at the render object level. /// * [dart:ui.Scene.toImage] for more information about the image returned. - Future toImage(Rect bounds, {double pixelRatio: 1.0}) async { + Future toImage(Rect bounds, {double pixelRatio = 1.0}) async { assert(bounds != null); assert(pixelRatio != null); final ui.SceneBuilder builder = new ui.SceneBuilder(); @@ -676,7 +676,7 @@ class TransformLayer extends OffsetLayer { /// /// The [transform] and [offset] properties must be non-null before the /// compositing phase of the pipeline. - TransformLayer({ this.transform, Offset offset: Offset.zero }) : super(offset: offset); + TransformLayer({ this.transform, Offset offset = Offset.zero }) : super(offset: offset); /// The matrix to apply. /// @@ -938,7 +938,7 @@ class LeaderLayer extends ContainerLayer { /// /// The [offset] property must be non-null before the compositing phase of the /// pipeline. - LeaderLayer({ @required this.link, this.offset: Offset.zero }) : assert(link != null); + LeaderLayer({ @required this.link, this.offset = Offset.zero }) : assert(link != null); /// The object with which this layer should register. /// @@ -1030,9 +1030,9 @@ class FollowerLayer extends ContainerLayer { /// must be non-null before the compositing phase of the pipeline. FollowerLayer({ @required this.link, - this.showWhenUnlinked: true, - this.unlinkedOffset: Offset.zero, - this.linkedOffset: Offset.zero, + this.showWhenUnlinked = true, + this.unlinkedOffset = Offset.zero, + this.linkedOffset = Offset.zero, }) : assert(link != null); /// The link to the [LeaderLayer]. diff --git a/packages/flutter/lib/src/rendering/list_body.dart b/packages/flutter/lib/src/rendering/list_body.dart index 34c2fbfc23..a7b8adf0a9 100644 --- a/packages/flutter/lib/src/rendering/list_body.dart +++ b/packages/flutter/lib/src/rendering/list_body.dart @@ -31,7 +31,7 @@ class RenderListBody extends RenderBox /// By default, children are arranged along the vertical axis. RenderListBody({ List children, - AxisDirection axisDirection: AxisDirection.down, + AxisDirection axisDirection = AxisDirection.down, }) : assert(axisDirection != null), _axisDirection = axisDirection { addAll(children); diff --git a/packages/flutter/lib/src/rendering/list_wheel_viewport.dart b/packages/flutter/lib/src/rendering/list_wheel_viewport.dart index cfc016e3dc..4b9fff6c7f 100644 --- a/packages/flutter/lib/src/rendering/list_wheel_viewport.dart +++ b/packages/flutter/lib/src/rendering/list_wheel_viewport.dart @@ -97,11 +97,11 @@ class RenderListWheelViewport /// All arguments must not be null. Optional arguments have reasonable defaults. RenderListWheelViewport({ @required ViewportOffset offset, - double diameterRatio: defaultDiameterRatio, - double perspective: defaultPerspective, + double diameterRatio = defaultDiameterRatio, + double perspective = defaultPerspective, @required double itemExtent, - bool clipToSize: true, - bool renderChildrenOutsideViewport: false, + bool clipToSize = true, + bool renderChildrenOutsideViewport = false, List children, }) : assert(offset != null), assert(diameterRatio != null), diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index 6aad662027..abca2355e9 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -84,7 +84,7 @@ class PaintingContext { /// /// * [RenderObject.isRepaintBoundary], which determines if a [RenderObject] /// has a composited layer. - static void repaintCompositedChild(RenderObject child, { bool debugAlsoPaintedParent: false }) { + static void repaintCompositedChild(RenderObject child, { bool debugAlsoPaintedParent = false }) { assert(child.isRepaintBoundary); assert(child._needsPaint); assert(() { @@ -519,7 +519,7 @@ abstract class Constraints { /// /// Returns the same as [isNormalized] if asserts are disabled. bool debugAssertIsValid({ - bool isAppliedConstraint: false, + bool isAppliedConstraint = false, InformationCollector informationCollector }) { assert(isNormalized); @@ -1480,7 +1480,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im /// children unconditionally. It is the [layout] method's responsibility (as /// implemented here) to return early if the child does not need to do any /// work to update its layout information. - void layout(Constraints constraints, { bool parentUsesSize: false }) { + void layout(Constraints constraints, { bool parentUsesSize = false }) { assert(constraints != null); assert(constraints.debugAssertIsValid( isAppliedConstraint: true, @@ -1721,7 +1721,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im /// /// This can be used to record metrics about whether the node should actually /// be a repaint boundary. - void debugRegisterRepaintBoundaryPaint({ bool includedParent: true, bool includedChild: false }) { } + void debugRegisterRepaintBoundaryPaint({ bool includedParent = true, bool includedChild = false }) { } /// Whether this render object always needs compositing. /// @@ -2499,9 +2499,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im /// will be prefixed by that string. @override String toStringDeep({ - String prefixLineOne: '', - String prefixOtherLines: '', - DiagnosticLevel minLevel: DiagnosticLevel.debug, + String prefixLineOne = '', + String prefixOtherLines = '', + DiagnosticLevel minLevel = DiagnosticLevel.debug, }) { RenderObject debugPreviousActiveLayout; assert(() { @@ -2528,8 +2528,8 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im /// [toStringDeep], but does not recurse to any children. @override String toStringShallow({ - String joiner: '; ', - DiagnosticLevel minLevel: DiagnosticLevel.debug, + String joiner = '; ', + DiagnosticLevel minLevel = DiagnosticLevel.debug, }) { RenderObject debugPreviousActiveLayout; assert(() { @@ -2985,7 +2985,7 @@ class FlutterErrorDetailsForRendering extends FlutterErrorDetails { String context, this.renderObject, InformationCollector informationCollector, - bool silent: false + bool silent = false }) : super( exception: exception, stack: stack, diff --git a/packages/flutter/lib/src/rendering/paragraph.dart b/packages/flutter/lib/src/rendering/paragraph.dart index f5a56235da..189bf8a30d 100644 --- a/packages/flutter/lib/src/rendering/paragraph.dart +++ b/packages/flutter/lib/src/rendering/paragraph.dart @@ -38,11 +38,11 @@ class RenderParagraph extends RenderBox { /// The [maxLines] property may be null (and indeed defaults to null), but if /// it is not null, it must be greater than zero. RenderParagraph(TextSpan text, { - TextAlign textAlign: TextAlign.start, + TextAlign textAlign = TextAlign.start, @required TextDirection textDirection, - bool softWrap: true, - TextOverflow overflow: TextOverflow.clip, - double textScaleFactor: 1.0, + bool softWrap = true, + TextOverflow overflow = TextOverflow.clip, + double textScaleFactor = 1.0, int maxLines, ui.Locale locale, }) : assert(text != null), @@ -185,7 +185,7 @@ class RenderParagraph extends RenderBox { markNeedsLayout(); } - void _layoutText({ double minWidth: 0.0, double maxWidth: double.infinity }) { + void _layoutText({ double minWidth = 0.0, double maxWidth = double.infinity }) { final bool widthMatters = softWrap || overflow == TextOverflow.ellipsis; _textPainter.layout(minWidth: minWidth, maxWidth: widthMatters ? maxWidth : double.infinity); } diff --git a/packages/flutter/lib/src/rendering/performance_overlay.dart b/packages/flutter/lib/src/rendering/performance_overlay.dart index c48118ca01..3d0e33ef48 100644 --- a/packages/flutter/lib/src/rendering/performance_overlay.dart +++ b/packages/flutter/lib/src/rendering/performance_overlay.dart @@ -62,10 +62,10 @@ class RenderPerformanceOverlay extends RenderBox { /// The [optionsMask], [rasterizerThreshold], [checkerboardRasterCacheImages], /// and [checkerboardOffscreenLayers] arguments must not be null. RenderPerformanceOverlay({ - int optionsMask: 0, - int rasterizerThreshold: 0, - bool checkerboardRasterCacheImages: false, - bool checkerboardOffscreenLayers: false, + int optionsMask = 0, + int rasterizerThreshold = 0, + bool checkerboardRasterCacheImages = false, + bool checkerboardOffscreenLayers = false, }) : assert(optionsMask != null), assert(rasterizerThreshold != null), assert(checkerboardRasterCacheImages != null), diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index a6c69e5045..3e0c49901d 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -151,7 +151,7 @@ abstract class RenderProxyBoxWithHitTestBehavior extends RenderProxyBox { /// /// By default, the [behavior] is [HitTestBehavior.deferToChild]. RenderProxyBoxWithHitTestBehavior({ - this.behavior: HitTestBehavior.deferToChild, + this.behavior = HitTestBehavior.deferToChild, RenderBox child }) : super(child); @@ -304,8 +304,8 @@ class RenderLimitedBox extends RenderProxyBox { /// non-negative. RenderLimitedBox({ RenderBox child, - double maxWidth: double.infinity, - double maxHeight: double.infinity + double maxWidth = double.infinity, + double maxHeight = double.infinity }) : assert(maxWidth != null && maxWidth >= 0.0), assert(maxHeight != null && maxHeight >= 0.0), _maxWidth = maxWidth, @@ -713,7 +713,7 @@ class RenderOpacity extends RenderProxyBox { /// Creates a partially transparent render object. /// /// The [opacity] argument must be between 0.0 and 1.0, inclusive. - RenderOpacity({ double opacity: 1.0, RenderBox child }) + RenderOpacity({ double opacity = 1.0, RenderBox child }) : assert(opacity != null), assert(opacity >= 0.0 && opacity <= 1.0), _opacity = opacity, @@ -889,7 +889,7 @@ class RenderShaderMask extends RenderProxyBox { RenderShaderMask({ RenderBox child, @required ShaderCallback shaderCallback, - BlendMode blendMode: BlendMode.modulate, + BlendMode blendMode = BlendMode.modulate, }) : assert(shaderCallback != null), assert(blendMode != null), _shaderCallback = shaderCallback, @@ -1249,7 +1249,7 @@ class RenderClipRRect extends _RenderCustomClip { /// If [clipper] is non-null, then [borderRadius] is ignored. RenderClipRRect({ RenderBox child, - BorderRadius borderRadius: BorderRadius.zero, + BorderRadius borderRadius = BorderRadius.zero, CustomClipper clipper, }) : _borderRadius = borderRadius, super(child: child, clipper: clipper) { assert(_borderRadius != null || clipper != null); @@ -1516,11 +1516,11 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase { /// The [shape], [elevation], [color], and [shadowColor] must not be null. RenderPhysicalModel({ RenderBox child, - BoxShape shape: BoxShape.rectangle, + BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, - double elevation: 0.0, + double elevation = 0.0, @required Color color, - Color shadowColor: const Color(0xFF000000), + Color shadowColor = const Color(0xFF000000), }) : assert(shape != null), assert(elevation != null), assert(color != null), @@ -1685,9 +1685,9 @@ class RenderPhysicalShape extends _RenderPhysicalModelBase { RenderPhysicalShape({ RenderBox child, @required CustomClipper clipper, - double elevation: 0.0, + double elevation = 0.0, @required Color color, - Color shadowColor: const Color(0xFF000000), + Color shadowColor = const Color(0xFF000000), }) : assert(clipper != null), assert(elevation != null), assert(color != null), @@ -1799,8 +1799,8 @@ class RenderDecoratedBox extends RenderProxyBox { /// filled in) to let it resolve images. RenderDecoratedBox({ @required Decoration decoration, - DecorationPosition position: DecorationPosition.background, - ImageConfiguration configuration: ImageConfiguration.empty, + DecorationPosition position = DecorationPosition.background, + ImageConfiguration configuration = ImageConfiguration.empty, RenderBox child, }) : assert(decoration != null), assert(position != null), @@ -1929,7 +1929,7 @@ class RenderTransform extends RenderProxyBox { Offset origin, AlignmentGeometry alignment, TextDirection textDirection, - this.transformHitTests: true, + this.transformHitTests = true, RenderBox child }) : assert(transform != null), super(child) { @@ -2129,8 +2129,8 @@ class RenderFittedBox extends RenderProxyBox { /// /// The [fit] and [alignment] arguments must not be null. RenderFittedBox({ - BoxFit fit: BoxFit.contain, - AlignmentGeometry alignment: Alignment.center, + BoxFit fit = BoxFit.contain, + AlignmentGeometry alignment = Alignment.center, TextDirection textDirection, RenderBox child, }) : assert(fit != null), @@ -2311,7 +2311,7 @@ class RenderFractionalTranslation extends RenderProxyBox { /// The [translation] argument must not be null. RenderFractionalTranslation({ @required Offset translation, - this.transformHitTests: true, + this.transformHitTests = true, RenderBox child }) : assert(translation != null), _translation = translation, @@ -2421,7 +2421,7 @@ class RenderPointerListener extends RenderProxyBoxWithHitTestBehavior { this.onPointerMove, this.onPointerUp, this.onPointerCancel, - HitTestBehavior behavior: HitTestBehavior.deferToChild, + HitTestBehavior behavior = HitTestBehavior.deferToChild, RenderBox child }) : super(behavior: behavior, child: child); @@ -2566,7 +2566,7 @@ class RenderRepaintBoundary extends RenderProxyBox { /// /// * [OffsetLayer.toImage] for a similar API at the layer level. /// * [dart:ui.Scene.toImage] for more information about the image returned. - Future toImage({double pixelRatio: 1.0}) { + Future toImage({double pixelRatio = 1.0}) { assert(!debugNeedsPaint); return layer.toImage(Offset.zero & size, pixelRatio: pixelRatio); } @@ -2615,7 +2615,7 @@ class RenderRepaintBoundary extends RenderProxyBox { } @override - void debugRegisterRepaintBoundaryPaint({ bool includedParent: true, bool includedChild: false }) { + void debugRegisterRepaintBoundaryPaint({ bool includedParent = true, bool includedChild = false }) { assert(() { if (includedParent && includedChild) _debugSymmetricPaintCount += 1; @@ -2683,7 +2683,7 @@ class RenderIgnorePointer extends RenderProxyBox { /// render object will be ignored for semantics if [ignoring] is true. RenderIgnorePointer({ RenderBox child, - bool ignoring: true, + bool ignoring = true, bool ignoringSemantics }) : _ignoring = ignoring, _ignoringSemantics = ignoringSemantics, super(child) { assert(_ignoring != null); @@ -2756,7 +2756,7 @@ class RenderIgnorePointer extends RenderProxyBox { class RenderOffstage extends RenderProxyBox { /// Creates an offstage render object. RenderOffstage({ - bool offstage: true, + bool offstage = true, RenderBox child }) : assert(offstage != null), _offstage = offstage, @@ -2888,7 +2888,7 @@ class RenderAbsorbPointer extends RenderProxyBox { /// The [absorbing] argument must not be null. RenderAbsorbPointer({ RenderBox child, - this.absorbing: true + this.absorbing = true }) : assert(absorbing != null), super(child); @@ -2925,7 +2925,7 @@ class RenderMetaData extends RenderProxyBoxWithHitTestBehavior { /// The [behavior] argument defaults to [HitTestBehavior.deferToChild]. RenderMetaData({ this.metaData, - HitTestBehavior behavior: HitTestBehavior.deferToChild, + HitTestBehavior behavior = HitTestBehavior.deferToChild, RenderBox child }) : super(behavior: behavior, child: child); @@ -2951,7 +2951,7 @@ class RenderSemanticsGestureHandler extends RenderProxyBox { GestureLongPressCallback onLongPress, GestureDragUpdateCallback onHorizontalDragUpdate, GestureDragUpdateCallback onVerticalDragUpdate, - this.scrollFactor: 0.8 + this.scrollFactor = 0.8 }) : assert(scrollFactor != null), _onTap = onTap, _onLongPress = onLongPress, @@ -3129,7 +3129,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox { /// If the [label] is not null, the [textDirection] must also not be null. RenderSemanticsAnnotations({ RenderBox child, - bool container: false, + bool container = false, bool explicitChildNodes, bool enabled, bool checked, @@ -3958,7 +3958,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox { class RenderBlockSemantics extends RenderProxyBox { /// Create a render object that blocks semantics for nodes below it in paint /// order. - RenderBlockSemantics({ RenderBox child, bool blocking: true, }) : _blocking = blocking, super(child); + RenderBlockSemantics({ RenderBox child, bool blocking = true, }) : _blocking = blocking, super(child); /// Whether this render object is blocking semantics of previously painted /// [RenderObject]s below a common semantics boundary from the semantic tree. @@ -4016,7 +4016,7 @@ class RenderExcludeSemantics extends RenderProxyBox { /// Creates a render object that ignores the semantics of its subtree. RenderExcludeSemantics({ RenderBox child, - bool excluding: true, + bool excluding = true, }) : _excluding = excluding, super(child) { assert(_excluding != null); } @@ -4113,8 +4113,8 @@ class RenderFollowerLayer extends RenderProxyBox { /// The [link] and [offset] arguments must not be null. RenderFollowerLayer({ @required LayerLink link, - bool showWhenUnlinked: true, - Offset offset: Offset.zero, + bool showWhenUnlinked = true, + Offset offset = Offset.zero, RenderBox child, }) : assert(link != null), assert(showWhenUnlinked != null), diff --git a/packages/flutter/lib/src/rendering/shifted_box.dart b/packages/flutter/lib/src/rendering/shifted_box.dart index 3ffcc40257..3f27844dad 100644 --- a/packages/flutter/lib/src/rendering/shifted_box.dart +++ b/packages/flutter/lib/src/rendering/shifted_box.dart @@ -230,7 +230,7 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox { /// /// The [alignment] argument must not be null. RenderAligningShiftedBox({ - AlignmentGeometry alignment: Alignment.center, + AlignmentGeometry alignment = Alignment.center, @required TextDirection textDirection, RenderBox child, }) : assert(alignment != null), @@ -338,7 +338,7 @@ class RenderPositionedBox extends RenderAligningShiftedBox { RenderBox child, double widthFactor, double heightFactor, - AlignmentGeometry alignment: Alignment.center, + AlignmentGeometry alignment = Alignment.center, TextDirection textDirection, }) : assert(widthFactor == null || widthFactor >= 0.0), assert(heightFactor == null || heightFactor >= 0.0), @@ -492,7 +492,7 @@ class RenderConstrainedOverflowBox extends RenderAligningShiftedBox { double maxWidth, double minHeight, double maxHeight, - AlignmentGeometry alignment: Alignment.center, + AlignmentGeometry alignment = Alignment.center, TextDirection textDirection, }) : _minWidth = minWidth, _maxWidth = maxWidth, @@ -721,7 +721,7 @@ class RenderSizedOverflowBox extends RenderAligningShiftedBox { RenderSizedOverflowBox({ RenderBox child, @required Size requestedSize, - Alignment alignment: Alignment.center, + Alignment alignment = Alignment.center, TextDirection textDirection, }) : assert(requestedSize != null), _requestedSize = requestedSize, @@ -793,7 +793,7 @@ class RenderFractionallySizedOverflowBox extends RenderAligningShiftedBox { RenderBox child, double widthFactor, double heightFactor, - Alignment alignment: Alignment.center, + Alignment alignment = Alignment.center, TextDirection textDirection, }) : _widthFactor = widthFactor, _heightFactor = heightFactor, diff --git a/packages/flutter/lib/src/rendering/sliver.dart b/packages/flutter/lib/src/rendering/sliver.dart index 1014bc7d4f..de38ed8532 100644 --- a/packages/flutter/lib/src/rendering/sliver.dart +++ b/packages/flutter/lib/src/rendering/sliver.dart @@ -359,8 +359,8 @@ class SliverConstraints extends Constraints { /// /// Useful for slivers that have [RenderBox] children. BoxConstraints asBoxConstraints({ - double minExtent: 0.0, - double maxExtent: double.infinity, + double minExtent = 0.0, + double maxExtent = double.infinity, double crossAxisExtent, }) { crossAxisExtent ??= this.crossAxisExtent; @@ -385,7 +385,7 @@ class SliverConstraints extends Constraints { @override bool debugAssertIsValid({ - bool isAppliedConstraint: false, + bool isAppliedConstraint = false, InformationCollector informationCollector, }) { assert(() { @@ -487,15 +487,15 @@ class SliverGeometry extends Diagnosticable { /// /// The other arguments must not be null. const SliverGeometry({ - this.scrollExtent: 0.0, - this.paintExtent: 0.0, - this.paintOrigin: 0.0, + this.scrollExtent = 0.0, + this.paintExtent = 0.0, + this.paintOrigin = 0.0, double layoutExtent, - this.maxPaintExtent: 0.0, - this.maxScrollObstructionExtent: 0.0, + this.maxPaintExtent = 0.0, + this.maxScrollObstructionExtent = 0.0, double hitTestExtent, bool visible, - this.hasVisualOverflow: false, + this.hasVisualOverflow = false, this.scrollOffsetCorrection, double cacheExtent, }) : assert(scrollExtent != null), diff --git a/packages/flutter/lib/src/rendering/sliver_fill.dart b/packages/flutter/lib/src/rendering/sliver_fill.dart index 1b3c689714..9c680890f0 100644 --- a/packages/flutter/lib/src/rendering/sliver_fill.dart +++ b/packages/flutter/lib/src/rendering/sliver_fill.dart @@ -33,7 +33,7 @@ class RenderSliverFillViewport extends RenderSliverFixedExtentBoxAdaptor { /// The [childManager] argument must not be null. RenderSliverFillViewport({ @required RenderSliverBoxChildManager childManager, - double viewportFraction: 1.0, + double viewportFraction = 1.0, }) : assert(viewportFraction != null), assert(viewportFraction > 0.0), _viewportFraction = viewportFraction, diff --git a/packages/flutter/lib/src/rendering/sliver_grid.dart b/packages/flutter/lib/src/rendering/sliver_grid.dart index 45f663cd05..9d922cf48d 100644 --- a/packages/flutter/lib/src/rendering/sliver_grid.dart +++ b/packages/flutter/lib/src/rendering/sliver_grid.dart @@ -294,9 +294,9 @@ class SliverGridDelegateWithFixedCrossAxisCount extends SliverGridDelegate { /// and `childAspectRatio` arguments must be greater than zero. const SliverGridDelegateWithFixedCrossAxisCount({ @required this.crossAxisCount, - this.mainAxisSpacing: 0.0, - this.crossAxisSpacing: 0.0, - this.childAspectRatio: 1.0, + this.mainAxisSpacing = 0.0, + this.crossAxisSpacing = 0.0, + this.childAspectRatio = 1.0, }) : assert(crossAxisCount != null && crossAxisCount > 0), assert(mainAxisSpacing != null && mainAxisSpacing >= 0), assert(crossAxisSpacing != null && crossAxisSpacing >= 0), @@ -381,9 +381,9 @@ class SliverGridDelegateWithMaxCrossAxisExtent extends SliverGridDelegate { /// The [childAspectRatio] argument must be greater than zero. const SliverGridDelegateWithMaxCrossAxisExtent({ @required this.maxCrossAxisExtent, - this.mainAxisSpacing: 0.0, - this.crossAxisSpacing: 0.0, - this.childAspectRatio: 1.0, + this.mainAxisSpacing = 0.0, + this.crossAxisSpacing = 0.0, + this.childAspectRatio = 1.0, }) : assert(maxCrossAxisExtent != null && maxCrossAxisExtent >= 0), assert(mainAxisSpacing != null && mainAxisSpacing >= 0), assert(crossAxisSpacing != null && crossAxisSpacing >= 0), diff --git a/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart b/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart index a4f0ec638d..2273acc134 100644 --- a/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart +++ b/packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart @@ -315,7 +315,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver /// that call either, except for the one that is created and returned by /// `createChild`. @protected - bool addInitialChild({ int index: 0, double layoutOffset: 0.0 }) { + bool addInitialChild({ int index = 0, double layoutOffset = 0.0 }) { assert(_debugAssertChildListLocked()); assert(firstChild == null); _createOrObtainChild(index, after: null); @@ -345,7 +345,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver /// for the one that is created and returned by `createChild`. @protected RenderBox insertAndLayoutLeadingChild(BoxConstraints childConstraints, { - bool parentUsesSize: false, + bool parentUsesSize = false, }) { assert(_debugAssertChildListLocked()); final int index = indexOf(firstChild) - 1; @@ -373,7 +373,7 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver @protected RenderBox insertAndLayoutChild(BoxConstraints childConstraints, { @required RenderBox after, - bool parentUsesSize: false, + bool parentUsesSize = false, }) { assert(_debugAssertChildListLocked()); assert(after != null); diff --git a/packages/flutter/lib/src/rendering/sliver_persistent_header.dart b/packages/flutter/lib/src/rendering/sliver_persistent_header.dart index 325fa934db..b830f8c31d 100644 --- a/packages/flutter/lib/src/rendering/sliver_persistent_header.dart +++ b/packages/flutter/lib/src/rendering/sliver_persistent_header.dart @@ -117,7 +117,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje /// /// The `overlapsContent` argument is passed to [updateChild]. @protected - void layoutChild(double scrollOffset, double maxExtent, { bool overlapsContent: false }) { + void layoutChild(double scrollOffset, double maxExtent, { bool overlapsContent = false }) { assert(maxExtent != null); final double shrinkOffset = math.min(scrollOffset, maxExtent); if (_needsUpdateChild || _lastShrinkOffset != shrinkOffset || _lastOverlapsContent != overlapsContent) { @@ -324,8 +324,8 @@ class FloatingHeaderSnapConfiguration { /// (animated) into or out of view. FloatingHeaderSnapConfiguration({ @required this.vsync, - this.curve: Curves.ease, - this.duration: const Duration(milliseconds: 300), + this.curve = Curves.ease, + this.duration = const Duration(milliseconds: 300), }) : assert(vsync != null), assert(curve != null), assert(duration != null); diff --git a/packages/flutter/lib/src/rendering/stack.dart b/packages/flutter/lib/src/rendering/stack.dart index 328299e2e9..c28dea6d4e 100644 --- a/packages/flutter/lib/src/rendering/stack.dart +++ b/packages/flutter/lib/src/rendering/stack.dart @@ -340,10 +340,10 @@ class RenderStack extends RenderBox /// top left corners. RenderStack({ List children, - AlignmentGeometry alignment: AlignmentDirectional.topStart, + AlignmentGeometry alignment = AlignmentDirectional.topStart, TextDirection textDirection, - StackFit fit: StackFit.loose, - Overflow overflow: Overflow.clip, + StackFit fit = StackFit.loose, + Overflow overflow = Overflow.clip, }) : assert(alignment != null), assert(fit != null), assert(overflow != null), @@ -637,9 +637,9 @@ class RenderIndexedStack extends RenderStack { /// If the [index] parameter is null, nothing is displayed. RenderIndexedStack({ List children, - AlignmentGeometry alignment: AlignmentDirectional.topStart, + AlignmentGeometry alignment = AlignmentDirectional.topStart, TextDirection textDirection, - int index: 0, + int index = 0, }) : _index = index, super( children: children, alignment: alignment, diff --git a/packages/flutter/lib/src/rendering/table.dart b/packages/flutter/lib/src/rendering/table.dart index 722e5ac20d..e697033130 100644 --- a/packages/flutter/lib/src/rendering/table.dart +++ b/packages/flutter/lib/src/rendering/table.dart @@ -361,13 +361,13 @@ class RenderTable extends RenderBox { int columns, int rows, Map columnWidths, - TableColumnWidth defaultColumnWidth: const FlexColumnWidth(1.0), + TableColumnWidth defaultColumnWidth = const FlexColumnWidth(1.0), @required TextDirection textDirection, TableBorder border, List rowDecorations, - ImageConfiguration configuration: ImageConfiguration.empty, + ImageConfiguration configuration = ImageConfiguration.empty, Decoration defaultRowDecoration, - TableCellVerticalAlignment defaultVerticalAlignment: TableCellVerticalAlignment.top, + TableCellVerticalAlignment defaultVerticalAlignment = TableCellVerticalAlignment.top, TextBaseline textBaseline, List> children }) : assert(columns == null || columns >= 0), diff --git a/packages/flutter/lib/src/rendering/table_border.dart b/packages/flutter/lib/src/rendering/table_border.dart index 1a701f38fa..b1a81b9d3e 100644 --- a/packages/flutter/lib/src/rendering/table_border.dart +++ b/packages/flutter/lib/src/rendering/table_border.dart @@ -17,21 +17,21 @@ class TableBorder { /// /// All the sides of the border default to [BorderSide.none]. const TableBorder({ - this.top: BorderSide.none, - this.right: BorderSide.none, - this.bottom: BorderSide.none, - this.left: BorderSide.none, - this.horizontalInside: BorderSide.none, - this.verticalInside: BorderSide.none, + this.top = BorderSide.none, + this.right = BorderSide.none, + this.bottom = BorderSide.none, + this.left = BorderSide.none, + this.horizontalInside = BorderSide.none, + this.verticalInside = BorderSide.none, }); /// A uniform border with all sides the same color and width. /// /// The sides default to black solid borders, one logical pixel wide. factory TableBorder.all({ - Color color: const Color(0xFF000000), - double width: 1.0, - BorderStyle style: BorderStyle.solid, + Color color = const Color(0xFF000000), + double width = 1.0, + BorderStyle style = BorderStyle.solid, }) { final BorderSide side = new BorderSide(color: color, width: width, style: style); return new TableBorder(top: side, right: side, bottom: side, left: side, horizontalInside: side, verticalInside: side); @@ -40,8 +40,8 @@ class TableBorder { /// Creates a border for a table where all the interior sides use the same /// styling and all the exterior sides use the same styling. factory TableBorder.symmetric({ - BorderSide inside: BorderSide.none, - BorderSide outside: BorderSide.none, + BorderSide inside = BorderSide.none, + BorderSide outside = BorderSide.none, }) { return new TableBorder( top: outside, diff --git a/packages/flutter/lib/src/rendering/view.dart b/packages/flutter/lib/src/rendering/view.dart index d4d10bcadf..268773b3d7 100644 --- a/packages/flutter/lib/src/rendering/view.dart +++ b/packages/flutter/lib/src/rendering/view.dart @@ -22,8 +22,8 @@ class ViewConfiguration { /// /// By default, the view has zero [size] and a [devicePixelRatio] of 1.0. const ViewConfiguration({ - this.size: Size.zero, - this.devicePixelRatio: 1.0, + this.size = Size.zero, + this.devicePixelRatio = 1.0, }); /// The size of the output surface. diff --git a/packages/flutter/lib/src/rendering/viewport.dart b/packages/flutter/lib/src/rendering/viewport.dart index 052d816bd4..56802b11ed 100644 --- a/packages/flutter/lib/src/rendering/viewport.dart +++ b/packages/flutter/lib/src/rendering/viewport.dart @@ -87,7 +87,7 @@ abstract class RenderViewportBase children, RenderSliver center, double cacheExtent, @@ -1384,7 +1384,7 @@ class RenderShrinkWrappingViewport extends RenderViewportBase children, diff --git a/packages/flutter/lib/src/rendering/wrap.dart b/packages/flutter/lib/src/rendering/wrap.dart index cc1ae3b26e..6a1116a745 100644 --- a/packages/flutter/lib/src/rendering/wrap.dart +++ b/packages/flutter/lib/src/rendering/wrap.dart @@ -109,14 +109,14 @@ class RenderWrap extends RenderBox with ContainerRenderObjectMixin children, - Axis direction: Axis.horizontal, - WrapAlignment alignment: WrapAlignment.start, - double spacing: 0.0, - WrapAlignment runAlignment: WrapAlignment.start, - double runSpacing: 0.0, - WrapCrossAlignment crossAxisAlignment: WrapCrossAlignment.start, + Axis direction = Axis.horizontal, + WrapAlignment alignment = WrapAlignment.start, + double spacing = 0.0, + WrapAlignment runAlignment = WrapAlignment.start, + double runSpacing = 0.0, + WrapCrossAlignment crossAxisAlignment = WrapCrossAlignment.start, TextDirection textDirection, - VerticalDirection verticalDirection: VerticalDirection.down, + VerticalDirection verticalDirection = VerticalDirection.down, }) : assert(direction != null), assert(alignment != null), assert(spacing != null), diff --git a/packages/flutter/lib/src/scheduler/binding.dart b/packages/flutter/lib/src/scheduler/binding.dart index 8fab34926e..c3846481e2 100644 --- a/packages/flutter/lib/src/scheduler/binding.dart +++ b/packages/flutter/lib/src/scheduler/binding.dart @@ -86,7 +86,7 @@ class _TaskEntry { } class _FrameCallbackEntry { - _FrameCallbackEntry(this.callback, { bool rescheduling: false }) { + _FrameCallbackEntry(this.callback, { bool rescheduling = false }) { assert(() { if (rescheduling) { assert(() { @@ -420,7 +420,7 @@ abstract class SchedulerBinding extends BindingBase with ServicesBinding { /// /// Callbacks registered with this method can be canceled using /// [cancelFrameCallbackWithId]. - int scheduleFrameCallback(FrameCallback callback, { bool rescheduling: false }) { + int scheduleFrameCallback(FrameCallback callback, { bool rescheduling = false }) { scheduleFrame(); _nextFrameCallbackId += 1; _transientCallbacks[_nextFrameCallbackId] = new _FrameCallbackEntry(callback, rescheduling: rescheduling); diff --git a/packages/flutter/lib/src/scheduler/ticker.dart b/packages/flutter/lib/src/scheduler/ticker.dart index 3832dce1dc..613283e859 100644 --- a/packages/flutter/lib/src/scheduler/ticker.dart +++ b/packages/flutter/lib/src/scheduler/ticker.dart @@ -178,7 +178,7 @@ class Ticker { /// /// By convention, this method is used by the object that receives the ticks /// (as opposed to the [TickerProvider] which created the ticker). - void stop({ bool canceled: false }) { + void stop({ bool canceled = false }) { if (!isActive) return; @@ -238,7 +238,7 @@ class Ticker { /// /// This should only be called if [shouldScheduleTick] is true. @protected - void scheduleTick({ bool rescheduling: false }) { + void scheduleTick({ bool rescheduling = false }) { assert(!scheduled); assert(shouldScheduleTick); _animationId = SchedulerBinding.instance.scheduleFrameCallback(_tick, rescheduling: rescheduling); @@ -312,7 +312,7 @@ class Ticker { StackTrace _debugCreationStack; @override - String toString({ bool debugIncludeStack: false }) { + String toString({ bool debugIncludeStack = false }) { final StringBuffer buffer = new StringBuffer(); buffer.write('$runtimeType('); assert(() { diff --git a/packages/flutter/lib/src/semantics/semantics.dart b/packages/flutter/lib/src/semantics/semantics.dart index fd410f8eb4..cef05c6938 100644 --- a/packages/flutter/lib/src/semantics/semantics.dart +++ b/packages/flutter/lib/src/semantics/semantics.dart @@ -1520,10 +1520,10 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { /// controlled by the [childOrder] parameter. @override String toStringDeep({ - String prefixLineOne: '', + String prefixLineOne = '', String prefixOtherLines, - DiagnosticLevel minLevel: DiagnosticLevel.debug, - DebugSemanticsDumpOrder childOrder: DebugSemanticsDumpOrder.traversalOrder, + DiagnosticLevel minLevel = DiagnosticLevel.debug, + DebugSemanticsDumpOrder childOrder = DebugSemanticsDumpOrder.traversalOrder, }) { assert(childOrder != null); return toDiagnosticsNode(childOrder: childOrder).toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines, minLevel: minLevel); @@ -1532,8 +1532,8 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { @override DiagnosticsNode toDiagnosticsNode({ String name, - DiagnosticsTreeStyle style: DiagnosticsTreeStyle.sparse, - DebugSemanticsDumpOrder childOrder: DebugSemanticsDumpOrder.traversalOrder, + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.sparse, + DebugSemanticsDumpOrder childOrder = DebugSemanticsDumpOrder.traversalOrder, }) { return new _SemanticsDiagnosticableNode( name: name, @@ -1544,7 +1544,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { } @override - List debugDescribeChildren({ DebugSemanticsDumpOrder childOrder: DebugSemanticsDumpOrder.inverseHitTest }) { + List debugDescribeChildren({ DebugSemanticsDumpOrder childOrder = DebugSemanticsDumpOrder.inverseHitTest }) { return debugListChildrenInOrder(childOrder) .map((SemanticsNode node) => node.toDiagnosticsNode(childOrder: childOrder)) .toList(); diff --git a/packages/flutter/lib/src/services/asset_bundle.dart b/packages/flutter/lib/src/services/asset_bundle.dart index eb1135085f..3ae203d415 100644 --- a/packages/flutter/lib/src/services/asset_bundle.dart +++ b/packages/flutter/lib/src/services/asset_bundle.dart @@ -63,7 +63,7 @@ abstract class AssetBundle { /// caller is going to be doing its own caching. (It might not be cached if /// it's set to true either, that depends on the asset bundle /// implementation.) - Future loadString(String key, { bool cache: true }) async { + Future loadString(String key, { bool cache = true }) async { final ByteData data = await load(key); if (data == null) throw new FlutterError('Unable to load asset: $key'); @@ -157,7 +157,7 @@ abstract class CachingAssetBundle extends AssetBundle { final Map> _structuredDataCache = >{}; @override - Future loadString(String key, { bool cache: true }) { + Future loadString(String key, { bool cache = true }) { if (cache) return _stringCache.putIfAbsent(key, () => super.loadString(key)); return super.loadString(key); diff --git a/packages/flutter/lib/src/services/raw_keyboard.dart b/packages/flutter/lib/src/services/raw_keyboard.dart index 7d831dc1cd..2d3e721d65 100644 --- a/packages/flutter/lib/src/services/raw_keyboard.dart +++ b/packages/flutter/lib/src/services/raw_keyboard.dart @@ -41,11 +41,11 @@ class RawKeyEventDataAndroid extends RawKeyEventData { /// The [flags], [codePoint], [keyCode], [scanCode], and [metaState] arguments /// must not be null. const RawKeyEventDataAndroid({ - this.flags: 0, - this.codePoint: 0, - this.keyCode: 0, - this.scanCode: 0, - this.metaState: 0, + this.flags = 0, + this.codePoint = 0, + this.keyCode = 0, + this.scanCode = 0, + this.metaState = 0, }) : assert(flags != null), assert(codePoint != null), assert(keyCode != null), @@ -81,9 +81,9 @@ class RawKeyEventDataFuchsia extends RawKeyEventData { /// /// The [hidUsage], [codePoint], and [modifiers] arguments must not be null. const RawKeyEventDataFuchsia({ - this.hidUsage: 0, - this.codePoint: 0, - this.modifiers: 0, + this.hidUsage = 0, + this.codePoint = 0, + this.modifiers = 0, }) : assert(hidUsage != null), assert(codePoint != null), assert(modifiers != null); diff --git a/packages/flutter/lib/src/services/text_editing.dart b/packages/flutter/lib/src/services/text_editing.dart index dee4bff5eb..da5890e662 100644 --- a/packages/flutter/lib/src/services/text_editing.dart +++ b/packages/flutter/lib/src/services/text_editing.dart @@ -102,8 +102,8 @@ class TextSelection extends TextRange { const TextSelection({ @required this.baseOffset, @required this.extentOffset, - this.affinity: TextAffinity.downstream, - this.isDirectional: false + this.affinity = TextAffinity.downstream, + this.isDirectional = false }) : super( start: baseOffset < extentOffset ? baseOffset : extentOffset, end: baseOffset < extentOffset ? extentOffset : baseOffset @@ -118,7 +118,7 @@ class TextSelection extends TextRange { /// The [offset] argument must not be null. const TextSelection.collapsed({ @required int offset, - this.affinity: TextAffinity.downstream + this.affinity = TextAffinity.downstream }) : baseOffset = offset, extentOffset = offset, isDirectional = false, super.collapsed(offset); /// Creates a collapsed selection at the given text position. diff --git a/packages/flutter/lib/src/services/text_formatter.dart b/packages/flutter/lib/src/services/text_formatter.dart index f9dd70a729..2c13b01ceb 100644 --- a/packages/flutter/lib/src/services/text_formatter.dart +++ b/packages/flutter/lib/src/services/text_formatter.dart @@ -95,7 +95,7 @@ class BlacklistingTextInputFormatter extends TextInputFormatter { /// The [blacklistedPattern] must not be null. BlacklistingTextInputFormatter( this.blacklistedPattern, { - this.replacementString: '', + this.replacementString = '', }) : assert(blacklistedPattern != null); /// A [Pattern] to match and replace incoming [TextEditingValue]s. diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart index a3c7ed98cb..18cb2fef69 100644 --- a/packages/flutter/lib/src/services/text_input.dart +++ b/packages/flutter/lib/src/services/text_input.dart @@ -28,8 +28,8 @@ class TextInputType { /// Requests a numeric keyboard with additional settings. /// The [signed] and [decimal] parameters are optional. const TextInputType.numberWithOptions({ - this.signed: false, - this.decimal: false, + this.signed = false, + this.decimal = false, }) : index = 2; /// Enum value index, corresponds to one of the [values]. @@ -155,11 +155,11 @@ class TextInputConfiguration { /// All arguments have default values, except [actionLabel]. Only /// [actionLabel] may be null. const TextInputConfiguration({ - this.inputType: TextInputType.text, - this.obscureText: false, - this.autocorrect: true, + this.inputType = TextInputType.text, + this.obscureText = false, + this.autocorrect = true, this.actionLabel, - this.inputAction: TextInputAction.done, + this.inputAction = TextInputAction.done, }) : assert(inputType != null), assert(obscureText != null), assert(autocorrect != null), @@ -216,9 +216,9 @@ class TextEditingValue { /// The [text], [selection], and [composing] arguments must not be null but /// each have default values. const TextEditingValue({ - this.text: '', - this.selection: const TextSelection.collapsed(offset: -1), - this.composing: TextRange.empty + this.text = '', + this.selection = const TextSelection.collapsed(offset: -1), + this.composing = TextRange.empty }) : assert(text != null), assert(selection != null), assert(composing != null); diff --git a/packages/flutter/lib/src/widgets/animated_cross_fade.dart b/packages/flutter/lib/src/widgets/animated_cross_fade.dart index afd275d593..a501589a4b 100644 --- a/packages/flutter/lib/src/widgets/animated_cross_fade.dart +++ b/packages/flutter/lib/src/widgets/animated_cross_fade.dart @@ -113,13 +113,13 @@ class AnimatedCrossFade extends StatefulWidget { Key key, @required this.firstChild, @required this.secondChild, - this.firstCurve: Curves.linear, - this.secondCurve: Curves.linear, - this.sizeCurve: Curves.linear, - this.alignment: Alignment.topCenter, + this.firstCurve = Curves.linear, + this.secondCurve = Curves.linear, + this.sizeCurve = Curves.linear, + this.alignment = Alignment.topCenter, @required this.crossFadeState, @required this.duration, - this.layoutBuilder: defaultLayoutBuilder, + this.layoutBuilder = defaultLayoutBuilder, }) : assert(firstChild != null), assert(secondChild != null), assert(firstCurve != null), diff --git a/packages/flutter/lib/src/widgets/animated_list.dart b/packages/flutter/lib/src/widgets/animated_list.dart index e3389317fc..9833e0dd7f 100644 --- a/packages/flutter/lib/src/widgets/animated_list.dart +++ b/packages/flutter/lib/src/widgets/animated_list.dart @@ -48,13 +48,13 @@ class AnimatedList extends StatefulWidget { const AnimatedList({ Key key, @required this.itemBuilder, - this.initialItemCount: 0, - this.scrollDirection: Axis.vertical, - this.reverse: false, + this.initialItemCount = 0, + this.scrollDirection = Axis.vertical, + this.reverse = false, this.controller, this.primary, this.physics, - this.shrinkWrap: false, + this.shrinkWrap = false, this.padding, }) : assert(itemBuilder != null), assert(initialItemCount != null && initialItemCount >= 0), @@ -159,7 +159,7 @@ class AnimatedList extends StatefulWidget { /// ```dart /// AnimatedListState animatedList = AnimatedList.of(context); /// ``` - static AnimatedListState of(BuildContext context, { bool nullOk: false }) { + static AnimatedListState of(BuildContext context, { bool nullOk = false }) { assert(context != null); assert(nullOk != null); final AnimatedListState result = context.ancestorStateOfType(const TypeMatcher()); @@ -270,7 +270,7 @@ class AnimatedListState extends State with TickerProviderStateMixi /// This method's semantics are the same as Dart's [List.insert] method: /// it increases the length of the list by one and shifts all items at or /// after [index] towards the end of the list. - void insertItem(int index, { Duration duration: _kDuration }) { + void insertItem(int index, { Duration duration = _kDuration }) { assert(index != null && index >= 0); assert(duration != null); @@ -313,7 +313,7 @@ class AnimatedListState extends State with TickerProviderStateMixi /// This method's semantics are the same as Dart's [List.remove] method: /// it decreases the length of the list by one and shifts all items at or /// before [index] towards the beginning of the list. - void removeItem(int index, AnimatedListRemovedItemBuilder builder, { Duration duration: _kDuration }) { + void removeItem(int index, AnimatedListRemovedItemBuilder builder, { Duration duration = _kDuration }) { assert(index != null && index >= 0); assert(builder != null); assert(duration != null); diff --git a/packages/flutter/lib/src/widgets/animated_size.dart b/packages/flutter/lib/src/widgets/animated_size.dart index 08ad69bc6e..4f1a1b13fd 100644 --- a/packages/flutter/lib/src/widgets/animated_size.dart +++ b/packages/flutter/lib/src/widgets/animated_size.dart @@ -17,8 +17,8 @@ class AnimatedSize extends SingleChildRenderObjectWidget { const AnimatedSize({ Key key, Widget child, - this.alignment: Alignment.center, - this.curve: Curves.linear, + this.alignment = Alignment.center, + this.curve = Curves.linear, @required this.duration, @required this.vsync, }) : super(key: key, child: child); diff --git a/packages/flutter/lib/src/widgets/animated_switcher.dart b/packages/flutter/lib/src/widgets/animated_switcher.dart index ce7bfa7457..4d96c48f0d 100644 --- a/packages/flutter/lib/src/widgets/animated_switcher.dart +++ b/packages/flutter/lib/src/widgets/animated_switcher.dart @@ -136,10 +136,10 @@ class AnimatedSwitcher extends StatefulWidget { Key key, this.child, @required this.duration, - this.switchInCurve: Curves.linear, - this.switchOutCurve: Curves.linear, - this.transitionBuilder: AnimatedSwitcher.defaultTransitionBuilder, - this.layoutBuilder: AnimatedSwitcher.defaultLayoutBuilder, + this.switchInCurve = Curves.linear, + this.switchOutCurve = Curves.linear, + this.transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder, + this.layoutBuilder = AnimatedSwitcher.defaultLayoutBuilder, }) : assert(duration != null), assert(switchInCurve != null), assert(switchOutCurve != null), diff --git a/packages/flutter/lib/src/widgets/app.dart b/packages/flutter/lib/src/widgets/app.dart index 873f98bfb9..3611ccc825 100644 --- a/packages/flutter/lib/src/widgets/app.dart +++ b/packages/flutter/lib/src/widgets/app.dart @@ -72,23 +72,23 @@ class WidgetsApp extends StatefulWidget { this.navigatorKey, this.onGenerateRoute, this.onUnknownRoute, - this.navigatorObservers: const [], + this.navigatorObservers = const [], this.initialRoute, this.builder, - this.title: '', + this.title = '', this.onGenerateTitle, this.textStyle, @required this.color, this.locale, this.localizationsDelegates, this.localeResolutionCallback, - this.supportedLocales: const [const Locale('en', 'US')], - this.showPerformanceOverlay: false, - this.checkerboardRasterCacheImages: false, - this.checkerboardOffscreenLayers: false, - this.showSemanticsDebugger: false, - this.debugShowWidgetInspector: false, - this.debugShowCheckedModeBanner: true, + this.supportedLocales = const [const Locale('en', 'US')], + this.showPerformanceOverlay = false, + this.checkerboardRasterCacheImages = false, + this.checkerboardOffscreenLayers = false, + this.showSemanticsDebugger = false, + this.debugShowWidgetInspector = false, + this.debugShowCheckedModeBanner = true, this.inspectorSelectButtonBuilder, }) : assert(navigatorObservers != null), assert(onGenerateRoute != null || navigatorKey == null), diff --git a/packages/flutter/lib/src/widgets/banner.dart b/packages/flutter/lib/src/widgets/banner.dart index f7f406e72d..ee959b2afb 100644 --- a/packages/flutter/lib/src/widgets/banner.dart +++ b/packages/flutter/lib/src/widgets/banner.dart @@ -63,8 +63,8 @@ class BannerPainter extends CustomPainter { @required this.textDirection, @required this.location, @required this.layoutDirection, - this.color: _kColor, - this.textStyle: _kTextStyle, + this.color = _kColor, + this.textStyle = _kTextStyle, }) : assert(message != null), assert(textDirection != null), assert(location != null), @@ -249,8 +249,8 @@ class Banner extends StatelessWidget { this.textDirection, @required this.location, this.layoutDirection, - this.color: _kColor, - this.textStyle: _kTextStyle, + this.color = _kColor, + this.textStyle = _kTextStyle, }) : assert(message != null), assert(location != null), assert(color != null), diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 18567704ba..cea1d5dded 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -223,7 +223,7 @@ class ShaderMask extends SingleChildRenderObjectWidget { const ShaderMask({ Key key, @required this.shaderCallback, - this.blendMode: BlendMode.modulate, + this.blendMode = BlendMode.modulate, Widget child }) : assert(shaderCallback != null), assert(blendMode != null), @@ -354,9 +354,9 @@ class CustomPaint extends SingleChildRenderObjectWidget { Key key, this.painter, this.foregroundPainter, - this.size: Size.zero, - this.isComplex: false, - this.willChange: false, + this.size = Size.zero, + this.isComplex = false, + this.willChange = false, Widget child, }) : assert(size != null), assert(isComplex != null), @@ -663,11 +663,11 @@ class PhysicalModel extends SingleChildRenderObjectWidget { /// The [shape], [elevation], [color], and [shadowColor] must not be null. const PhysicalModel({ Key key, - this.shape: BoxShape.rectangle, + this.shape = BoxShape.rectangle, this.borderRadius, - this.elevation: 0.0, + this.elevation = 0.0, @required this.color, - this.shadowColor: const Color(0xFF000000), + this.shadowColor = const Color(0xFF000000), Widget child, }) : assert(shape != null), assert(elevation != null), @@ -747,9 +747,9 @@ class PhysicalShape extends SingleChildRenderObjectWidget { const PhysicalShape({ Key key, @required this.clipper, - this.elevation: 0.0, + this.elevation = 0.0, @required this.color, - this.shadowColor: const Color(0xFF000000), + this.shadowColor = const Color(0xFF000000), Widget child, }) : assert(clipper != null), assert(elevation != null), @@ -843,7 +843,7 @@ class Transform extends SingleChildRenderObjectWidget { @required this.transform, this.origin, this.alignment, - this.transformHitTests: true, + this.transformHitTests = true, Widget child, }) : assert(transform != null), super(key: key, child: child); @@ -873,8 +873,8 @@ class Transform extends SingleChildRenderObjectWidget { Key key, @required double angle, this.origin, - this.alignment: Alignment.center, - this.transformHitTests: true, + this.alignment = Alignment.center, + this.transformHitTests = true, Widget child, }) : transform = new Matrix4.rotationZ(angle), super(key: key, child: child); @@ -900,7 +900,7 @@ class Transform extends SingleChildRenderObjectWidget { Transform.translate({ Key key, @required Offset offset, - this.transformHitTests: true, + this.transformHitTests = true, Widget child, }) : transform = new Matrix4.translationValues(offset.dx, offset.dy, 0.0), origin = null, @@ -934,8 +934,8 @@ class Transform extends SingleChildRenderObjectWidget { Key key, @required double scale, this.origin, - this.alignment: Alignment.center, - this.transformHitTests: true, + this.alignment = Alignment.center, + this.transformHitTests = true, Widget child, }) : transform = new Matrix4.diagonal3Values(scale, scale, 1.0), super(key: key, child: child); @@ -1075,8 +1075,8 @@ class CompositedTransformFollower extends SingleChildRenderObjectWidget { const CompositedTransformFollower({ Key key, @required this.link, - this.showWhenUnlinked: true, - this.offset: Offset.zero, + this.showWhenUnlinked = true, + this.offset = Offset.zero, Widget child, }) : assert(link != null), assert(showWhenUnlinked != null), @@ -1135,8 +1135,8 @@ class FittedBox extends SingleChildRenderObjectWidget { /// The [fit] and [alignment] arguments must not be null. const FittedBox({ Key key, - this.fit: BoxFit.contain, - this.alignment: Alignment.center, + this.fit = BoxFit.contain, + this.alignment = Alignment.center, Widget child, }) : assert(fit != null), assert(alignment != null), @@ -1210,7 +1210,7 @@ class FractionalTranslation extends SingleChildRenderObjectWidget { const FractionalTranslation({ Key key, @required this.translation, - this.transformHitTests: true, + this.transformHitTests = true, Widget child, }) : assert(translation != null), super(key: key, child: child); @@ -1396,7 +1396,7 @@ class Align extends SingleChildRenderObjectWidget { /// The alignment defaults to [Alignment.center]. const Align({ Key key, - this.alignment: Alignment.center, + this.alignment = Alignment.center, this.widthFactor, this.heightFactor, Widget child @@ -1601,7 +1601,7 @@ class CustomMultiChildLayout extends MultiChildRenderObjectWidget { CustomMultiChildLayout({ Key key, @required this.delegate, - List children: const [], + List children = const [], }) : assert(delegate != null), super(key: key, children: children); @@ -1814,7 +1814,7 @@ class UnconstrainedBox extends SingleChildRenderObjectWidget { Key key, Widget child, this.textDirection, - this.alignment: Alignment.center, + this.alignment = Alignment.center, this.constrainedAxis, }) : assert(alignment != null), super(key: key, child: child); @@ -1885,7 +1885,7 @@ class FractionallySizedBox extends SingleChildRenderObjectWidget { /// non-negative. const FractionallySizedBox({ Key key, - this.alignment: Alignment.center, + this.alignment = Alignment.center, this.widthFactor, this.heightFactor, Widget child, @@ -1990,8 +1990,8 @@ class LimitedBox extends SingleChildRenderObjectWidget { /// negative. const LimitedBox({ Key key, - this.maxWidth: double.infinity, - this.maxHeight: double.infinity, + this.maxWidth = double.infinity, + this.maxHeight = double.infinity, Widget child, }) : assert(maxWidth != null && maxWidth >= 0.0), assert(maxHeight != null && maxHeight >= 0.0), @@ -2047,7 +2047,7 @@ class OverflowBox extends SingleChildRenderObjectWidget { /// Creates a widget that lets its child overflow itself. const OverflowBox({ Key key, - this.alignment: Alignment.center, + this.alignment = Alignment.center, this.minWidth, this.maxWidth, this.minHeight, @@ -2145,7 +2145,7 @@ class SizedOverflowBox extends SingleChildRenderObjectWidget { const SizedOverflowBox({ Key key, @required this.size, - this.alignment: Alignment.center, + this.alignment = Alignment.center, Widget child, }) : assert(size != null), assert(alignment != null), @@ -2217,7 +2217,7 @@ class SizedOverflowBox extends SingleChildRenderObjectWidget { /// * [TickerMode], which can be used to disable animations in a subtree. class Offstage extends SingleChildRenderObjectWidget { /// Creates a widget that visually hides its child. - const Offstage({ Key key, this.offstage: true, Widget child }) + const Offstage({ Key key, this.offstage = true, Widget child }) : assert(offstage != null), super(key: key, child: child); @@ -2598,9 +2598,9 @@ class ListBody extends MultiChildRenderObjectWidget { /// By default, the [mainAxis] is [Axis.vertical]. ListBody({ Key key, - this.mainAxis: Axis.vertical, - this.reverse: false, - List children: const [], + this.mainAxis = Axis.vertical, + this.reverse = false, + List children = const [], }) : assert(mainAxis != null), super(key: key, children: children); @@ -2684,11 +2684,11 @@ class Stack extends MultiChildRenderObjectWidget { /// top left corners. Stack({ Key key, - this.alignment: AlignmentDirectional.topStart, + this.alignment = AlignmentDirectional.topStart, this.textDirection, - this.fit: StackFit.loose, - this.overflow: Overflow.clip, - List children: const [], + this.fit = StackFit.loose, + this.overflow = Overflow.clip, + List children = const [], }) : super(key: key, children: children); /// How to align the non-positioned and partially-positioned children in the @@ -2778,11 +2778,11 @@ class IndexedStack extends Stack { /// The [index] argument must not be null. IndexedStack({ Key key, - AlignmentGeometry alignment: AlignmentDirectional.topStart, + AlignmentGeometry alignment = AlignmentDirectional.topStart, TextDirection textDirection, - StackFit sizing: StackFit.loose, - this.index: 0, - List children: const [], + StackFit sizing = StackFit.loose, + this.index = 0, + List children = const [], }) : super(key: key, alignment: alignment, textDirection: textDirection, fit: sizing, children: children); /// The index of the child to show. @@ -2898,10 +2898,10 @@ class Positioned extends ParentDataWidget { /// to 0.0 unless a value for them is passed. const Positioned.fill({ Key key, - this.left: 0.0, - this.top: 0.0, - this.right: 0.0, - this.bottom: 0.0, + this.left = 0.0, + this.top = 0.0, + this.right = 0.0, + this.bottom = 0.0, @required Widget child, }) : width = null, height = null, @@ -3263,13 +3263,13 @@ class Flex extends MultiChildRenderObjectWidget { Flex({ Key key, @required this.direction, - this.mainAxisAlignment: MainAxisAlignment.start, - this.mainAxisSize: MainAxisSize.max, - this.crossAxisAlignment: CrossAxisAlignment.center, + this.mainAxisAlignment = MainAxisAlignment.start, + this.mainAxisSize = MainAxisSize.max, + this.crossAxisAlignment = CrossAxisAlignment.center, this.textDirection, - this.verticalDirection: VerticalDirection.down, + this.verticalDirection = VerticalDirection.down, this.textBaseline, - List children: const [], + List children = const [], }) : assert(direction != null), assert(mainAxisAlignment != null), assert(mainAxisSize != null), @@ -3594,13 +3594,13 @@ class Row extends Flex { /// must not be null. Row({ Key key, - MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start, - MainAxisSize mainAxisSize: MainAxisSize.max, - CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center, + MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, + MainAxisSize mainAxisSize = MainAxisSize.max, + CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, TextDirection textDirection, - VerticalDirection verticalDirection: VerticalDirection.down, + VerticalDirection verticalDirection = VerticalDirection.down, TextBaseline textBaseline, - List children: const [], + List children = const [], }) : super( children: children, key: key, @@ -3787,13 +3787,13 @@ class Column extends Flex { /// [crossAxisAlignment], the [textDirection] must not be null. Column({ Key key, - MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start, - MainAxisSize mainAxisSize: MainAxisSize.max, - CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center, + MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, + MainAxisSize mainAxisSize = MainAxisSize.max, + CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, TextDirection textDirection, - VerticalDirection verticalDirection: VerticalDirection.down, + VerticalDirection verticalDirection = VerticalDirection.down, TextBaseline textBaseline, - List children: const [], + List children = const [], }) : super( children: children, key: key, @@ -3830,8 +3830,8 @@ class Flexible extends ParentDataWidget { /// flexes. const Flexible({ Key key, - this.flex: 1, - this.fit: FlexFit.loose, + this.flex = 1, + this.fit = FlexFit.loose, @required Widget child, }) : super(key: key, child: child); @@ -3904,7 +3904,7 @@ class Expanded extends Flexible { /// expand to fill the available space in the main axis. const Expanded({ Key key, - int flex: 1, + int flex = 1, @required Widget child, }) : super(key: key, flex: flex, fit: FlexFit.tight, child: child); } @@ -3971,15 +3971,15 @@ class Wrap extends MultiChildRenderObjectWidget { /// directions, the [textDirection] must not be null. Wrap({ Key key, - this.direction: Axis.horizontal, - this.alignment: WrapAlignment.start, - this.spacing: 0.0, - this.runAlignment: WrapAlignment.start, - this.runSpacing: 0.0, - this.crossAxisAlignment: WrapCrossAlignment.start, + this.direction = Axis.horizontal, + this.alignment = WrapAlignment.start, + this.spacing = 0.0, + this.runAlignment = WrapAlignment.start, + this.runSpacing = 0.0, + this.crossAxisAlignment = WrapCrossAlignment.start, this.textDirection, - this.verticalDirection: VerticalDirection.down, - List children: const [], + this.verticalDirection = VerticalDirection.down, + List children = const [], }) : super(key: key, children: children); /// The direction to use as the main axis. @@ -4199,7 +4199,7 @@ class Flow extends MultiChildRenderObjectWidget { Flow({ Key key, @required this.delegate, - List children: const [], + List children = const [], }) : assert(delegate != null), super(key: key, children: RepaintBoundary.wrapAll(children)); // https://github.com/dart-lang/sdk/issues/29277 @@ -4214,7 +4214,7 @@ class Flow extends MultiChildRenderObjectWidget { Flow.unwrapped({ Key key, @required this.delegate, - List children: const [], + List children = const [], }) : assert(delegate != null), super(key: key, children: children); @@ -4283,11 +4283,11 @@ class RichText extends LeafRenderObjectWidget { const RichText({ Key key, @required this.text, - this.textAlign: TextAlign.start, + this.textAlign = TextAlign.start, this.textDirection, - this.softWrap: true, - this.overflow: TextOverflow.clip, - this.textScaleFactor: 1.0, + this.softWrap = true, + this.overflow = TextOverflow.clip, + this.textScaleFactor = 1.0, this.maxLines, }) : assert(text != null), assert(textAlign != null), @@ -4398,14 +4398,14 @@ class RawImage extends LeafRenderObjectWidget { this.image, this.width, this.height, - this.scale: 1.0, + this.scale = 1.0, this.color, this.colorBlendMode, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, this.centerSlice, - this.matchTextDirection: false, + this.matchTextDirection = false, }) : assert(scale != null), assert(alignment != null), assert(repeat != null), @@ -4702,7 +4702,7 @@ class Listener extends SingleChildRenderObjectWidget { this.onPointerMove, this.onPointerUp, this.onPointerCancel, - this.behavior: HitTestBehavior.deferToChild, + this.behavior = HitTestBehavior.deferToChild, Widget child }) : assert(behavior != null), super(key: key, child: child); @@ -4821,7 +4821,7 @@ class IgnorePointer extends SingleChildRenderObjectWidget { /// render object will be ignored for semantics if [ignoring] is true. const IgnorePointer({ Key key, - this.ignoring: true, + this.ignoring = true, this.ignoringSemantics, Widget child }) : assert(ignoring != null), @@ -4881,7 +4881,7 @@ class AbsorbPointer extends SingleChildRenderObjectWidget { /// The [absorbing] argument must not be null const AbsorbPointer({ Key key, - this.absorbing: true, + this.absorbing = true, Widget child }) : assert(absorbing != null), super(key: key, child: child); @@ -4915,7 +4915,7 @@ class MetaData extends SingleChildRenderObjectWidget { const MetaData({ Key key, this.metaData, - this.behavior: HitTestBehavior.deferToChild, + this.behavior = HitTestBehavior.deferToChild, Widget child }) : super(key: key, child: child); @@ -4985,8 +4985,8 @@ class Semantics extends SingleChildRenderObjectWidget { Semantics({ Key key, Widget child, - bool container: false, - bool explicitChildNodes: false, + bool container = false, + bool explicitChildNodes = false, bool enabled, bool checked, bool selected, @@ -5071,8 +5071,8 @@ class Semantics extends SingleChildRenderObjectWidget { const Semantics.fromProperties({ Key key, Widget child, - this.container: false, - this.explicitChildNodes: false, + this.container = false, + this.explicitChildNodes = false, @required this.properties, }) : assert(container != null), assert(properties != null), @@ -5257,7 +5257,7 @@ class MergeSemantics extends SingleChildRenderObjectWidget { class BlockSemantics extends SingleChildRenderObjectWidget { /// Creates a widget that excludes the semantics of all widgets painted before /// it in the same semantic container. - const BlockSemantics({ Key key, this.blocking: true, Widget child }) : super(key: key, child: child); + const BlockSemantics({ Key key, this.blocking = true, Widget child }) : super(key: key, child: child); /// Whether this widget is blocking semantics of all widget that were painted /// before it in the same semantic container. @@ -5295,7 +5295,7 @@ class ExcludeSemantics extends SingleChildRenderObjectWidget { /// Creates a widget that drops all the semantics of its descendants. const ExcludeSemantics({ Key key, - this.excluding: true, + this.excluding = true, Widget child, }) : assert(excluding != null), super(key: key, child: child); @@ -5342,7 +5342,7 @@ class KeyedSubtree extends StatelessWidget { /// Wrap each item in a KeyedSubtree whose key is based on the item's existing key or /// the sum of its list index and `baseIndex`. - static List ensureUniqueKeysForList(Iterable items, { int baseIndex: 0 }) { + static List ensureUniqueKeysForList(Iterable items, { int baseIndex = 0 }) { if (items == null || items.isEmpty) return items; diff --git a/packages/flutter/lib/src/widgets/container.dart b/packages/flutter/lib/src/widgets/container.dart index 95f61d3d62..e9b5572910 100644 --- a/packages/flutter/lib/src/widgets/container.dart +++ b/packages/flutter/lib/src/widgets/container.dart @@ -54,7 +54,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { const DecoratedBox({ Key key, @required this.decoration, - this.position: DecorationPosition.background, + this.position = DecorationPosition.background, Widget child }) : assert(decoration != null), assert(position != null), diff --git a/packages/flutter/lib/src/widgets/dismissible.dart b/packages/flutter/lib/src/widgets/dismissible.dart index 436b5681d9..b90cf84669 100644 --- a/packages/flutter/lib/src/widgets/dismissible.dart +++ b/packages/flutter/lib/src/widgets/dismissible.dart @@ -77,11 +77,11 @@ class Dismissible extends StatefulWidget { this.secondaryBackground, this.onResize, this.onDismissed, - this.direction: DismissDirection.horizontal, - this.resizeDuration: const Duration(milliseconds: 300), - this.dismissThresholds: const {}, - this.movementDuration: const Duration(milliseconds: 200), - this.crossAxisEndOffset: 0.0, + this.direction = DismissDirection.horizontal, + this.resizeDuration = const Duration(milliseconds: 300), + this.dismissThresholds = const {}, + this.movementDuration = const Duration(milliseconds: 200), + this.crossAxisEndOffset = 0.0, }) : assert(key != null), assert(secondaryBackground != null ? background != null : true), super(key: key); diff --git a/packages/flutter/lib/src/widgets/drag_target.dart b/packages/flutter/lib/src/widgets/drag_target.dart index 67adc9923a..1841685f4e 100644 --- a/packages/flutter/lib/src/widgets/drag_target.dart +++ b/packages/flutter/lib/src/widgets/drag_target.dart @@ -94,8 +94,8 @@ class Draggable extends StatefulWidget { this.data, this.axis, this.childWhenDragging, - this.feedbackOffset: Offset.zero, - this.dragAnchor: DragAnchor.child, + this.feedbackOffset = Offset.zero, + this.dragAnchor = DragAnchor.child, this.affinity, this.maxSimultaneousDrags, this.onDragStarted, @@ -248,8 +248,8 @@ class LongPressDraggable extends Draggable { T data, Axis axis, Widget childWhenDragging, - Offset feedbackOffset: Offset.zero, - DragAnchor dragAnchor: DragAnchor.child, + Offset feedbackOffset = Offset.zero, + DragAnchor dragAnchor = DragAnchor.child, int maxSimultaneousDrags, VoidCallback onDragStarted, DraggableCanceledCallback onDraggableCanceled, @@ -493,9 +493,9 @@ class _DragAvatar extends Drag { this.data, this.axis, Offset initialPosition, - this.dragStartPoint: Offset.zero, + this.dragStartPoint = Offset.zero, this.feedback, - this.feedbackOffset: Offset.zero, + this.feedbackOffset = Offset.zero, this.onDragEnd }) : assert(overlayState != null), assert(dragStartPoint != null), diff --git a/packages/flutter/lib/src/widgets/editable_text.dart b/packages/flutter/lib/src/widgets/editable_text.dart index ee5d2b8270..e9ff2c7f2e 100644 --- a/packages/flutter/lib/src/widgets/editable_text.dart +++ b/packages/flutter/lib/src/widgets/editable_text.dart @@ -154,15 +154,15 @@ class EditableText extends StatefulWidget { Key key, @required this.controller, @required this.focusNode, - this.obscureText: false, - this.autocorrect: true, + this.obscureText = false, + this.autocorrect = true, @required this.style, @required this.cursorColor, - this.textAlign: TextAlign.start, + this.textAlign = TextAlign.start, this.textDirection, this.textScaleFactor, - this.maxLines: 1, - this.autofocus: false, + this.maxLines = 1, + this.autofocus = false, this.selectionColor, this.selectionControls, TextInputType keyboardType, @@ -170,7 +170,7 @@ class EditableText extends StatefulWidget { this.onSubmitted, this.onSelectionChanged, List inputFormatters, - this.rendererIgnoresPointer: false, + this.rendererIgnoresPointer = false, }) : assert(controller != null), assert(focusNode != null), assert(obscureText != null), @@ -752,7 +752,7 @@ class _Editable extends LeafRenderObjectWidget { this.offset, this.onSelectionChanged, this.onCaretChanged, - this.rendererIgnoresPointer: false, + this.rendererIgnoresPointer = false, }) : assert(textDirection != null), assert(rendererIgnoresPointer != null), super(key: key); diff --git a/packages/flutter/lib/src/widgets/fade_in_image.dart b/packages/flutter/lib/src/widgets/fade_in_image.dart index a77ab1efe3..fbfc815b39 100644 --- a/packages/flutter/lib/src/widgets/fade_in_image.dart +++ b/packages/flutter/lib/src/widgets/fade_in_image.dart @@ -69,16 +69,16 @@ class FadeInImage extends StatefulWidget { Key key, @required this.placeholder, @required this.image, - this.fadeOutDuration: const Duration(milliseconds: 300), - this.fadeOutCurve: Curves.easeOut, - this.fadeInDuration: const Duration(milliseconds: 700), - this.fadeInCurve: Curves.easeIn, + this.fadeOutDuration = const Duration(milliseconds: 300), + this.fadeOutCurve = Curves.easeOut, + this.fadeInDuration = const Duration(milliseconds: 700), + this.fadeInCurve = Curves.easeIn, this.width, this.height, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, - this.matchTextDirection: false, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, + this.matchTextDirection = false, }) : assert(placeholder != null), assert(image != null), assert(fadeOutDuration != null), @@ -115,18 +115,18 @@ class FadeInImage extends StatefulWidget { Key key, @required Uint8List placeholder, @required String image, - double placeholderScale: 1.0, - double imageScale: 1.0, - this.fadeOutDuration: const Duration(milliseconds: 300), - this.fadeOutCurve: Curves.easeOut, - this.fadeInDuration: const Duration(milliseconds: 700), - this.fadeInCurve: Curves.easeIn, + double placeholderScale = 1.0, + double imageScale = 1.0, + this.fadeOutDuration = const Duration(milliseconds: 300), + this.fadeOutCurve = Curves.easeOut, + this.fadeInDuration = const Duration(milliseconds: 700), + this.fadeInCurve = Curves.easeIn, this.width, this.height, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, - this.matchTextDirection: false, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, + this.matchTextDirection = false, }) : assert(placeholder != null), assert(image != null), assert(placeholderScale != null), @@ -172,17 +172,17 @@ class FadeInImage extends StatefulWidget { @required String image, AssetBundle bundle, double placeholderScale, - double imageScale: 1.0, - this.fadeOutDuration: const Duration(milliseconds: 300), - this.fadeOutCurve: Curves.easeOut, - this.fadeInDuration: const Duration(milliseconds: 700), - this.fadeInCurve: Curves.easeIn, + double imageScale = 1.0, + this.fadeOutDuration = const Duration(milliseconds: 300), + this.fadeOutCurve = Curves.easeOut, + this.fadeInDuration = const Duration(milliseconds: 700), + this.fadeInCurve = Curves.easeIn, this.width, this.height, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, - this.matchTextDirection: false, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, + this.matchTextDirection = false, }) : assert(placeholder != null), assert(image != null), placeholder = placeholderScale != null diff --git a/packages/flutter/lib/src/widgets/focus_scope.dart b/packages/flutter/lib/src/widgets/focus_scope.dart index 842689bd55..5cc36de3d4 100644 --- a/packages/flutter/lib/src/widgets/focus_scope.dart +++ b/packages/flutter/lib/src/widgets/focus_scope.dart @@ -52,7 +52,7 @@ class FocusScope extends StatefulWidget { const FocusScope({ Key key, @required this.node, - this.autofocus: false, + this.autofocus = false, this.child, }) : assert(node != null), assert(autofocus != null), diff --git a/packages/flutter/lib/src/widgets/form.dart b/packages/flutter/lib/src/widgets/form.dart index 3753679a79..47d6e3e6a1 100644 --- a/packages/flutter/lib/src/widgets/form.dart +++ b/packages/flutter/lib/src/widgets/form.dart @@ -22,7 +22,7 @@ class Form extends StatefulWidget { const Form({ Key key, @required this.child, - this.autovalidate: false, + this.autovalidate = false, this.onWillPop, this.onChanged, }) : assert(child != null), @@ -226,7 +226,7 @@ class FormField extends StatefulWidget { this.onSaved, this.validator, this.initialValue, - this.autovalidate: false, + this.autovalidate = false, }) : assert(builder != null), super(key: key); diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 0110098117..43ff5e8382 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -1651,7 +1651,7 @@ abstract class MultiChildRenderObjectWidget extends RenderObjectWidget { /// /// The [children] argument must not be null and must not contain any null /// objects. - MultiChildRenderObjectWidget({ Key key, this.children: const [] }) + MultiChildRenderObjectWidget({ Key key, this.children = const [] }) : assert(children != null), assert(!children.any((Widget child) => child == null)), // https://github.com/dart-lang/sdk/issues/29276 super(key: key); diff --git a/packages/flutter/lib/src/widgets/gesture_detector.dart b/packages/flutter/lib/src/widgets/gesture_detector.dart index 7c92d6958d..7be656c332 100644 --- a/packages/flutter/lib/src/widgets/gesture_detector.dart +++ b/packages/flutter/lib/src/widgets/gesture_detector.dart @@ -169,7 +169,7 @@ class GestureDetector extends StatelessWidget { this.onScaleUpdate, this.onScaleEnd, this.behavior, - this.excludeFromSemantics: false + this.excludeFromSemantics = false }) : assert(excludeFromSemantics != null), assert(() { final bool haveVerticalDrag = onVerticalDragStart != null || onVerticalDragUpdate != null || onVerticalDragEnd != null; @@ -463,9 +463,9 @@ class RawGestureDetector extends StatefulWidget { const RawGestureDetector({ Key key, this.child, - this.gestures: const {}, + this.gestures = const {}, this.behavior, - this.excludeFromSemantics: false + this.excludeFromSemantics = false }) : assert(gestures != null), assert(excludeFromSemantics != null), super(key: key); diff --git a/packages/flutter/lib/src/widgets/grid_paper.dart b/packages/flutter/lib/src/widgets/grid_paper.dart index 07a982621f..647e6ffcfa 100644 --- a/packages/flutter/lib/src/widgets/grid_paper.dart +++ b/packages/flutter/lib/src/widgets/grid_paper.dart @@ -59,10 +59,10 @@ class GridPaper extends StatelessWidget { /// Creates a widget that draws a rectilinear grid of 1-pixel-wide lines. const GridPaper({ Key key, - this.color: const Color(0x7FC3E8F3), - this.interval: 100.0, - this.divisions: 2, - this.subdivisions: 5, + this.color = const Color(0x7FC3E8F3), + this.interval = 100.0, + this.divisions = 2, + this.subdivisions = 5, this.child, }) : assert(divisions > 0, 'The "divisions" property must be greater than zero. If there were no divisions, the grid paper would not paint anything.'), assert(subdivisions > 0, 'The "subdivisions" property must be greater than zero. If there were no subdivisions, the grid paper would not paint anything.'), diff --git a/packages/flutter/lib/src/widgets/icon_data.dart b/packages/flutter/lib/src/widgets/icon_data.dart index fc837dbad7..fff3e7578e 100644 --- a/packages/flutter/lib/src/widgets/icon_data.dart +++ b/packages/flutter/lib/src/widgets/icon_data.dart @@ -23,7 +23,7 @@ class IconData { this.codePoint, { this.fontFamily, this.fontPackage, - this.matchTextDirection: false, + this.matchTextDirection = false, }); /// The Unicode code point at which this icon is stored in the icon font. diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart index 77456de3b1..9c1021d9ea 100644 --- a/packages/flutter/lib/src/widgets/image.dart +++ b/packages/flutter/lib/src/widgets/image.dart @@ -128,11 +128,11 @@ class Image extends StatefulWidget { this.color, this.colorBlendMode, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, this.centerSlice, - this.matchTextDirection: false, - this.gaplessPlayback: false, + this.matchTextDirection = false, + this.gaplessPlayback = false, }) : assert(image != null), assert(alignment != null), assert(repeat != null), @@ -154,17 +154,17 @@ class Image extends StatefulWidget { /// with the image request. Image.network(String src, { Key key, - double scale: 1.0, + double scale = 1.0, this.width, this.height, this.color, this.colorBlendMode, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, this.centerSlice, - this.matchTextDirection: false, - this.gaplessPlayback: false, + this.matchTextDirection = false, + this.gaplessPlayback = false, Map headers, }) : image = new NetworkImage(src, scale: scale, headers: headers), assert(alignment != null), @@ -185,17 +185,17 @@ class Image extends StatefulWidget { /// `android.permission.READ_EXTERNAL_STORAGE` permission. Image.file(File file, { Key key, - double scale: 1.0, + double scale = 1.0, this.width, this.height, this.color, this.colorBlendMode, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, this.centerSlice, - this.matchTextDirection: false, - this.gaplessPlayback: false, + this.matchTextDirection = false, + this.gaplessPlayback = false, }) : image = new FileImage(file, scale: scale), assert(alignment != null), assert(repeat != null), @@ -325,11 +325,11 @@ class Image extends StatefulWidget { this.color, this.colorBlendMode, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, this.centerSlice, - this.matchTextDirection: false, - this.gaplessPlayback: false, + this.matchTextDirection = false, + this.gaplessPlayback = false, String package, }) : image = scale != null ? new ExactAssetImage(name, bundle: bundle, scale: scale, package: package) @@ -349,17 +349,17 @@ class Image extends StatefulWidget { /// will result in ugly layout changes. Image.memory(Uint8List bytes, { Key key, - double scale: 1.0, + double scale = 1.0, this.width, this.height, this.color, this.colorBlendMode, this.fit, - this.alignment: Alignment.center, - this.repeat: ImageRepeat.noRepeat, + this.alignment = Alignment.center, + this.repeat = ImageRepeat.noRepeat, this.centerSlice, - this.matchTextDirection: false, - this.gaplessPlayback: false, + this.matchTextDirection = false, + this.gaplessPlayback = false, }) : image = new MemoryImage(bytes, scale: scale), assert(alignment != null), assert(repeat != null), diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 49442931d7..3a01cce2e7 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -197,7 +197,7 @@ abstract class ImplicitlyAnimatedWidget extends StatefulWidget { /// The [curve] and [duration] arguments must not be null. const ImplicitlyAnimatedWidget({ Key key, - this.curve: Curves.linear, + this.curve = Curves.linear, @required this.duration }) : assert(curve != null), assert(duration != null), @@ -365,7 +365,7 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget { this.margin, this.transform, this.child, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration, }) : assert(margin == null || margin.isNonNegative), assert(padding == null || padding.isNonNegative), @@ -515,7 +515,7 @@ class AnimatedPadding extends ImplicitlyAnimatedWidget { Key key, @required this.padding, this.child, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration, }) : assert(padding != null), assert(padding.isNonNegative), @@ -577,7 +577,7 @@ class AnimatedAlign extends ImplicitlyAnimatedWidget { Key key, @required this.alignment, this.child, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration, }) : assert(alignment != null), super(key: key, curve: curve, duration: duration); @@ -666,7 +666,7 @@ class AnimatedPositioned extends ImplicitlyAnimatedWidget { this.bottom, this.width, this.height, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration, }) : assert(left == null || right == null || width == null), assert(top == null || bottom == null || height == null), @@ -679,7 +679,7 @@ class AnimatedPositioned extends ImplicitlyAnimatedWidget { Key key, this.child, Rect rect, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration }) : left = rect.left, top = rect.top, @@ -806,7 +806,7 @@ class AnimatedPositionedDirectional extends ImplicitlyAnimatedWidget { this.bottom, this.width, this.height, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration, }) : assert(start == null || end == null || width == null), assert(top == null || bottom == null || height == null), @@ -950,7 +950,7 @@ class AnimatedOpacity extends ImplicitlyAnimatedWidget { Key key, this.child, @required this.opacity, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration, }) : assert(opacity != null && opacity >= 0.0 && opacity <= 1.0), super(key: key, curve: curve, duration: duration); @@ -1012,10 +1012,10 @@ class AnimatedDefaultTextStyle extends ImplicitlyAnimatedWidget { @required this.child, @required this.style, this.textAlign, - this.softWrap: true, - this.overflow: TextOverflow.clip, + this.softWrap = true, + this.overflow = TextOverflow.clip, this.maxLines, - Curve curve: Curves.linear, + Curve curve = Curves.linear, @required Duration duration, }) : assert(style != null), assert(child != null), @@ -1118,13 +1118,13 @@ class AnimatedPhysicalModel extends ImplicitlyAnimatedWidget { Key key, @required this.child, @required this.shape, - this.borderRadius: BorderRadius.zero, + this.borderRadius = BorderRadius.zero, @required this.elevation, @required this.color, - this.animateColor: true, + this.animateColor = true, @required this.shadowColor, - this.animateShadowColor: true, - Curve curve: Curves.linear, + this.animateShadowColor = true, + Curve curve = Curves.linear, @required Duration duration, }) : assert(child != null), assert(shape != null), diff --git a/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart b/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart index 227a5901ea..2e005cbc16 100644 --- a/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/list_wheel_scroll_view.dart @@ -39,7 +39,7 @@ class FixedExtentScrollController extends ScrollController { /// /// [initialItem] defaults to 0 and must not be null. FixedExtentScrollController({ - this.initialItem: 0, + this.initialItem = 0, }) : assert(initialItem != null); /// The page to show when first creating the scroll view. @@ -193,7 +193,7 @@ class _FixedExtentScrollPosition extends ScrollPositionWithSingleContext impleme @required ScrollPhysics physics, @required ScrollContext context, @required int initialItem, - bool keepScrollOffset: true, + bool keepScrollOffset = true, ScrollPosition oldPosition, String debugLabel, }) : assert( @@ -251,7 +251,7 @@ class _FixedExtentScrollPosition extends ScrollPositionWithSingleContext impleme class _FixedExtentScrollable extends Scrollable { const _FixedExtentScrollable({ Key key, - AxisDirection axisDirection: AxisDirection.down, + AxisDirection axisDirection = AxisDirection.down, ScrollController controller, ScrollPhysics physics, @required this.itemExtent, @@ -393,12 +393,12 @@ class ListWheelScrollView extends StatefulWidget { Key key, this.controller, this.physics, - this.diameterRatio: RenderListWheelViewport.defaultDiameterRatio, - this.perspective: RenderListWheelViewport.defaultPerspective, + this.diameterRatio = RenderListWheelViewport.defaultDiameterRatio, + this.perspective = RenderListWheelViewport.defaultPerspective, @required this.itemExtent, this.onSelectedItemChanged, - this.clipToSize: true, - this.renderChildrenOutsideViewport: false, + this.clipToSize = true, + this.renderChildrenOutsideViewport = false, @required this.children, }) : assert(diameterRatio != null), assert(diameterRatio > 0.0, RenderListWheelViewport.diameterRatioZeroMessage), @@ -558,11 +558,11 @@ class ListWheelViewport extends MultiChildRenderObjectWidget { /// The [offset] argument must be provided and must not be null. ListWheelViewport({ Key key, - this.diameterRatio: RenderListWheelViewport.defaultDiameterRatio, - this.perspective: RenderListWheelViewport.defaultPerspective, + this.diameterRatio = RenderListWheelViewport.defaultDiameterRatio, + this.perspective = RenderListWheelViewport.defaultPerspective, @required this.itemExtent, - this.clipToSize: true, - this.renderChildrenOutsideViewport: false, + this.clipToSize = true, + this.renderChildrenOutsideViewport = false, @required this.offset, List children, }) : assert(offset != null), diff --git a/packages/flutter/lib/src/widgets/localizations.dart b/packages/flutter/lib/src/widgets/localizations.dart index 92768b0fa9..8bd44d9362 100644 --- a/packages/flutter/lib/src/widgets/localizations.dart +++ b/packages/flutter/lib/src/widgets/localizations.dart @@ -404,7 +404,7 @@ class Localizations extends StatefulWidget { /// If no [Localizations] widget is in scope then the [Localizations.localeOf] /// method will throw an exception, unless the `nullOk` argument is set to /// true, in which case it returns null. - static Locale localeOf(BuildContext context, { bool nullOk: false }) { + static Locale localeOf(BuildContext context, { bool nullOk = false }) { assert(context != null); assert(nullOk != null); final _LocalizationsScope scope = context.inheritFromWidgetOfExactType(_LocalizationsScope); diff --git a/packages/flutter/lib/src/widgets/media_query.dart b/packages/flutter/lib/src/widgets/media_query.dart index 96a345ef50..d5cd755ad3 100644 --- a/packages/flutter/lib/src/widgets/media_query.dart +++ b/packages/flutter/lib/src/widgets/media_query.dart @@ -37,12 +37,12 @@ class MediaQueryData { /// Consider using [MediaQueryData.fromWindow] to create data based on a /// [Window]. const MediaQueryData({ - this.size: Size.zero, - this.devicePixelRatio: 1.0, - this.textScaleFactor: 1.0, - this.padding: EdgeInsets.zero, - this.viewInsets: EdgeInsets.zero, - this.alwaysUse24HourFormat: false, + this.size = Size.zero, + this.devicePixelRatio = 1.0, + this.textScaleFactor = 1.0, + this.padding = EdgeInsets.zero, + this.viewInsets = EdgeInsets.zero, + this.alwaysUse24HourFormat = false, }); /// Creates data for a media query based on the given window. @@ -160,10 +160,10 @@ class MediaQueryData { /// adds a [Padding] widget. /// * [removeViewInsets], the same thing but for [viewInsets]. MediaQueryData removePadding({ - bool removeLeft: false, - bool removeTop: false, - bool removeRight: false, - bool removeBottom: false, + bool removeLeft = false, + bool removeTop = false, + bool removeRight = false, + bool removeBottom = false, }) { if (!(removeLeft || removeTop || removeRight || removeBottom)) return this; @@ -195,10 +195,10 @@ class MediaQueryData { /// padding from the ambient [MediaQuery]. /// * [removePadding], the same thing but for [padding]. MediaQueryData removeViewInsets({ - bool removeLeft: false, - bool removeTop: false, - bool removeRight: false, - bool removeBottom: false, + bool removeLeft = false, + bool removeTop = false, + bool removeRight = false, + bool removeBottom = false, }) { if (!(removeLeft || removeTop || removeRight || removeBottom)) return this; @@ -304,10 +304,10 @@ class MediaQuery extends InheritedWidget { factory MediaQuery.removePadding({ Key key, @required BuildContext context, - bool removeLeft: false, - bool removeTop: false, - bool removeRight: false, - bool removeBottom: false, + bool removeLeft = false, + bool removeTop = false, + bool removeRight = false, + bool removeBottom = false, @required Widget child, }) { return new MediaQuery( @@ -346,10 +346,10 @@ class MediaQuery extends InheritedWidget { factory MediaQuery.removeViewInsets({ Key key, @required BuildContext context, - bool removeLeft: false, - bool removeTop: false, - bool removeRight: false, - bool removeBottom: false, + bool removeLeft = false, + bool removeTop = false, + bool removeRight = false, + bool removeBottom = false, @required Widget child, }) { return new MediaQuery( @@ -388,7 +388,7 @@ class MediaQuery extends InheritedWidget { /// /// If you use this from a widget (e.g. in its build function), consider /// calling [debugCheckHasMediaQuery]. - static MediaQueryData of(BuildContext context, { bool nullOk: false }) { + static MediaQueryData of(BuildContext context, { bool nullOk = false }) { assert(context != null); assert(nullOk != null); final MediaQuery query = context.inheritFromWidgetOfExactType(MediaQuery); diff --git a/packages/flutter/lib/src/widgets/modal_barrier.dart b/packages/flutter/lib/src/widgets/modal_barrier.dart index 67bab958a4..671acd4753 100644 --- a/packages/flutter/lib/src/widgets/modal_barrier.dart +++ b/packages/flutter/lib/src/widgets/modal_barrier.dart @@ -31,7 +31,7 @@ class ModalBarrier extends StatelessWidget { const ModalBarrier({ Key key, this.color, - this.dismissible: true, + this.dismissible = true, this.semanticsLabel, }) : super(key: key); @@ -115,7 +115,7 @@ class AnimatedModalBarrier extends AnimatedWidget { const AnimatedModalBarrier({ Key key, Animation color, - this.dismissible: true, + this.dismissible = true, this.semanticsLabel, }) : super(key: key, listenable: color); diff --git a/packages/flutter/lib/src/widgets/navigation_toolbar.dart b/packages/flutter/lib/src/widgets/navigation_toolbar.dart index cad1f62b69..fafba52f94 100644 --- a/packages/flutter/lib/src/widgets/navigation_toolbar.dart +++ b/packages/flutter/lib/src/widgets/navigation_toolbar.dart @@ -30,8 +30,8 @@ class NavigationToolbar extends StatelessWidget { this.leading, this.middle, this.trailing, - this.centerMiddle: true, - this.middleSpacing: kMiddleSpacing, + this.centerMiddle = true, + this.middleSpacing = kMiddleSpacing, }) : assert(centerMiddle != null), assert(middleSpacing != null), super(key: key); diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index f3d6ee4b54..98d9a4cee3 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -287,7 +287,7 @@ class RouteSettings { /// Creates data used to construct routes. const RouteSettings({ this.name, - this.isInitialRoute: false, + this.isInitialRoute = false, }); /// Creates a copy of this route settings object with the given fields @@ -654,7 +654,7 @@ class Navigator extends StatefulWidget { this.initialRoute, @required this.onGenerateRoute, this.onUnknownRoute, - this.observers: const [] + this.observers = const [] }) : assert(onGenerateRoute != null), super(key: key); @@ -1262,8 +1262,8 @@ class Navigator extends StatefulWidget { /// instances of [Navigator]. static NavigatorState of( BuildContext context, { - bool rootNavigator: false, - bool nullOk: false, + bool rootNavigator = false, + bool nullOk = false, }) { final NavigatorState navigator = rootNavigator ? context.rootAncestorStateOfType(const TypeMatcher()) @@ -1398,7 +1398,7 @@ class NavigatorState extends State with TickerProviderStateMixin { bool _debugLocked = false; // used to prevent re-entrant calls to push, pop, and friends - Route _routeNamed(String name, { bool allowNull: false }) { + Route _routeNamed(String name, { bool allowNull = false }) { assert(!_debugLocked); assert(name != null); final RouteSettings settings = new RouteSettings( diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart index dd2a8e0802..720e01751e 100644 --- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart @@ -182,8 +182,8 @@ class NestedScrollView extends StatefulWidget { const NestedScrollView({ Key key, this.controller, - this.scrollDirection: Axis.vertical, - this.reverse: false, + this.scrollDirection = Axis.vertical, + this.reverse = false, this.physics, @required this.headerSliverBuilder, @required this.body, @@ -835,7 +835,7 @@ class _NestedScrollCoordinator implements ScrollActivityDelegate, ScrollHoldCont class _NestedScrollController extends ScrollController { _NestedScrollController(this.coordinator, { - double initialScrollOffset: 0.0, + double initialScrollOffset = 0.0, String debugLabel, }) : super(initialScrollOffset: initialScrollOffset, debugLabel: debugLabel); @@ -902,7 +902,7 @@ class _NestedScrollPosition extends ScrollPosition implements ScrollActivityDele _NestedScrollPosition({ @required ScrollPhysics physics, @required ScrollContext context, - double initialPixels: 0.0, + double initialPixels = 0.0, ScrollPosition oldPosition, String debugLabel, @required this.coordinator, @@ -1617,12 +1617,12 @@ class NestedScrollViewViewport extends Viewport { /// The [handle] must not be null. NestedScrollViewViewport({ Key key, - AxisDirection axisDirection: AxisDirection.down, + AxisDirection axisDirection = AxisDirection.down, AxisDirection crossAxisDirection, - double anchor: 0.0, + double anchor = 0.0, @required ViewportOffset offset, Key center, - List slivers: const [], + List slivers = const [], @required this.handle, }) : assert(handle != null), super( @@ -1675,10 +1675,10 @@ class RenderNestedScrollViewViewport extends RenderViewport { /// /// The [handle] must not be null. RenderNestedScrollViewViewport({ - AxisDirection axisDirection: AxisDirection.down, + AxisDirection axisDirection = AxisDirection.down, @required AxisDirection crossAxisDirection, @required ViewportOffset offset, - double anchor: 0.0, + double anchor = 0.0, List children, RenderSliver center, @required SliverOverlapAbsorberHandle handle, diff --git a/packages/flutter/lib/src/widgets/overlay.dart b/packages/flutter/lib/src/widgets/overlay.dart index 607320aeed..07c7207ead 100644 --- a/packages/flutter/lib/src/widgets/overlay.dart +++ b/packages/flutter/lib/src/widgets/overlay.dart @@ -60,8 +60,8 @@ class OverlayEntry { /// call [remove] on the overlay entry itself. OverlayEntry({ @required this.builder, - bool opaque: false, - bool maintainState: false, + bool opaque = false, + bool maintainState = false, }) : assert(builder != null), assert(opaque != null), assert(maintainState != null), @@ -202,7 +202,7 @@ class Overlay extends StatefulWidget { /// created by the [WidgetsApp] or the [MaterialApp] for the application. const Overlay({ Key key, - this.initialEntries: const [] + this.initialEntries = const [] }) : assert(initialEntries != null), super(key: key); diff --git a/packages/flutter/lib/src/widgets/overscroll_indicator.dart b/packages/flutter/lib/src/widgets/overscroll_indicator.dart index e53abc52da..34fe68c7d9 100644 --- a/packages/flutter/lib/src/widgets/overscroll_indicator.dart +++ b/packages/flutter/lib/src/widgets/overscroll_indicator.dart @@ -43,11 +43,11 @@ class GlowingOverscrollIndicator extends StatefulWidget { /// [notificationPredicate] arguments must not be null. const GlowingOverscrollIndicator({ Key key, - this.showLeading: true, - this.showTrailing: true, + this.showLeading = true, + this.showTrailing = true, @required this.axisDirection, @required this.color, - this.notificationPredicate: defaultScrollNotificationPredicate, + this.notificationPredicate = defaultScrollNotificationPredicate, this.child, }) : assert(showLeading != null), assert(showTrailing != null), diff --git a/packages/flutter/lib/src/widgets/page_view.dart b/packages/flutter/lib/src/widgets/page_view.dart index 4ea9a933ba..86d6a03494 100644 --- a/packages/flutter/lib/src/widgets/page_view.dart +++ b/packages/flutter/lib/src/widgets/page_view.dart @@ -40,9 +40,9 @@ class PageController extends ScrollController { /// /// The [initialPage], [keepPage], and [viewportFraction] arguments must not be null. PageController({ - this.initialPage: 0, - this.keepPage: true, - this.viewportFraction: 1.0, + this.initialPage = 0, + this.keepPage = true, + this.viewportFraction = 1.0, }) : assert(initialPage != null), assert(keepPage != null), assert(viewportFraction != null), @@ -228,9 +228,9 @@ class _PagePosition extends ScrollPositionWithSingleContext implements PageMetri _PagePosition({ ScrollPhysics physics, ScrollContext context, - this.initialPage: 0, - bool keepPage: true, - double viewportFraction: 1.0, + this.initialPage = 0, + bool keepPage = true, + double viewportFraction = 1.0, ScrollPosition oldPosition, }) : assert(initialPage != null), assert(keepPage != null), @@ -413,13 +413,13 @@ class PageView extends StatefulWidget { /// those children that are actually visible. PageView({ Key key, - this.scrollDirection: Axis.horizontal, - this.reverse: false, + this.scrollDirection = Axis.horizontal, + this.reverse = false, PageController controller, this.physics, - this.pageSnapping: true, + this.pageSnapping = true, this.onPageChanged, - List children: const [], + List children = const [], }) : controller = controller ?? _defaultPageController, childrenDelegate = new SliverChildListDelegate(children), super(key: key); @@ -438,11 +438,11 @@ class PageView extends StatefulWidget { /// zero and less than [itemCount]. PageView.builder({ Key key, - this.scrollDirection: Axis.horizontal, - this.reverse: false, + this.scrollDirection = Axis.horizontal, + this.reverse = false, PageController controller, this.physics, - this.pageSnapping: true, + this.pageSnapping = true, this.onPageChanged, @required IndexedWidgetBuilder itemBuilder, int itemCount, @@ -454,11 +454,11 @@ class PageView extends StatefulWidget { /// model. PageView.custom({ Key key, - this.scrollDirection: Axis.horizontal, - this.reverse: false, + this.scrollDirection = Axis.horizontal, + this.reverse = false, PageController controller, this.physics, - this.pageSnapping: true, + this.pageSnapping = true, this.onPageChanged, @required this.childrenDelegate, }) : assert(childrenDelegate != null), diff --git a/packages/flutter/lib/src/widgets/pages.dart b/packages/flutter/lib/src/widgets/pages.dart index 72ca769f1c..af498d57bf 100644 --- a/packages/flutter/lib/src/widgets/pages.dart +++ b/packages/flutter/lib/src/widgets/pages.dart @@ -12,7 +12,7 @@ abstract class PageRoute extends ModalRoute { /// Creates a modal route that replaces the entire screen. PageRoute({ RouteSettings settings, - this.fullscreenDialog: false, + this.fullscreenDialog = false, }) : super(settings: settings); /// Whether this page route is a full-screen dialog. @@ -72,13 +72,13 @@ class PageRouteBuilder extends PageRoute { PageRouteBuilder({ RouteSettings settings, @required this.pageBuilder, - this.transitionsBuilder: _defaultTransitionsBuilder, - this.transitionDuration: const Duration(milliseconds: 300), - this.opaque: true, - this.barrierDismissible: false, + this.transitionsBuilder = _defaultTransitionsBuilder, + this.transitionDuration = const Duration(milliseconds: 300), + this.opaque = true, + this.barrierDismissible = false, this.barrierColor, this.barrierLabel, - this.maintainState: true, + this.maintainState = true, }) : assert(pageBuilder != null), assert(transitionsBuilder != null), assert(barrierDismissible != null), diff --git a/packages/flutter/lib/src/widgets/performance_overlay.dart b/packages/flutter/lib/src/widgets/performance_overlay.dart index c253d2874a..96dc565f4b 100644 --- a/packages/flutter/lib/src/widgets/performance_overlay.dart +++ b/packages/flutter/lib/src/widgets/performance_overlay.dart @@ -29,17 +29,17 @@ class PerformanceOverlay extends LeafRenderObjectWidget { /// [PerformanceOverlayOption] to enable. const PerformanceOverlay({ Key key, - this.optionsMask: 0, - this.rasterizerThreshold: 0, - this.checkerboardRasterCacheImages: false, - this.checkerboardOffscreenLayers: false, + this.optionsMask = 0, + this.rasterizerThreshold = 0, + this.checkerboardRasterCacheImages = false, + this.checkerboardOffscreenLayers = false, }) : super(key: key); /// Create a performance overlay that displays all available statistics PerformanceOverlay.allEnabled({ Key key, - this.rasterizerThreshold: 0, - this.checkerboardRasterCacheImages: false, - this.checkerboardOffscreenLayers: false }) + this.rasterizerThreshold = 0, + this.checkerboardRasterCacheImages = false, + this.checkerboardOffscreenLayers = false }) : optionsMask = 1 << PerformanceOverlayOption.displayRasterizerStatistics.index | 1 << PerformanceOverlayOption.visualizeRasterizerStatistics.index | diff --git a/packages/flutter/lib/src/widgets/placeholder.dart b/packages/flutter/lib/src/widgets/placeholder.dart index 37f76abc88..49bcf59f40 100644 --- a/packages/flutter/lib/src/widgets/placeholder.dart +++ b/packages/flutter/lib/src/widgets/placeholder.dart @@ -53,10 +53,10 @@ class Placeholder extends StatelessWidget { /// Creates a widget which draws a box. const Placeholder({ Key key, - this.color: const Color(0xFF455A64), // Blue Grey 700 - this.strokeWidth: 2.0, - this.fallbackWidth: 400.0, - this.fallbackHeight: 400.0, + this.color = const Color(0xFF455A64), // Blue Grey 700 + this.strokeWidth = 2.0, + this.fallbackWidth = 400.0, + this.fallbackHeight = 400.0, }) : super(key: key); /// The color to draw the placeholder box. diff --git a/packages/flutter/lib/src/widgets/safe_area.dart b/packages/flutter/lib/src/widgets/safe_area.dart index f2ad0b480b..3b054830ed 100644 --- a/packages/flutter/lib/src/widgets/safe_area.dart +++ b/packages/flutter/lib/src/widgets/safe_area.dart @@ -38,11 +38,11 @@ class SafeArea extends StatelessWidget { /// null. const SafeArea({ Key key, - this.left: true, - this.top: true, - this.right: true, - this.bottom: true, - this.minimum: EdgeInsets.zero, + this.left = true, + this.top = true, + this.right = true, + this.bottom = true, + this.minimum = EdgeInsets.zero, @required this.child, }) : assert(left != null), assert(top != null), @@ -134,11 +134,11 @@ class SliverSafeArea extends StatelessWidget { /// The [left], [top], [right], [bottom], and [minimum] arguments must not be null. const SliverSafeArea({ Key key, - this.left: true, - this.top: true, - this.right: true, - this.bottom: true, - this.minimum: EdgeInsets.zero, + this.left = true, + this.top = true, + this.right = true, + this.bottom = true, + this.minimum = EdgeInsets.zero, @required this.sliver, }) : assert(left != null), assert(top != null), diff --git a/packages/flutter/lib/src/widgets/scroll_controller.dart b/packages/flutter/lib/src/widgets/scroll_controller.dart index 2f78a694ff..d87ab68f0e 100644 --- a/packages/flutter/lib/src/widgets/scroll_controller.dart +++ b/packages/flutter/lib/src/widgets/scroll_controller.dart @@ -48,8 +48,8 @@ class ScrollController extends ChangeNotifier { /// /// The values of `initialScrollOffset` and `keepScrollOffset` must not be null. ScrollController({ - double initialScrollOffset: 0.0, - this.keepScrollOffset: true, + double initialScrollOffset = 0.0, + this.keepScrollOffset = true, this.debugLabel, }) : assert(initialScrollOffset != null), assert(keepScrollOffset != null), @@ -315,8 +315,8 @@ class TrackingScrollController extends ScrollController { /// Creates a scroll controller that continually updates its /// [initialScrollOffset] to match the last scroll notification it received. TrackingScrollController({ - double initialScrollOffset: 0.0, - bool keepScrollOffset: true, + double initialScrollOffset = 0.0, + bool keepScrollOffset = true, String debugLabel, }) : super(initialScrollOffset: initialScrollOffset, keepScrollOffset: keepScrollOffset, diff --git a/packages/flutter/lib/src/widgets/scroll_notification.dart b/packages/flutter/lib/src/widgets/scroll_notification.dart index e61b24e937..8ab378aca7 100644 --- a/packages/flutter/lib/src/widgets/scroll_notification.dart +++ b/packages/flutter/lib/src/widgets/scroll_notification.dart @@ -185,7 +185,7 @@ class OverscrollNotification extends ScrollNotification { @required BuildContext context, this.dragDetails, @required this.overscroll, - this.velocity: 0.0, + this.velocity = 0.0, }) : assert(overscroll != null), assert(overscroll.isFinite), assert(overscroll != 0.0), diff --git a/packages/flutter/lib/src/widgets/scroll_position.dart b/packages/flutter/lib/src/widgets/scroll_position.dart index e3256136d4..e6a2251c45 100644 --- a/packages/flutter/lib/src/widgets/scroll_position.dart +++ b/packages/flutter/lib/src/widgets/scroll_position.dart @@ -69,7 +69,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { ScrollPosition({ @required this.physics, @required this.context, - this.keepScrollOffset: true, + this.keepScrollOffset = true, ScrollPosition oldPosition, this.debugLabel, }) : assert(physics != null), @@ -489,9 +489,9 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { /// Animates the position such that the given object is as visible as possible /// by just scrolling this position. Future ensureVisible(RenderObject object, { - double alignment: 0.0, - Duration duration: Duration.zero, - Curve curve: Curves.ease, + double alignment = 0.0, + Duration duration = Duration.zero, + Curve curve = Curves.ease, }) { assert(object.attached); final RenderAbstractViewport viewport = RenderAbstractViewport.of(object); diff --git a/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart b/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart index cf0ab5e3e7..968fffb08c 100644 --- a/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart +++ b/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart @@ -51,8 +51,8 @@ class ScrollPositionWithSingleContext extends ScrollPosition implements ScrollAc ScrollPositionWithSingleContext({ @required ScrollPhysics physics, @required ScrollContext context, - double initialPixels: 0.0, - bool keepScrollOffset: true, + double initialPixels = 0.0, + bool keepScrollOffset = true, ScrollPosition oldPosition, String debugLabel, }) : super( diff --git a/packages/flutter/lib/src/widgets/scroll_simulation.dart b/packages/flutter/lib/src/widgets/scroll_simulation.dart index 366a89116a..38c45caf14 100644 --- a/packages/flutter/lib/src/widgets/scroll_simulation.dart +++ b/packages/flutter/lib/src/widgets/scroll_simulation.dart @@ -34,7 +34,7 @@ class BouncingScrollSimulation extends Simulation { @required this.leadingExtent, @required this.trailingExtent, @required this.spring, - Tolerance tolerance: Tolerance.defaultTolerance, + Tolerance tolerance = Tolerance.defaultTolerance, }) : assert(position != null), assert(velocity != null), assert(leadingExtent != null), @@ -143,8 +143,8 @@ class ClampingScrollSimulation extends Simulation { ClampingScrollSimulation({ @required this.position, @required this.velocity, - this.friction: 0.015, - Tolerance tolerance: Tolerance.defaultTolerance, + this.friction = 0.015, + Tolerance tolerance = Tolerance.defaultTolerance, }) : assert(_flingVelocityPenetration(0.0) == _initialVelocityPenetration), super(tolerance: tolerance) { _duration = _flingDuration(velocity); diff --git a/packages/flutter/lib/src/widgets/scroll_view.dart b/packages/flutter/lib/src/widgets/scroll_view.dart index 0e0c88fe6a..85bb277074 100644 --- a/packages/flutter/lib/src/widgets/scroll_view.dart +++ b/packages/flutter/lib/src/widgets/scroll_view.dart @@ -50,12 +50,12 @@ abstract class ScrollView extends StatelessWidget { /// If the [primary] argument is true, the [controller] must be null. ScrollView({ Key key, - this.scrollDirection: Axis.vertical, - this.reverse: false, + this.scrollDirection = Axis.vertical, + this.reverse = false, this.controller, bool primary, ScrollPhysics physics, - this.shrinkWrap: false, + this.shrinkWrap = false, this.cacheExtent, }) : assert(reverse != null), assert(shrinkWrap != null), @@ -332,14 +332,14 @@ class CustomScrollView extends ScrollView { /// If the [primary] argument is true, the [controller] must be null. CustomScrollView({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, double cacheExtent, - this.slivers: const [], + this.slivers = const [], }) : super( key: key, scrollDirection: scrollDirection, @@ -372,12 +372,12 @@ abstract class BoxScrollView extends ScrollView { /// If the [primary] argument is true, the [controller] must be null. BoxScrollView({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, this.padding, double cacheExtent, }) : super( @@ -593,18 +593,18 @@ class ListView extends BoxScrollView { /// null. ListView({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, EdgeInsetsGeometry padding, this.itemExtent, - bool addAutomaticKeepAlives: true, - bool addRepaintBoundaries: true, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, double cacheExtent, - List children: const [], + List children = const [], }) : childrenDelegate = new SliverChildListDelegate( children, addAutomaticKeepAlives: addAutomaticKeepAlives, @@ -647,18 +647,18 @@ class ListView extends BoxScrollView { /// be null. ListView.builder({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, EdgeInsetsGeometry padding, this.itemExtent, @required IndexedWidgetBuilder itemBuilder, int itemCount, - bool addAutomaticKeepAlives: true, - bool addRepaintBoundaries: true, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, double cacheExtent, }) : childrenDelegate = new SliverChildBuilderDelegate( itemBuilder, @@ -683,12 +683,12 @@ class ListView extends BoxScrollView { /// estimate the size of children that are not actually visible. ListView.custom({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, EdgeInsetsGeometry padding, this.itemExtent, @required this.childrenDelegate, @@ -883,18 +883,18 @@ class GridView extends BoxScrollView { /// null. GridView({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, EdgeInsetsGeometry padding, @required this.gridDelegate, - bool addAutomaticKeepAlives: true, - bool addRepaintBoundaries: true, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, double cacheExtent, - List children: const [], + List children = const [], }) : assert(gridDelegate != null), childrenDelegate = new SliverChildListDelegate( children, @@ -934,18 +934,18 @@ class GridView extends BoxScrollView { /// be null. GridView.builder({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, EdgeInsetsGeometry padding, @required this.gridDelegate, @required IndexedWidgetBuilder itemBuilder, int itemCount, - bool addAutomaticKeepAlives: true, - bool addRepaintBoundaries: true, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, double cacheExtent, }) : assert(gridDelegate != null), childrenDelegate = new SliverChildBuilderDelegate( @@ -975,12 +975,12 @@ class GridView extends BoxScrollView { /// The [gridDelegate] and [childrenDelegate] arguments must not be null. GridView.custom({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, EdgeInsetsGeometry padding, @required this.gridDelegate, @required this.childrenDelegate, @@ -1015,21 +1015,21 @@ class GridView extends BoxScrollView { /// * [new SliverGrid.count], the equivalent constructor for [SliverGrid]. GridView.count({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, EdgeInsetsGeometry padding, @required int crossAxisCount, - double mainAxisSpacing: 0.0, - double crossAxisSpacing: 0.0, - double childAspectRatio: 1.0, - bool addAutomaticKeepAlives: true, - bool addRepaintBoundaries: true, + double mainAxisSpacing = 0.0, + double crossAxisSpacing = 0.0, + double childAspectRatio = 1.0, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, double cacheExtent, - List children: const [], + List children = const [], }) : gridDelegate = new SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: crossAxisCount, mainAxisSpacing: mainAxisSpacing, @@ -1068,20 +1068,20 @@ class GridView extends BoxScrollView { /// * [new SliverGrid.extent], the equivalent constructor for [SliverGrid]. GridView.extent({ Key key, - Axis scrollDirection: Axis.vertical, - bool reverse: false, + Axis scrollDirection = Axis.vertical, + bool reverse = false, ScrollController controller, bool primary, ScrollPhysics physics, - bool shrinkWrap: false, + bool shrinkWrap = false, EdgeInsetsGeometry padding, @required double maxCrossAxisExtent, - double mainAxisSpacing: 0.0, - double crossAxisSpacing: 0.0, - double childAspectRatio: 1.0, - bool addAutomaticKeepAlives: true, - bool addRepaintBoundaries: true, - List children: const [], + double mainAxisSpacing = 0.0, + double crossAxisSpacing = 0.0, + double childAspectRatio = 1.0, + bool addAutomaticKeepAlives = true, + bool addRepaintBoundaries = true, + List children = const [], }) : gridDelegate = new SliverGridDelegateWithMaxCrossAxisExtent( maxCrossAxisExtent: maxCrossAxisExtent, mainAxisSpacing: mainAxisSpacing, diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index f5155c2f30..563ccc035b 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -74,11 +74,11 @@ class Scrollable extends StatefulWidget { /// The [axisDirection] and [viewportBuilder] arguments must not be null. const Scrollable({ Key key, - this.axisDirection: AxisDirection.down, + this.axisDirection = AxisDirection.down, this.controller, this.physics, @required this.viewportBuilder, - this.excludeFromSemantics: false, + this.excludeFromSemantics = false, }) : assert(axisDirection != null), assert(viewportBuilder != null), assert(excludeFromSemantics != null), @@ -191,9 +191,9 @@ class Scrollable extends StatefulWidget { /// Scrolls the scrollables that enclose the given context so as to make the /// given context visible. static Future ensureVisible(BuildContext context, { - double alignment: 0.0, - Duration duration: Duration.zero, - Curve curve: Curves.ease, + double alignment = 0.0, + Duration duration = Duration.zero, + Curve curve = Curves.ease, }) { final List> futures = >[]; diff --git a/packages/flutter/lib/src/widgets/scrollbar.dart b/packages/flutter/lib/src/widgets/scrollbar.dart index ccfb9fcfce..56312f91ad 100644 --- a/packages/flutter/lib/src/widgets/scrollbar.dart +++ b/packages/flutter/lib/src/widgets/scrollbar.dart @@ -43,10 +43,10 @@ class ScrollbarPainter extends ChangeNotifier implements CustomPainter { @required this.textDirection, @required this.thickness, @required this.fadeoutOpacityAnimation, - this.mainAxisMargin: 0.0, - this.crossAxisMargin: 0.0, + this.mainAxisMargin = 0.0, + this.crossAxisMargin = 0.0, this.radius, - this.minLength: _kMinThumbExtent, + this.minLength = _kMinThumbExtent, }) : assert(color != null), assert(textDirection != null), assert(thickness != null), diff --git a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart index 2070cd28f1..cd32b4cfbf 100644 --- a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart @@ -185,8 +185,8 @@ class SingleChildScrollView extends StatelessWidget { /// Creates a box in which a single widget can be scrolled. SingleChildScrollView({ Key key, - this.scrollDirection: Axis.vertical, - this.reverse: false, + this.scrollDirection = Axis.vertical, + this.reverse = false, this.padding, bool primary, this.physics, @@ -293,7 +293,7 @@ class SingleChildScrollView extends StatelessWidget { class _SingleChildViewport extends SingleChildRenderObjectWidget { const _SingleChildViewport({ Key key, - this.axisDirection: AxisDirection.down, + this.axisDirection = AxisDirection.down, this.offset, Widget child, }) : assert(axisDirection != null), @@ -321,9 +321,9 @@ class _SingleChildViewport extends SingleChildRenderObjectWidget { class _RenderSingleChildViewport extends RenderBox with RenderObjectWithChildMixin implements RenderAbstractViewport { _RenderSingleChildViewport({ - AxisDirection axisDirection: AxisDirection.down, + AxisDirection axisDirection = AxisDirection.down, @required ViewportOffset offset, - double cacheExtent: RenderAbstractViewport.defaultCacheExtent, + double cacheExtent = RenderAbstractViewport.defaultCacheExtent, RenderBox child, }) : assert(axisDirection != null), assert(offset != null), diff --git a/packages/flutter/lib/src/widgets/sliver.dart b/packages/flutter/lib/src/widgets/sliver.dart index 8ff5b7988e..d7cf226d52 100644 --- a/packages/flutter/lib/src/widgets/sliver.dart +++ b/packages/flutter/lib/src/widgets/sliver.dart @@ -140,8 +140,8 @@ class SliverChildBuilderDelegate extends SliverChildDelegate { const SliverChildBuilderDelegate( this.builder, { this.childCount, - this.addAutomaticKeepAlives: true, - this.addRepaintBoundaries: true, + this.addAutomaticKeepAlives = true, + this.addRepaintBoundaries = true, }) : assert(builder != null), assert(addAutomaticKeepAlives != null), assert(addRepaintBoundaries != null); @@ -248,8 +248,8 @@ class SliverChildListDelegate extends SliverChildDelegate { /// arguments must not be null. const SliverChildListDelegate( this.children, { - this.addAutomaticKeepAlives: true, - this.addRepaintBoundaries: true, + this.addAutomaticKeepAlives = true, + this.addRepaintBoundaries = true, }) : assert(children != null), assert(addAutomaticKeepAlives != null), assert(addRepaintBoundaries != null); @@ -534,10 +534,10 @@ class SliverGrid extends SliverMultiBoxAdaptorWidget { SliverGrid.count({ Key key, @required int crossAxisCount, - double mainAxisSpacing: 0.0, - double crossAxisSpacing: 0.0, - double childAspectRatio: 1.0, - List children: const [], + double mainAxisSpacing = 0.0, + double crossAxisSpacing = 0.0, + double childAspectRatio = 1.0, + List children = const [], }) : gridDelegate = new SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: crossAxisCount, mainAxisSpacing: mainAxisSpacing, @@ -558,10 +558,10 @@ class SliverGrid extends SliverMultiBoxAdaptorWidget { SliverGrid.extent({ Key key, @required double maxCrossAxisExtent, - double mainAxisSpacing: 0.0, - double crossAxisSpacing: 0.0, - double childAspectRatio: 1.0, - List children: const [], + double mainAxisSpacing = 0.0, + double crossAxisSpacing = 0.0, + double childAspectRatio = 1.0, + List children = const [], }) : gridDelegate = new SliverGridDelegateWithMaxCrossAxisExtent( maxCrossAxisExtent: maxCrossAxisExtent, mainAxisSpacing: mainAxisSpacing, @@ -622,7 +622,7 @@ class SliverFillViewport extends SliverMultiBoxAdaptorWidget { const SliverFillViewport({ Key key, @required SliverChildDelegate delegate, - this.viewportFraction: 1.0, + this.viewportFraction = 1.0, }) : assert(viewportFraction != null), assert(viewportFraction > 0.0), super(key: key, delegate: delegate); diff --git a/packages/flutter/lib/src/widgets/sliver_persistent_header.dart b/packages/flutter/lib/src/widgets/sliver_persistent_header.dart index 9ebee10819..c89e10e29f 100644 --- a/packages/flutter/lib/src/widgets/sliver_persistent_header.dart +++ b/packages/flutter/lib/src/widgets/sliver_persistent_header.dart @@ -93,8 +93,8 @@ class SliverPersistentHeader extends StatelessWidget { const SliverPersistentHeader({ Key key, @required this.delegate, - this.pinned: false, - this.floating: false, + this.pinned = false, + this.floating = false, }) : assert(delegate != null), assert(pinned != null), assert(floating != null), diff --git a/packages/flutter/lib/src/widgets/spacer.dart b/packages/flutter/lib/src/widgets/spacer.dart index af4da9a0da..50955bc5df 100644 --- a/packages/flutter/lib/src/widgets/spacer.dart +++ b/packages/flutter/lib/src/widgets/spacer.dart @@ -41,7 +41,7 @@ class Spacer extends StatelessWidget { /// Creates a flexible space to insert into a [Flexible] widget. /// /// The [flex] parameter may not be null or less than one. - const Spacer({Key key, this.flex: 1}) + const Spacer({Key key, this.flex = 1}) : assert(flex != null), assert(flex > 0), super(key: key); diff --git a/packages/flutter/lib/src/widgets/table.dart b/packages/flutter/lib/src/widgets/table.dart index fcc51d341b..bf1766c4d1 100644 --- a/packages/flutter/lib/src/widgets/table.dart +++ b/packages/flutter/lib/src/widgets/table.dart @@ -95,12 +95,12 @@ class Table extends RenderObjectWidget { /// arguments must not be null. Table({ Key key, - this.children: const [], + this.children = const [], this.columnWidths, - this.defaultColumnWidth: const FlexColumnWidth(1.0), + this.defaultColumnWidth = const FlexColumnWidth(1.0), this.textDirection, this.border, - this.defaultVerticalAlignment: TableCellVerticalAlignment.top, + this.defaultVerticalAlignment = TableCellVerticalAlignment.top, this.textBaseline, }) : assert(children != null), assert(defaultColumnWidth != null), diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart index 4b97671573..bb7e85b8dc 100644 --- a/packages/flutter/lib/src/widgets/text.dart +++ b/packages/flutter/lib/src/widgets/text.dart @@ -26,8 +26,8 @@ class DefaultTextStyle extends InheritedWidget { Key key, @required this.style, this.textAlign, - this.softWrap: true, - this.overflow: TextOverflow.clip, + this.softWrap = true, + this.overflow = TextOverflow.clip, this.maxLines, @required Widget child, }) : assert(style != null), diff --git a/packages/flutter/lib/src/widgets/title.dart b/packages/flutter/lib/src/widgets/title.dart index 941029857e..dc0c63e918 100644 --- a/packages/flutter/lib/src/widgets/title.dart +++ b/packages/flutter/lib/src/widgets/title.dart @@ -17,7 +17,7 @@ class Title extends StatelessWidget { /// [color] and [child] are required arguments. Title({ Key key, - this.title: '', + this.title = '', @required this.color, @required this.child, }) : assert(title != null), diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index fc2af42477..4635fba5df 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -114,7 +114,7 @@ class SlideTransition extends AnimatedWidget { const SlideTransition({ Key key, @required Animation position, - this.transformHitTests: true, + this.transformHitTests = true, this.textDirection, this.child, }) : assert(position != null), @@ -175,7 +175,7 @@ class ScaleTransition extends AnimatedWidget { const ScaleTransition({ Key key, @required Animation scale, - this.alignment: Alignment.center, + this.alignment = Alignment.center, this.child, }) : super(key: key, listenable: scale); @@ -256,9 +256,9 @@ class SizeTransition extends AnimatedWidget { /// child along the main axis during the transition. const SizeTransition({ Key key, - this.axis: Axis.vertical, + this.axis = Axis.vertical, @required Animation sizeFactor, - this.axisAlignment: 0.0, + this.axisAlignment = 0.0, this.child, }) : assert(axis != null), super(key: key, listenable: sizeFactor); @@ -463,7 +463,7 @@ class DecoratedBoxTransition extends AnimatedWidget { const DecoratedBoxTransition({ Key key, @required this.decoration, - this.position: DecorationPosition.background, + this.position = DecorationPosition.background, @required this.child, }) : super(key: key, listenable: decoration); diff --git a/packages/flutter/lib/src/widgets/viewport.dart b/packages/flutter/lib/src/widgets/viewport.dart index 16f1ea8c4f..60a02d1d55 100644 --- a/packages/flutter/lib/src/widgets/viewport.dart +++ b/packages/flutter/lib/src/widgets/viewport.dart @@ -51,13 +51,13 @@ class Viewport extends MultiChildRenderObjectWidget { /// The [offset] argument must not be null. Viewport({ Key key, - this.axisDirection: AxisDirection.down, + this.axisDirection = AxisDirection.down, this.crossAxisDirection, - this.anchor: 0.0, + this.anchor = 0.0, @required this.offset, this.center, this.cacheExtent, - List slivers: const [], + List slivers = const [], }) : assert(offset != null), assert(slivers != null), assert(center == null || slivers.where((Widget child) => child.key == center).length == 1), @@ -250,10 +250,10 @@ class ShrinkWrappingViewport extends MultiChildRenderObjectWidget { /// The [offset] argument must not be null. ShrinkWrappingViewport({ Key key, - this.axisDirection: AxisDirection.down, + this.axisDirection = AxisDirection.down, this.crossAxisDirection, @required this.offset, - List slivers: const [], + List slivers = const [], }) : assert(offset != null), super(key: key, children: slivers); diff --git a/packages/flutter/lib/src/widgets/widget_inspector.dart b/packages/flutter/lib/src/widgets/widget_inspector.dart index 0a505d53fb..248f6107dd 100644 --- a/packages/flutter/lib/src/widgets/widget_inspector.dart +++ b/packages/flutter/lib/src/widgets/widget_inspector.dart @@ -109,11 +109,11 @@ class _InspectorReferenceData { class _SerializeConfig { _SerializeConfig({ @required this.groupName, - this.summaryTree: false, - this.subtreeDepth : 1, + this.summaryTree = false, + this.subtreeDepth = 1, this.pathToInclude, - this.includeProperties: false, - this.expandPropertyValues: true, + this.includeProperties = false, + this.expandPropertyValues = true, }); _SerializeConfig.merge( diff --git a/packages/flutter/test/cupertino/tab_scaffold_test.dart b/packages/flutter/test/cupertino/tab_scaffold_test.dart index 5ef397a3b7..67a8c8b7f7 100644 --- a/packages/flutter/test/cupertino/tab_scaffold_test.dart +++ b/packages/flutter/test/cupertino/tab_scaffold_test.dart @@ -294,7 +294,7 @@ void main() { }); } -CupertinoTabBar _buildTabBar({ int selectedTab: 0 }) { +CupertinoTabBar _buildTabBar({ int selectedTab = 0 }) { return new CupertinoTabBar( items: const [ const BottomNavigationBarItem( diff --git a/packages/flutter/test/foundation/diagnostics_test.dart b/packages/flutter/test/foundation/diagnostics_test.dart index 4288ef1220..e6e75ce617 100644 --- a/packages/flutter/test/foundation/diagnostics_test.dart +++ b/packages/flutter/test/foundation/diagnostics_test.dart @@ -12,8 +12,8 @@ class TestTree extends Object with DiagnosticableTreeMixin { TestTree({ this.name, this.style, - this.children: const [], - this.properties: const [], + this.children = const [], + this.properties = const [], }); final String name; diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart index 9368366c50..4f17a37968 100644 --- a/packages/flutter/test/material/app_bar_test.dart +++ b/packages/flutter/test/material/app_bar_test.dart @@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart'; import '../widgets/semantics_tester.dart'; -Widget buildSliverAppBarApp({ bool floating, bool pinned, double expandedHeight, bool snap: false }) { +Widget buildSliverAppBarApp({ bool floating, bool pinned, double expandedHeight, bool snap = false }) { return new Localizations( locale: const Locale('en', 'US'), delegates: const >[ diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index b642b0604f..058888ab34 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -61,8 +61,8 @@ double getEnableProgress(WidgetTester tester) => getRenderChip(tester)?.enableAn /// Adds the basic requirements for a Chip. Widget _wrapForChip({ Widget child, - TextDirection textDirection: TextDirection.ltr, - double textScaleFactor: 1.0, + TextDirection textDirection = TextDirection.ltr, + double textScaleFactor = 1.0, }) { return new MaterialApp( home: new Directionality( @@ -657,7 +657,7 @@ void main() { final UniqueKey labelKey = new UniqueKey(); final UniqueKey deleteButtonKey = new UniqueKey(); bool wasDeleted = false; - Future pushChip({bool deletable: false}) async { + Future pushChip({bool deletable = false}) async { return tester.pumpWidget( _wrapForChip( child: new Wrap( @@ -772,7 +772,7 @@ void main() { testWidgets('Selection with avatar works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = new UniqueKey(); - Future pushChip({Widget avatar, bool selectable: false}) async { + Future pushChip({Widget avatar, bool selectable = false}) async { return tester.pumpWidget( _wrapForChip( child: new Wrap( @@ -855,7 +855,7 @@ void main() { testWidgets('Selection without avatar works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = new UniqueKey(); - Future pushChip({bool selectable: false}) async { + Future pushChip({bool selectable = false}) async { return tester.pumpWidget( _wrapForChip( child: new Wrap( @@ -931,7 +931,7 @@ void main() { testWidgets('Activation works as expected on RawChip', (WidgetTester tester) async { bool selected = false; final UniqueKey labelKey = new UniqueKey(); - Future pushChip({Widget avatar, bool selectable: false}) async { + Future pushChip({Widget avatar, bool selectable = false}) async { return tester.pumpWidget( _wrapForChip( child: new Wrap( @@ -1028,10 +1028,10 @@ void main() { ChipThemeData chipTheme, Widget avatar, Widget deleteIcon, - bool isSelectable: true, - bool isPressable: false, - bool isDeletable: true, - bool showCheckmark: true, + bool isSelectable = true, + bool isPressable = false, + bool isDeletable = true, + bool showCheckmark = true, }) { chipTheme ??= defaultChipTheme; return _wrapForChip( diff --git a/packages/flutter/test/material/data_table_test.dart b/packages/flutter/test/material/data_table_test.dart index 456c35a95a..98224559de 100644 --- a/packages/flutter/test/material/data_table_test.dart +++ b/packages/flutter/test/material/data_table_test.dart @@ -11,7 +11,7 @@ void main() { testWidgets('DataTable control test', (WidgetTester tester) async { final List log = []; - Widget buildTable({ int sortColumnIndex, bool sortAscending: true }) { + Widget buildTable({ int sortColumnIndex, bool sortAscending = true }) { return new DataTable( sortColumnIndex: sortColumnIndex, sortAscending: sortAscending, diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index 1b8c99d9aa..f6b40c3500 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -20,13 +20,13 @@ final Type dropdownButtonType = new DropdownButton( Widget buildFrame({ Key buttonKey, - String value: 'two', + String value = 'two', ValueChanged onChanged, - bool isDense: false, + bool isDense = false, Widget hint, - List items: menuItems, - Alignment alignment: Alignment.center, - TextDirection textDirection: TextDirection.ltr, + List items = menuItems, + Alignment alignment = Alignment.center, + TextDirection textDirection = TextDirection.ltr, }) { return new TestApp( textDirection: textDirection, diff --git a/packages/flutter/test/material/feedback_test.dart b/packages/flutter/test/material/feedback_test.dart index c4470652b7..672fc2ff2f 100644 --- a/packages/flutter/test/material/feedback_test.dart +++ b/packages/flutter/test/material/feedback_test.dart @@ -205,8 +205,8 @@ void main () { class TestWidget extends StatelessWidget { const TestWidget({ - this.tapHandler: nullHandler, - this.longPressHandler: nullHandler, + this.tapHandler = nullHandler, + this.longPressHandler = nullHandler, }); final HandlerCreator tapHandler; diff --git a/packages/flutter/test/material/floating_action_button_location_test.dart b/packages/flutter/test/material/floating_action_button_location_test.dart index 96609a38ef..235cbab161 100644 --- a/packages/flutter/test/material/floating_action_button_location_test.dart +++ b/packages/flutter/test/material/floating_action_button_location_test.dart @@ -233,14 +233,14 @@ class _GeometryCachePainter extends CustomPainter { } Widget buildFrame({ - FloatingActionButton fab: const FloatingActionButton( + FloatingActionButton fab = const FloatingActionButton( onPressed: null, child: const Text('1'), ), FloatingActionButtonLocation location, _GeometryListener listener, - TextDirection textDirection: TextDirection.ltr, - EdgeInsets viewInsets: const EdgeInsets.only(bottom: 200.0), + TextDirection textDirection = TextDirection.ltr, + EdgeInsets viewInsets = const EdgeInsets.only(bottom: 200.0), Widget bab, }) { return new Directionality( diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 94b8cf6d50..d79bd48f1a 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -9,13 +9,13 @@ import 'package:flutter_test/flutter_test.dart'; import '../rendering/mock_canvas.dart'; Widget buildInputDecorator({ - InputDecoration decoration: const InputDecoration(), + InputDecoration decoration = const InputDecoration(), InputDecorationTheme inputDecorationTheme, - TextDirection textDirection: TextDirection.ltr, - bool isEmpty: false, - bool isFocused: false, + TextDirection textDirection = TextDirection.ltr, + bool isEmpty = false, + bool isFocused = false, TextStyle baseStyle, - Widget child: const Text( + Widget child = const Text( 'text', style: const TextStyle(fontFamily: 'Ahem', fontSize: 16.0), ), diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index 886e672352..1f697f7815 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -56,7 +56,7 @@ void main() { const double leftPadding = 10.0; const double rightPadding = 20.0; - Widget buildFrame({ bool dense: false, bool isTwoLine: false, bool isThreeLine: false, double textScaleFactor: 1.0, double subtitleScaleFactor }) { + Widget buildFrame({ bool dense = false, bool isTwoLine = false, bool isThreeLine = false, double textScaleFactor = 1.0, double subtitleScaleFactor }) { hasSubtitle = isTwoLine || isThreeLine; subtitleScaleFactor ??= textScaleFactor; return new MaterialApp( @@ -256,9 +256,9 @@ void main() { ThemeData theme; Widget buildFrame({ - bool enabled: true, - bool dense: false, - bool selected: false, + bool enabled = true, + bool dense = false, + bool selected = false, Color selectedColor, Color iconColor, Color textColor, diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart index 581de9202d..0472984404 100644 --- a/packages/flutter/test/material/material_test.dart +++ b/packages/flutter/test/material/material_test.dart @@ -18,7 +18,7 @@ class NotifyMaterial extends StatelessWidget { } Widget buildMaterial( - {double elevation: 0.0, Color shadowColor: const Color(0xFF00FF00)}) { + {double elevation = 0.0, Color shadowColor = const Color(0xFF00FF00)}) { return new Center( child: new SizedBox( height: 100.0, diff --git a/packages/flutter/test/material/page_selector_test.dart b/packages/flutter/test/material/page_selector_test.dart index ad351df599..0848d49e5c 100644 --- a/packages/flutter/test/material/page_selector_test.dart +++ b/packages/flutter/test/material/page_selector_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; const Color kSelectedColor = const Color(0xFF00FF00); const Color kUnselectedColor = Colors.transparent; -Widget buildFrame(TabController tabController, { Color color, Color selectedColor, double indicatorSize: 12.0 }) { +Widget buildFrame(TabController tabController, { Color color, Color selectedColor, double indicatorSize = 12.0 }) { return new Directionality( textDirection: TextDirection.ltr, child: new Theme( diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index 0429039728..eb300a78f8 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -1149,9 +1149,9 @@ class _ComputeNotchSetterState extends State<_ComputeNotchSetter> { class _CustomPageRoute extends PageRoute { _CustomPageRoute({ @required this.builder, - RouteSettings settings: const RouteSettings(), - this.maintainState: true, - bool fullscreenDialog: false, + RouteSettings settings = const RouteSettings(), + this.maintainState = true, + bool fullscreenDialog = false, }) : assert(builder != null), super(settings: settings, fullscreenDialog: fullscreenDialog); diff --git a/packages/flutter/test/material/search_test.dart b/packages/flutter/test/material/search_test.dart index 431a5f251c..8f0b11ad4e 100644 --- a/packages/flutter/test/material/search_test.dart +++ b/packages/flutter/test/material/search_test.dart @@ -423,7 +423,7 @@ class TestHomePage extends StatelessWidget { const TestHomePage({ this.results, this.delegate, - this.passInInitialQuery: false, + this.passInInitialQuery = false, this.initialQuery, }); @@ -472,9 +472,9 @@ class TestHomePage extends StatelessWidget { class _TestSearchDelegate extends SearchDelegate { _TestSearchDelegate({ - this.suggestions: 'Suggestions', - this.result: 'Result', - this.actions: const [], + this.suggestions = 'Suggestions', + this.result = 'Result', + this.actions = const [], }); final String suggestions; diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index 498aa98375..bef98fc223 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -550,7 +550,7 @@ void main() { Color activeColor, Color inactiveColor, int divisions, - bool enabled: true, + bool enabled = true, }) { final ValueChanged onChanged = !enabled ? null @@ -883,8 +883,8 @@ void main() { Widget buildSlider({ double textScaleFactor, - bool isDiscrete: true, - ShowValueIndicator show: ShowValueIndicator.onlyForDiscrete, + bool isDiscrete = true, + ShowValueIndicator show = ShowValueIndicator.onlyForDiscrete, }) { return new Directionality( textDirection: TextDirection.ltr, @@ -1162,7 +1162,7 @@ void main() { ); SliderThemeData theme = baseTheme.sliderTheme; double value = 0.45; - Widget buildApp({SliderThemeData sliderTheme, int divisions, bool enabled: true}) { + Widget buildApp({SliderThemeData sliderTheme, int divisions, bool enabled = true}) { final ValueChanged onChanged = enabled ? (double d) => value = d : null; return new Directionality( textDirection: TextDirection.ltr, @@ -1192,7 +1192,7 @@ void main() { bool isVisible, SliderThemeData theme, int divisions, - bool enabled: true, + bool enabled = true, }) async { // Discrete enabled widget. await tester.pumpWidget(buildApp(sliderTheme: theme, divisions: divisions, enabled: enabled)); diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index 1c1514d1ce..8cc3cb4278 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -170,7 +170,7 @@ void main() { double value = 0.45; Widget buildApp({ int divisions, - bool enabled: true, + bool enabled = true, }) { final ValueChanged onChanged = enabled ? (double d) => value = d : null; return new Directionality( diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 87fa40909f..0960c66451 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -12,7 +12,7 @@ import '../rendering/mock_canvas.dart'; import '../rendering/recording_canvas.dart'; import '../widgets/semantics_tester.dart'; -Widget boilerplate({ Widget child, TextDirection textDirection: TextDirection.ltr }) { +Widget boilerplate({ Widget child, TextDirection textDirection = TextDirection.ltr }) { return new Localizations( locale: const Locale('en', 'US'), delegates: const >[ @@ -52,7 +52,7 @@ Widget buildFrame({ Key tabBarKey, List tabs, String value, - bool isScrollable: false, + bool isScrollable = false, Color indicatorColor, }) { return boilerplate( @@ -72,7 +72,7 @@ Widget buildFrame({ typedef Widget TabControllerFrameBuilder(BuildContext context, TabController controller); class TabControllerFrame extends StatefulWidget { - const TabControllerFrame({ this.length, this.initialIndex: 0, this.builder }); + const TabControllerFrame({ this.length, this.initialIndex = 0, this.builder }); final int length; final int initialIndex; diff --git a/packages/flutter/test/material/text_field_splash_test.dart b/packages/flutter/test/material/text_field_splash_test.dart index b3896aff82..7686262c30 100644 --- a/packages/flutter/test/material/text_field_splash_test.dart +++ b/packages/flutter/test/material/text_field_splash_test.dart @@ -16,7 +16,7 @@ class TestInkSplash extends InkSplash { RenderBox referenceBox, Offset position, Color color, - bool containedInkWell: false, + bool containedInkWell = false, RectCallback rectCallback, BorderRadius borderRadius, double radius, @@ -55,7 +55,7 @@ class TestInkSplashFactory extends InteractiveInkFeatureFactory { RenderBox referenceBox, Offset position, Color color, - bool containedInkWell: false, + bool containedInkWell = false, RectCallback rectCallback, BorderRadius borderRadius, double radius, diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index 8bcfc7b8c5..ec02914152 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -469,7 +469,7 @@ class _TextStyleProxy implements TextStyle { } @override - TextStyle apply({Color color, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle, String fontFamily, double fontSizeFactor: 1.0, double fontSizeDelta: 0.0, int fontWeightDelta: 0, double letterSpacingFactor: 1.0, double letterSpacingDelta: 0.0, double wordSpacingFactor: 1.0, double wordSpacingDelta: 0.0, double heightFactor: 1.0, double heightDelta: 0.0}) { + TextStyle apply({Color color, TextDecoration decoration, Color decorationColor, TextDecorationStyle decorationStyle, String fontFamily, double fontSizeFactor = 1.0, double fontSizeDelta = 0.0, int fontWeightDelta = 0, double letterSpacingFactor = 1.0, double letterSpacingDelta = 0.0, double wordSpacingFactor = 1.0, double wordSpacingDelta = 0.0, double heightFactor = 1.0, double heightDelta = 0.0}) { throw new UnimplementedError(); } @@ -484,17 +484,17 @@ class _TextStyleProxy implements TextStyle { } @override - void debugFillProperties(DiagnosticPropertiesBuilder properties, {String prefix: ''}) { + void debugFillProperties(DiagnosticPropertiesBuilder properties, {String prefix = ''}) { throw new UnimplementedError(); } @override - ui.ParagraphStyle getParagraphStyle({TextAlign textAlign, TextDirection textDirection, double textScaleFactor: 1.0, String ellipsis, int maxLines, ui.Locale locale}) { + ui.ParagraphStyle getParagraphStyle({TextAlign textAlign, TextDirection textDirection, double textScaleFactor = 1.0, String ellipsis, int maxLines, ui.Locale locale}) { throw new UnimplementedError(); } @override - ui.TextStyle getTextStyle({double textScaleFactor: 1.0}) { + ui.TextStyle getTextStyle({double textScaleFactor = 1.0}) { throw new UnimplementedError(); } diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart index 7d3da6356d..d98a32afd3 100644 --- a/packages/flutter/test/material/time_picker_test.dart +++ b/packages/flutter/test/material/time_picker_test.dart @@ -224,7 +224,7 @@ void _tests() { const List labels00To23 = const ['00', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']; Future mediaQueryBoilerplate(WidgetTester tester, bool alwaysUse24HourFormat, - { TimeOfDay initialTime: const TimeOfDay(hour: 7, minute: 0) }) async { + { TimeOfDay initialTime = const TimeOfDay(hour: 7, minute: 0) }) async { await tester.pumpWidget( new Localizations( locale: const Locale('en', 'US'), diff --git a/packages/flutter/test/material/user_accounts_drawer_header_test.dart b/packages/flutter/test/material/user_accounts_drawer_header_test.dart index 2edbb29659..467e7ad00d 100644 --- a/packages/flutter/test/material/user_accounts_drawer_header_test.dart +++ b/packages/flutter/test/material/user_accounts_drawer_header_test.dart @@ -13,9 +13,9 @@ const Key avatarC = const Key('C'); const Key avatarD = const Key('D'); Future pumpTestWidget(WidgetTester tester, { - bool withName: true, - bool withEmail: true, - bool withOnDetailsPressedHandler: true, + bool withName = true, + bool withEmail = true, + bool withOnDetailsPressedHandler = true, }) async { await tester.pumpWidget( new MaterialApp( diff --git a/packages/flutter/test/painting/decoration_test.dart b/packages/flutter/test/painting/decoration_test.dart index 9461813807..65907955df 100644 --- a/packages/flutter/test/painting/decoration_test.dart +++ b/packages/flutter/test/painting/decoration_test.dart @@ -155,7 +155,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/7289. // A reference test would be better. test('BoxDecoration backgroundImage clip', () { - void testDecoration({ BoxShape shape: BoxShape.rectangle, BorderRadius borderRadius, bool expectClip}) { + void testDecoration({ BoxShape shape = BoxShape.rectangle, BorderRadius borderRadius, bool expectClip}) { assert(shape != null); new FakeAsync().run((FakeAsync async) { final DelayedImageProvider imageProvider = new DelayedImageProvider(); diff --git a/packages/flutter/test/painting/fake_image_provider.dart b/packages/flutter/test/painting/fake_image_provider.dart index 2a07b9cc25..1aa1521259 100644 --- a/packages/flutter/test/painting/fake_image_provider.dart +++ b/packages/flutter/test/painting/fake_image_provider.dart @@ -13,7 +13,7 @@ import 'package:flutter/painting.dart'; /// providers is to resolve some data and instantiate a [ui.Codec] from it). class FakeImageProvider extends ImageProvider { - const FakeImageProvider(this._codec, { this.scale: 1.0 }); + const FakeImageProvider(this._codec, { this.scale = 1.0 }); final ui.Codec _codec; diff --git a/packages/flutter/test/rendering/mock_canvas.dart b/packages/flutter/test/rendering/mock_canvas.dart index 856d614c12..b7b57f01f5 100644 --- a/packages/flutter/test/rendering/mock_canvas.dart +++ b/packages/flutter/test/rendering/mock_canvas.dart @@ -420,8 +420,8 @@ abstract class PaintPattern { /// Matches a [Path] that contains (as defined by [Path.contains]) the given /// `includes` points and does not contain the given `excludes` points. Matcher isPathThat({ - Iterable includes: const [], - Iterable excludes: const [], + Iterable includes = const [], + Iterable excludes = const [], }) { return new _PathMatcher(includes.toList(), excludes.toList()); } diff --git a/packages/flutter/test/rendering/mutations_test.dart b/packages/flutter/test/rendering/mutations_test.dart index 4a1c09ad09..33c90a1255 100644 --- a/packages/flutter/test/rendering/mutations_test.dart +++ b/packages/flutter/test/rendering/mutations_test.dart @@ -14,7 +14,7 @@ class RenderLayoutTestBox extends RenderProxyBox { final VoidCallback onLayout; @override - void layout(Constraints constraints, { bool parentUsesSize: false }) { + void layout(Constraints constraints, { bool parentUsesSize = false }) { // Doing this in tests is ok, but if you're writing your own // render object, you want to override performLayout(), not // layout(). Overriding layout() would remove many critical diff --git a/packages/flutter/test/rendering/recording_canvas.dart b/packages/flutter/test/rendering/recording_canvas.dart index 4bf3fe8ebe..952fbdc82d 100644 --- a/packages/flutter/test/rendering/recording_canvas.dart +++ b/packages/flutter/test/rendering/recording_canvas.dart @@ -28,7 +28,7 @@ class RecordedInvocation { String toString() => _describeInvocation(invocation); /// Converts [stack] to a string using the [FlutterError.defaultStackFilter] logic. - String stackToString({ String indent: '' }) { + String stackToString({ String indent = '' }) { assert(indent != null); return indent + FlutterError.defaultStackFilter( stack.toString().trimRight().split('\n') diff --git a/packages/flutter/test/rendering/rendering_tester.dart b/packages/flutter/test/rendering/rendering_tester.dart index bbd79d49b0..5cb28a574f 100644 --- a/packages/flutter/test/rendering/rendering_tester.dart +++ b/packages/flutter/test/rendering/rendering_tester.dart @@ -57,8 +57,8 @@ TestRenderingFlutterBinding get renderer { /// has no build phase. void layout(RenderBox box, { BoxConstraints constraints, - Alignment alignment: Alignment.center, - EnginePhase phase: EnginePhase.layout, + Alignment alignment = Alignment.center, + EnginePhase phase = EnginePhase.layout, }) { assert(box != null); // If you want to just repump the last box, call pumpFrame(). assert(box.parent == null); // We stick the box in another, so you can't reuse it easily, sorry. @@ -78,7 +78,7 @@ void layout(RenderBox box, { pumpFrame(phase: phase); } -void pumpFrame({ EnginePhase phase: EnginePhase.layout }) { +void pumpFrame({ EnginePhase phase = EnginePhase.layout }) { assert(renderer != null); assert(renderer.renderView != null); assert(renderer.renderView.child != null); // call layout() first! diff --git a/packages/flutter/test/semantics/semantics_test.dart b/packages/flutter/test/semantics/semantics_test.dart index 83d567a516..0fad7ffe9e 100644 --- a/packages/flutter/test/semantics/semantics_test.dart +++ b/packages/flutter/test/semantics/semantics_test.dart @@ -490,12 +490,12 @@ void main() { class TestRender extends RenderProxyBox { TestRender({ - this.hasTapAction: false, - this.hasLongPressAction: false, - this.hasScrollLeftAction: false, - this.hasScrollRightAction: false, - this.hasScrollUpAction: false, - this.hasScrollDownAction: false, + this.hasTapAction = false, + this.hasLongPressAction = false, + this.hasScrollLeftAction = false, + this.hasScrollRightAction = false, + this.hasScrollUpAction = false, + this.hasScrollDownAction = false, this.isSemanticBoundary, RenderObject child }) : super(child); diff --git a/packages/flutter/test/widgets/animated_cross_fade_test.dart b/packages/flutter/test/widgets/animated_cross_fade_test.dart index bb23cb2664..d7ad60937c 100644 --- a/packages/flutter/test/widgets/animated_cross_fade_test.dart +++ b/packages/flutter/test/widgets/animated_cross_fade_test.dart @@ -263,7 +263,7 @@ void main() { expect(box2.localToGlobal(Offset.zero), const Offset(325.0, 175.0)); }); - Widget crossFadeWithWatcher({bool towardsSecond: false}) { + Widget crossFadeWithWatcher({bool towardsSecond = false}) { return new Directionality( textDirection: TextDirection.ltr, child: new AnimatedCrossFade( diff --git a/packages/flutter/test/widgets/dismissible_test.dart b/packages/flutter/test/widgets/dismissible_test.dart index ab465e5851..e856064425 100644 --- a/packages/flutter/test/widgets/dismissible_test.dart +++ b/packages/flutter/test/widgets/dismissible_test.dart @@ -14,7 +14,7 @@ List dismissedItems = []; Widget background; const double crossAxisEndOffset = 0.5; -Widget buildTest({ double startToEndThreshold, TextDirection textDirection: TextDirection.ltr }) { +Widget buildTest({ double startToEndThreshold, TextDirection textDirection = TextDirection.ltr }) { return new Directionality( textDirection: textDirection, child: new StatefulBuilder( @@ -98,7 +98,7 @@ Future dismissElement(WidgetTester tester, Finder finder, { @required Axis await gesture.up(); } -Future flingElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection, double initialOffsetFactor: 0.0 }) async { +Future flingElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection, double initialOffsetFactor = 0.0 }) async { Offset delta; switch (gestureDirection) { case AxisDirection.left: @@ -129,7 +129,7 @@ Future flingElementFromZero(WidgetTester tester, Finder finder, { @require Future dismissItem(WidgetTester tester, int item, { @required AxisDirection gestureDirection, - DismissMethod mechanism: dismissElement, + DismissMethod mechanism = dismissElement, }) async { assert(gestureDirection != null); final Finder itemFinder = find.text(item.toString()); @@ -146,7 +146,7 @@ Future dismissItem(WidgetTester tester, int item, { Future checkFlingItemBeforeMovementEnd(WidgetTester tester, int item, { @required AxisDirection gestureDirection, - DismissMethod mechanism: rollbackElement + DismissMethod mechanism = rollbackElement }) async { assert(gestureDirection != null); final Finder itemFinder = find.text(item.toString()); @@ -160,7 +160,7 @@ Future checkFlingItemBeforeMovementEnd(WidgetTester tester, int item, { Future checkFlingItemAfterMovement(WidgetTester tester, int item, { @required AxisDirection gestureDirection, - DismissMethod mechanism: rollbackElement + DismissMethod mechanism = rollbackElement }) async { assert(gestureDirection != null); final Finder itemFinder = find.text(item.toString()); @@ -172,7 +172,7 @@ Future checkFlingItemAfterMovement(WidgetTester tester, int item, { await tester.pump(const Duration(milliseconds: 300)); } -Future rollbackElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection, double initialOffsetFactor: 0.0 }) async { +Future rollbackElement(WidgetTester tester, Finder finder, { @required AxisDirection gestureDirection, double initialOffsetFactor = 0.0 }) async { Offset delta; switch (gestureDirection) { case AxisDirection.left: diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index 40da011982..13793c1614 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -1641,7 +1641,7 @@ void main() { }); } -Future _testChildAnchorFeedbackPosition({WidgetTester tester, double top: 0.0, double left: 0.0}) async { +Future _testChildAnchorFeedbackPosition({WidgetTester tester, double top = 0.0, double left = 0.0}) async { final List accepted = []; int dragStartedCount = 0; diff --git a/packages/flutter/test/widgets/ensure_visible_test.dart b/packages/flutter/test/widgets/ensure_visible_test.dart index aae6c7122b..fb88890c62 100644 --- a/packages/flutter/test/widgets/ensure_visible_test.dart +++ b/packages/flutter/test/widgets/ensure_visible_test.dart @@ -10,7 +10,7 @@ import 'package:flutter/widgets.dart'; Finder findKey(int i) => find.byKey(new ValueKey(i)); -Widget buildSingleChildScrollView(Axis scrollDirection, { bool reverse: false }) { +Widget buildSingleChildScrollView(Axis scrollDirection, { bool reverse = false }) { return new Directionality( textDirection: TextDirection.ltr, child: new Center( @@ -38,7 +38,7 @@ Widget buildSingleChildScrollView(Axis scrollDirection, { bool reverse: false }) ); } -Widget buildListView(Axis scrollDirection, { bool reverse: false, bool shrinkWrap: false }) { +Widget buildListView(Axis scrollDirection, { bool reverse = false, bool shrinkWrap = false }) { return new Directionality( textDirection: TextDirection.ltr, child: new Center( diff --git a/packages/flutter/test/widgets/focus_test.dart b/packages/flutter/test/widgets/focus_test.dart index f7cc9824f7..688cc5112c 100644 --- a/packages/flutter/test/widgets/focus_test.dart +++ b/packages/flutter/test/widgets/focus_test.dart @@ -10,7 +10,7 @@ class TestFocusable extends StatefulWidget { Key key, this.no, this.yes, - this.autofocus: true, + this.autofocus = true, }) : super(key: key); final String no; diff --git a/packages/flutter/test/widgets/heroes_test.dart b/packages/flutter/test/widgets/heroes_test.dart index 7ed838ddbe..f3b6a03809 100644 --- a/packages/flutter/test/widgets/heroes_test.dart +++ b/packages/flutter/test/widgets/heroes_test.dart @@ -109,7 +109,7 @@ class MutatingRoute extends MaterialPageRoute { } class MyStatefulWidget extends StatefulWidget { - const MyStatefulWidget({ Key key, this.value: '123' }) : super(key: key); + const MyStatefulWidget({ Key key, this.value = '123' }) : super(key: key); final String value; @override MyStatefulWidgetState createState() => new MyStatefulWidgetState(); diff --git a/packages/flutter/test/widgets/image_resolution_test.dart b/packages/flutter/test/widgets/image_resolution_test.dart index 7790b324d1..08a1e404da 100644 --- a/packages/flutter/test/widgets/image_resolution_test.dart +++ b/packages/flutter/test/widgets/image_resolution_test.dart @@ -52,7 +52,7 @@ const String testManifest = ''' '''; class TestAssetBundle extends CachingAssetBundle { - TestAssetBundle({ this.manifest: testManifest }); + TestAssetBundle({ this.manifest = testManifest }); final String manifest; @@ -83,7 +83,7 @@ class TestAssetBundle extends CachingAssetBundle { } @override - Future loadString(String key, { bool cache: true }) { + Future loadString(String key, { bool cache = true }) { if (key == 'AssetManifest.json') return new SynchronousFuture(manifest); return null; diff --git a/packages/flutter/test/widgets/independent_widget_layout_test.dart b/packages/flutter/test/widgets/independent_widget_layout_test.dart index e23f80fdc6..e87d5616ce 100644 --- a/packages/flutter/test/widgets/independent_widget_layout_test.dart +++ b/packages/flutter/test/widgets/independent_widget_layout_test.dart @@ -100,7 +100,7 @@ class TestFocusable extends StatefulWidget { const TestFocusable({ Key key, this.focusNode, - this.autofocus: true, + this.autofocus = true, }) : super(key: key); final bool autofocus; diff --git a/packages/flutter/test/widgets/inherited_test.dart b/packages/flutter/test/widgets/inherited_test.dart index 99cb5c8180..d7704485f9 100644 --- a/packages/flutter/test/widgets/inherited_test.dart +++ b/packages/flutter/test/widgets/inherited_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'test_widgets.dart'; class TestInherited extends InheritedWidget { - const TestInherited({ Key key, Widget child, this.shouldNotify: true }) + const TestInherited({ Key key, Widget child, this.shouldNotify = true }) : super(key: key, child: child); final bool shouldNotify; diff --git a/packages/flutter/test/widgets/list_view_builder_test.dart b/packages/flutter/test/widgets/list_view_builder_test.dart index 384de2ad71..4d59b39ae3 100644 --- a/packages/flutter/test/widgets/list_view_builder_test.dart +++ b/packages/flutter/test/widgets/list_view_builder_test.dart @@ -263,7 +263,7 @@ void main() { } -void check({List visible: const [], List hidden: const []}) { +void check({List visible = const [], List hidden = const []}) { for (int i in visible) { expect(find.text('$i'), findsOneWidget); } diff --git a/packages/flutter/test/widgets/list_view_horizontal_test.dart b/packages/flutter/test/widgets/list_view_horizontal_test.dart index ca69672a8e..7d5ec4f6c6 100644 --- a/packages/flutter/test/widgets/list_view_horizontal_test.dart +++ b/packages/flutter/test/widgets/list_view_horizontal_test.dart @@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart'; const List items = const [0, 1, 2, 3, 4, 5]; -Widget buildFrame({ bool reverse: false, @required TextDirection textDirection }) { +Widget buildFrame({ bool reverse = false, @required TextDirection textDirection }) { return new Directionality( textDirection: textDirection, child: new Center( diff --git a/packages/flutter/test/widgets/list_view_misc_test.dart b/packages/flutter/test/widgets/list_view_misc_test.dart index d3ed59acce..9034bad859 100644 --- a/packages/flutter/test/widgets/list_view_misc_test.dart +++ b/packages/flutter/test/widgets/list_view_misc_test.dart @@ -72,7 +72,7 @@ void main() { int first = 0; int second = 0; - Widget buildBlock({ bool reverse: false }) { + Widget buildBlock({ bool reverse = false }) { return new Directionality( textDirection: TextDirection.ltr, child: new ListView( diff --git a/packages/flutter/test/widgets/nested_scroll_view_test.dart b/packages/flutter/test/widgets/nested_scroll_view_test.dart index 956a1e66d3..563f354186 100644 --- a/packages/flutter/test/widgets/nested_scroll_view_test.dart +++ b/packages/flutter/test/widgets/nested_scroll_view_test.dart @@ -22,7 +22,7 @@ class _CustomPhysics extends ClampingScrollPhysics { } } -Widget buildTest({ ScrollController controller, String title:'TTTTTTTT' }) { +Widget buildTest({ ScrollController controller, String title ='TTTTTTTT' }) { return new Localizations( locale: const Locale('en', 'US'), delegates: const >[ diff --git a/packages/flutter/test/widgets/page_forward_transitions_test.dart b/packages/flutter/test/widgets/page_forward_transitions_test.dart index ffb087b859..8915f88927 100644 --- a/packages/flutter/test/widgets/page_forward_transitions_test.dart +++ b/packages/flutter/test/widgets/page_forward_transitions_test.dart @@ -57,7 +57,7 @@ void main() { final GlobalKey insideKey = new GlobalKey(); - String state({ bool skipOffstage: true }) { + String state({ bool skipOffstage = true }) { String result = ''; if (tester.any(find.text('A', skipOffstage: skipOffstage))) result += 'A'; diff --git a/packages/flutter/test/widgets/pageable_list_test.dart b/packages/flutter/test/widgets/pageable_list_test.dart index ebf3242a5a..7eee4fe7cf 100644 --- a/packages/flutter/test/widgets/pageable_list_test.dart +++ b/packages/flutter/test/widgets/pageable_list_test.dart @@ -22,8 +22,8 @@ Widget buildPage(int page) { } Widget buildFrame({ - bool reverse: false, - List pages: defaultPages, + bool reverse = false, + List pages = defaultPages, @required TextDirection textDirection, }) { final PageView child = new PageView( diff --git a/packages/flutter/test/widgets/scrollable_semantics_test.dart b/packages/flutter/test/widgets/scrollable_semantics_test.dart index 0f6ecddb8c..9f644d0d1d 100644 --- a/packages/flutter/test/widgets/scrollable_semantics_test.dart +++ b/packages/flutter/test/widgets/scrollable_semantics_test.dart @@ -583,13 +583,13 @@ void main() { } -Future flingUp(WidgetTester tester, { int repetitions: 1 }) => fling(tester, const Offset(0.0, -200.0), repetitions); +Future flingUp(WidgetTester tester, { int repetitions = 1 }) => fling(tester, const Offset(0.0, -200.0), repetitions); -Future flingDown(WidgetTester tester, { int repetitions: 1 }) => fling(tester, const Offset(0.0, 200.0), repetitions); +Future flingDown(WidgetTester tester, { int repetitions = 1 }) => fling(tester, const Offset(0.0, 200.0), repetitions); -Future flingRight(WidgetTester tester, { int repetitions: 1 }) => fling(tester, const Offset(200.0, 0.0), repetitions); +Future flingRight(WidgetTester tester, { int repetitions = 1 }) => fling(tester, const Offset(200.0, 0.0), repetitions); -Future flingLeft(WidgetTester tester, { int repetitions: 1 }) => fling(tester, const Offset(-200.0, 0.0), repetitions); +Future flingLeft(WidgetTester tester, { int repetitions = 1 }) => fling(tester, const Offset(-200.0, 0.0), repetitions); Future fling(WidgetTester tester, Offset offset, int repetitions) async { while (repetitions-- > 0) { diff --git a/packages/flutter/test/widgets/semantics_6_test.dart b/packages/flutter/test/widgets/semantics_6_test.dart index 123d926ef1..f078fe9f3a 100644 --- a/packages/flutter/test/widgets/semantics_6_test.dart +++ b/packages/flutter/test/widgets/semantics_6_test.dart @@ -49,7 +49,7 @@ void main() { }); } -Widget buildWidget({ @required String blockedText, bool blocking: true }) { +Widget buildWidget({ @required String blockedText, bool blocking = true }) { assert(blockedText != null); return new Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/semantics_tester.dart b/packages/flutter/test/widgets/semantics_tester.dart index b14363cf19..f183870e08 100644 --- a/packages/flutter/test/widgets/semantics_tester.dart +++ b/packages/flutter/test/widgets/semantics_tester.dart @@ -36,18 +36,18 @@ class TestSemantics { /// pixels, useful for other full-screen widgets. TestSemantics({ this.id, - this.flags: 0, - this.actions: 0, - this.label: '', - this.value: '', - this.increasedValue: '', - this.decreasedValue: '', - this.hint: '', + this.flags = 0, + this.actions = 0, + this.label = '', + this.value = '', + this.increasedValue = '', + this.decreasedValue = '', + this.hint = '', this.textDirection, this.rect, this.transform, this.textSelection, - this.children: const [], + this.children = const [], Iterable tags, }) : assert(flags is int || flags is List), assert(actions is int || actions is List), @@ -62,17 +62,17 @@ class TestSemantics { /// Creates an object with some test semantics data, with the [id] and [rect] /// set to the appropriate values for the root node. TestSemantics.root({ - this.flags: 0, - this.actions: 0, - this.label: '', - this.value: '', - this.increasedValue: '', - this.decreasedValue: '', - this.hint: '', + this.flags = 0, + this.actions = 0, + this.label = '', + this.value = '', + this.increasedValue = '', + this.decreasedValue = '', + this.hint = '', this.textDirection, this.transform, this.textSelection, - this.children: const [], + this.children = const [], Iterable tags, }) : id = 0, assert(flags is int || flags is List), @@ -97,18 +97,18 @@ class TestSemantics { /// an 800x600 rectangle, which is the test screen's size in logical pixels. TestSemantics.rootChild({ this.id, - this.flags: 0, - this.actions: 0, - this.label: '', - this.hint: '', - this.value: '', - this.increasedValue: '', - this.decreasedValue: '', + this.flags = 0, + this.actions = 0, + this.label = '', + this.hint = '', + this.value = '', + this.increasedValue = '', + this.decreasedValue = '', this.textDirection, this.rect, Matrix4 transform, this.textSelection, - this.children: const [], + this.children = const [], Iterable tags, }) : assert(flags is int || flags is List), assert(actions is int || actions is List), @@ -219,10 +219,10 @@ class TestSemantics { SemanticsNode node, Map matchState, { - bool ignoreRect: false, - bool ignoreTransform: false, - bool ignoreId: false, - DebugSemanticsDumpOrder childOrder: DebugSemanticsDumpOrder.inverseHitTest, + bool ignoreRect = false, + bool ignoreTransform = false, + bool ignoreId = false, + DebugSemanticsDumpOrder childOrder = DebugSemanticsDumpOrder.inverseHitTest, } ) { final SemanticsData nodeData = node.getSemanticsData(); @@ -618,10 +618,10 @@ class _HasSemantics extends Matcher { /// Asserts that a [SemanticsTester] has a semantics tree that exactly matches the given semantics. Matcher hasSemantics(TestSemantics semantics, { - bool ignoreRect: false, - bool ignoreTransform: false, - bool ignoreId: false, - DebugSemanticsDumpOrder childOrder: DebugSemanticsDumpOrder.traversalOrder, + bool ignoreRect = false, + bool ignoreTransform = false, + bool ignoreId = false, + DebugSemanticsDumpOrder childOrder = DebugSemanticsDumpOrder.traversalOrder, }) { return new _HasSemantics( semantics, diff --git a/packages/flutter/test/widgets/single_child_scroll_view_test.dart b/packages/flutter/test/widgets/single_child_scroll_view_test.dart index 126d3dee43..c543f9bee7 100644 --- a/packages/flutter/test/widgets/single_child_scroll_view_test.dart +++ b/packages/flutter/test/widgets/single_child_scroll_view_test.dart @@ -13,7 +13,7 @@ class TestScrollPosition extends ScrollPositionWithSingleContext { TestScrollPosition({ ScrollPhysics physics, ScrollContext state, - double initialPixels: 0.0, + double initialPixels = 0.0, ScrollPosition oldPosition, }) : super( physics: physics, diff --git a/packages/flutter/test/widgets/sliver_list_test.dart b/packages/flutter/test/widgets/sliver_list_test.dart index 8d88026e3c..2ab12ac8eb 100644 --- a/packages/flutter/test/widgets/sliver_list_test.dart +++ b/packages/flutter/test/widgets/sliver_list_test.dart @@ -147,10 +147,10 @@ void main() { } Widget _buildSliverList({ - List items: const [], + List items = const [], ScrollController controller, - double itemHeight: 500.0, - double viewportHeight: 300.0, + double itemHeight = 500.0, + double viewportHeight = 300.0, }) { return new Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/slivers_test.dart b/packages/flutter/test/widgets/slivers_test.dart index 7fafa8c1cb..d5a78e7fa7 100644 --- a/packages/flutter/test/widgets/slivers_test.dart +++ b/packages/flutter/test/widgets/slivers_test.dart @@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter/rendering.dart'; -Future test(WidgetTester tester, double offset, { double anchor: 0.0 }) { +Future test(WidgetTester tester, double offset, { double anchor = 0.0 }) { return tester.pumpWidget( new Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/test_widgets.dart b/packages/flutter/test/widgets/test_widgets.dart index e0b8356548..4d51dfa511 100644 --- a/packages/flutter/test/widgets/test_widgets.dart +++ b/packages/flutter/test/widgets/test_widgets.dart @@ -54,6 +54,6 @@ class FlipWidgetState extends State { } } -void flipStatefulWidget(WidgetTester tester, { bool skipOffstage: true }) { +void flipStatefulWidget(WidgetTester tester, { bool skipOffstage = true }) { tester.state(find.byType(FlipWidget, skipOffstage: skipOffstage)).flip(); } diff --git a/packages/flutter_driver/lib/src/common/gesture.dart b/packages/flutter_driver/lib/src/common/gesture.dart index 63312ab91e..9c954f0978 100644 --- a/packages/flutter_driver/lib/src/common/gesture.dart +++ b/packages/flutter_driver/lib/src/common/gesture.dart @@ -90,7 +90,7 @@ class ScrollResult extends Result { class ScrollIntoView extends CommandWithTarget { /// Creates this command given a [finder] used to locate the widget to be /// scrolled into view. - ScrollIntoView(SerializableFinder finder, { this.alignment: 0.0, Duration timeout }) : super(finder, timeout: timeout); + ScrollIntoView(SerializableFinder finder, { this.alignment = 0.0, Duration timeout }) : super(finder, timeout: timeout); /// Deserializes this command from the value generated by [serialize]. ScrollIntoView.deserialize(Map json) diff --git a/packages/flutter_driver/lib/src/driver/driver.dart b/packages/flutter_driver/lib/src/driver/driver.dart index a0602c5773..58a473691b 100644 --- a/packages/flutter_driver/lib/src/driver/driver.dart +++ b/packages/flutter_driver/lib/src/driver/driver.dart @@ -122,8 +122,8 @@ class FlutterDriver { this._serviceClient, this._peer, this._appIsolate, { - bool printCommunication: false, - bool logCommunicationToFile: true, + bool printCommunication = false, + bool logCommunicationToFile = true, }) : _printCommunication = printCommunication, _logCommunicationToFile = logCommunicationToFile, _driverId = _nextDriverId++; @@ -157,10 +157,10 @@ class FlutterDriver { /// service we will wait for the first isolate to become runnable. static Future connect({ String dartVmServiceUrl, - bool printCommunication: false, - bool logCommunicationToFile: true, + bool printCommunication = false, + bool logCommunicationToFile = true, int isolateNumber, - Duration isolateReadyTimeout: _kIsolateLoadRunnableTimeout, + Duration isolateReadyTimeout = _kIsolateLoadRunnableTimeout, }) async { dartVmServiceUrl ??= Platform.environment['VM_SERVICE_URL']; @@ -427,7 +427,7 @@ class FlutterDriver { /// /// The move events are generated at a given [frequency] in Hz (or events per /// second). It defaults to 60Hz. - Future scroll(SerializableFinder finder, double dx, double dy, Duration duration, { int frequency: 60, Duration timeout }) async { + Future scroll(SerializableFinder finder, double dx, double dy, Duration duration, { int frequency = 60, Duration timeout }) async { return await _sendCommand(new Scroll(finder, dx, dy, duration, frequency, timeout: timeout)).then((Map _) => null); } @@ -438,7 +438,7 @@ class FlutterDriver { /// that lazily creates its children, like [ListView] or [CustomScrollView], /// then this method may fail because [finder] doesn't actually exist. /// The [scrollUntilVisible] method can be used in this case. - Future scrollIntoView(SerializableFinder finder, { double alignment: 0.0, Duration timeout }) async { + Future scrollIntoView(SerializableFinder finder, { double alignment = 0.0, Duration timeout }) async { return await _sendCommand(new ScrollIntoView(finder, alignment: alignment, timeout: timeout)).then((Map _) => null); } @@ -465,10 +465,10 @@ class FlutterDriver { /// The [timeout] value should be long enough to accommodate as many scrolls /// as needed to bring an item into view. The default is 10 seconds. Future scrollUntilVisible(SerializableFinder scrollable, SerializableFinder item, { - double alignment: 0.0, - double dxScroll: 0.0, - double dyScroll: 0.0, - Duration timeout: const Duration(seconds: 10), + double alignment = 0.0, + double dxScroll = 0.0, + double dyScroll = 0.0, + Duration timeout = const Duration(seconds: 10), }) async { assert(scrollable != null); assert(item != null); @@ -565,7 +565,7 @@ class FlutterDriver { /// /// Returns true when the call actually changed the state from on to off or /// vice versa. - Future setSemantics(bool enabled, { Duration timeout: _kShortTimeout }) async { + Future setSemantics(bool enabled, { Duration timeout = _kShortTimeout }) async { final SetSemanticsResult result = SetSemanticsResult.fromJson(await _sendCommand(new SetSemantics(enabled, timeout: timeout))); return result.changedState; } @@ -632,15 +632,15 @@ class FlutterDriver { /// ] /// /// [getFlagList]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#getflaglist - Future>> getVmFlags({ Duration timeout: _kShortTimeout }) async { + Future>> getVmFlags({ Duration timeout = _kShortTimeout }) async { final Map result = await _peer.sendRequest('getFlagList').timeout(timeout); return result['flags']; } /// Starts recording performance traces. Future startTracing({ - List streams: _defaultStreams, - Duration timeout: _kShortTimeout, + List streams = _defaultStreams, + Duration timeout = _kShortTimeout, }) async { assert(streams != null && streams.isNotEmpty); try { @@ -658,7 +658,7 @@ class FlutterDriver { } /// Stops recording performance traces and downloads the timeline. - Future stopTracingAndDownloadTimeline({ Duration timeout: _kShortTimeout }) async { + Future stopTracingAndDownloadTimeline({ Duration timeout = _kShortTimeout }) async { try { await _peer .sendRequest(_setVMTimelineFlagsMethodName, {'recordedStreams': '[]'}) @@ -689,8 +689,8 @@ class FlutterDriver { /// default, prior events are cleared. Future traceAction( Future action(), { - List streams: _defaultStreams, - bool retainPriorEvents: false, + List streams = _defaultStreams, + bool retainPriorEvents = false, }) async { if (!retainPriorEvents) { await clearTimeline(); @@ -701,7 +701,7 @@ class FlutterDriver { } /// Clears all timeline events recorded up until now. - Future clearTimeline({ Duration timeout: _kShortTimeout }) async { + Future clearTimeline({ Duration timeout = _kShortTimeout }) async { try { await _peer .sendRequest(_clearVMTimelineMethodName, {}) diff --git a/packages/flutter_driver/lib/src/driver/timeline_summary.dart b/packages/flutter_driver/lib/src/driver/timeline_summary.dart index 7e90be1340..051a73d796 100644 --- a/packages/flutter_driver/lib/src/driver/timeline_summary.dart +++ b/packages/flutter_driver/lib/src/driver/timeline_summary.dart @@ -92,7 +92,7 @@ class TimelineSummary { Future writeTimelineToFile( String traceName, { String destinationDirectory, - bool pretty: false, + bool pretty = false, }) async { destinationDirectory ??= testOutputsDirectory; await fs.directory(destinationDirectory).create(recursive: true); @@ -104,7 +104,7 @@ class TimelineSummary { Future writeSummaryToFile( String traceName, { String destinationDirectory, - bool pretty: false, + bool pretty = false, }) async { destinationDirectory ??= testOutputsDirectory; await fs.directory(destinationDirectory).create(recursive: true); diff --git a/packages/flutter_driver/lib/src/extension/extension.dart b/packages/flutter_driver/lib/src/extension/extension.dart index fbad12d719..fb68e0de9c 100644 --- a/packages/flutter_driver/lib/src/extension/extension.dart +++ b/packages/flutter_driver/lib/src/extension/extension.dart @@ -178,7 +178,7 @@ class FlutterDriverExtension { } } - Map _makeResponse(dynamic response, {bool isError: false}) { + Map _makeResponse(dynamic response, {bool isError = false}) { return { 'isError': isError, 'response': response, diff --git a/packages/flutter_driver/test/flutter_driver_test.dart b/packages/flutter_driver/test/flutter_driver_test.dart index 9e2eb40b20..c5741f21bb 100644 --- a/packages/flutter_driver/test/flutter_driver_test.dart +++ b/packages/flutter_driver/test/flutter_driver_test.dart @@ -388,7 +388,7 @@ void main() { } Future> makeMockResponse( - Map response, {bool isError: false}) { + Map response, {bool isError = false}) { return new Future>.value({ 'isError': isError, 'response': response diff --git a/packages/flutter_goldens/lib/flutter_goldens.dart b/packages/flutter_goldens/lib/flutter_goldens.dart index 9606d40b92..5f960788a1 100644 --- a/packages/flutter_goldens/lib/flutter_goldens.dart +++ b/packages/flutter_goldens/lib/flutter_goldens.dart @@ -46,7 +46,7 @@ class FlutterGoldenFileComparator implements GoldenFileComparator { @visibleForTesting FlutterGoldenFileComparator( this.basedir, { - this.fs: const LocalFileSystem(), + this.fs = const LocalFileSystem(), }); /// The directory to which golden file URIs will be resolved in [compare] and [update]. @@ -111,9 +111,9 @@ class FlutterGoldenFileComparator implements GoldenFileComparator { class GoldensClient { /// Create a handle to a local clone of the goldens repository. GoldensClient({ - this.fs: const LocalFileSystem(), - this.platform: const LocalPlatform(), - this.process: const LocalProcessManager(), + this.fs = const LocalFileSystem(), + this.platform = const LocalPlatform(), + this.process = const LocalProcessManager(), }); /// The file system to use for storing the local clone of the repository. diff --git a/packages/flutter_localizations/lib/src/material_localizations.dart b/packages/flutter_localizations/lib/src/material_localizations.dart index cfa744ae3b..2af9106f36 100644 --- a/packages/flutter_localizations/lib/src/material_localizations.dart +++ b/packages/flutter_localizations/lib/src/material_localizations.dart @@ -139,7 +139,7 @@ class GlobalMaterialLocalizations implements MaterialLocalizations { } @override - String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }) { + String formatHour(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false }) { switch (hourFormat(of: timeOfDayFormat(alwaysUse24HourFormat: alwaysUse24HourFormat))) { case HourFormat.HH: return _twoDigitZeroPaddedFormat.format(timeOfDay.hour); @@ -191,7 +191,7 @@ class GlobalMaterialLocalizations implements MaterialLocalizations { } @override - String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat: false }) { + String formatTimeOfDay(TimeOfDay timeOfDay, { bool alwaysUse24HourFormat = false }) { // Not using intl.DateFormat for two reasons: // // - DateFormat supports more formats than our material time picker does, @@ -393,7 +393,7 @@ class GlobalMaterialLocalizations implements MaterialLocalizations { /// * http://demo.icu-project.org/icu-bin/locexp?d_=en&_=en_US shows the /// short time pattern used in locale en_US @override - TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat: false }) { + TimeOfDayFormat timeOfDayFormat({ bool alwaysUse24HourFormat = false }) { final String icuShortTimePattern = _translationBundle.timeOfDayFormat; assert(() { diff --git a/packages/flutter_localizations/test/date_picker_test.dart b/packages/flutter_localizations/test/date_picker_test.dart index b0442eb41e..a69362d2b3 100644 --- a/packages/flutter_localizations/test/date_picker_test.dart +++ b/packages/flutter_localizations/test/date_picker_test.dart @@ -229,7 +229,7 @@ Future _pumpBoilerplate( WidgetTester tester, Widget child, { Locale locale = const Locale('en', 'US'), - TextDirection textDirection: TextDirection.ltr + TextDirection textDirection = TextDirection.ltr }) async { await tester.pumpWidget(new Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter_localizations/test/override_test.dart b/packages/flutter_localizations/test/override_test.dart index 66644098f0..ab53f5c420 100644 --- a/packages/flutter_localizations/test/override_test.dart +++ b/packages/flutter_localizations/test/override_test.dart @@ -16,8 +16,8 @@ class FooMaterialLocalizations extends GlobalMaterialLocalizations { class FooMaterialLocalizationsDelegate extends LocalizationsDelegate { const FooMaterialLocalizationsDelegate({ - this.supportedLanguage: 'en', - this.backButtonTooltip: 'foo' + this.supportedLanguage = 'en', + this.backButtonTooltip = 'foo' }); final String supportedLanguage; @@ -39,10 +39,10 @@ class FooMaterialLocalizationsDelegate extends LocalizationsDelegate> delegates: GlobalMaterialLocalizations.delegates, + Iterable> delegates = GlobalMaterialLocalizations.delegates, WidgetBuilder buildContent, LocaleResolutionCallback localeResolutionCallback, - Iterable supportedLocales: const [ + Iterable supportedLocales = const [ const Locale('en', 'US'), const Locale('es', 'es'), ], diff --git a/packages/flutter_localizations/test/time_picker_test.dart b/packages/flutter_localizations/test/time_picker_test.dart index 6604205741..b34619653c 100644 --- a/packages/flutter_localizations/test/time_picker_test.dart +++ b/packages/flutter_localizations/test/time_picker_test.dart @@ -40,7 +40,7 @@ class _TimePickerLauncher extends StatelessWidget { } Future startPicker(WidgetTester tester, ValueChanged onChanged, - { Locale locale: const Locale('en', 'US') }) async { + { Locale locale = const Locale('en', 'US') }) async { await tester.pumpWidget(new _TimePickerLauncher(onChanged: onChanged, locale: locale,)); await tester.tap(find.text('X')); await tester.pumpAndSettle(const Duration(seconds: 1)); diff --git a/packages/flutter_localizations/test/widgets_test.dart b/packages/flutter_localizations/test/widgets_test.dart index b17013b3e6..9d4399f422 100644 --- a/packages/flutter_localizations/test/widgets_test.dart +++ b/packages/flutter_localizations/test/widgets_test.dart @@ -141,7 +141,7 @@ Widget buildFrame({ Iterable> delegates, WidgetBuilder buildContent, LocaleResolutionCallback localeResolutionCallback, - List supportedLocales: const [ + List supportedLocales = const [ const Locale('en', 'US'), const Locale('en', 'GB'), ], diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart index 9630449ef7..3327f19d4f 100644 --- a/packages/flutter_test/lib/src/binding.dart +++ b/packages/flutter_test/lib/src/binding.dart @@ -255,7 +255,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase @override void dispatchEvent(PointerEvent event, HitTestResult result, { - TestBindingEventSource source: TestBindingEventSource.device + TestBindingEventSource source = TestBindingEventSource.device }) { assert(source == TestBindingEventSource.test); super.dispatchEvent(event, result); @@ -337,7 +337,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase /// The `description` is used by the [LiveTestWidgetsFlutterBinding] to /// show a label on the screen during the test. The description comes from /// the value passed to [testWidgets]. It must not be null. - Future runTest(Future testBody(), VoidCallback invariantTester, { String description: '' }); + Future runTest(Future testBody(), VoidCallback invariantTester, { String description = '' }); /// This is called during test execution before and after the body has been /// executed. @@ -752,7 +752,7 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { } @override - Future runTest(Future testBody(), VoidCallback invariantTester, { String description: '' }) { + Future runTest(Future testBody(), VoidCallback invariantTester, { String description = '' }) { assert(description != null); assert(!inTest); assert(_fakeAsync == null); @@ -1042,7 +1042,7 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { @override void dispatchEvent(PointerEvent event, HitTestResult result, { - TestBindingEventSource source: TestBindingEventSource.device + TestBindingEventSource source = TestBindingEventSource.device }) { switch (source) { case TestBindingEventSource.test: @@ -1115,7 +1115,7 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { } @override - Future runTest(Future testBody(), VoidCallback invariantTester, { String description: '' }) async { + Future runTest(Future testBody(), VoidCallback invariantTester, { String description = '' }) async { assert(description != null); assert(!inTest); _inTest = true; @@ -1172,7 +1172,7 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { /// size onto the actual display using the [BoxFit.contain] algorithm. class TestViewConfiguration extends ViewConfiguration { /// Creates a [TestViewConfiguration] with the given size. Defaults to 800x600. - TestViewConfiguration({ Size size: _kDefaultTestViewportSize }) + TestViewConfiguration({ Size size = _kDefaultTestViewportSize }) : _paintMatrix = _getMatrix(size, ui.window.devicePixelRatio), _hitTestMatrix = _getMatrix(size, 1.0), super(size: size); @@ -1364,7 +1364,7 @@ class _MockHttpClient implements HttpClient { set badCertificateCallback(bool Function(X509Certificate cert, String host, int port) callback) {} @override - void close({bool force: false}) {} + void close({bool force = false}) {} @override Future delete(String host, int port, String path) { diff --git a/packages/flutter_test/lib/src/controller.dart b/packages/flutter_test/lib/src/controller.dart index b60597727a..e93bba422c 100644 --- a/packages/flutter_test/lib/src/controller.dart +++ b/packages/flutter_test/lib/src/controller.dart @@ -312,9 +312,9 @@ class WidgetController { /// drag started). Future fling(Finder finder, Offset offset, double speed, { int pointer, - Duration frameInterval: const Duration(milliseconds: 16), - Offset initialOffset: Offset.zero, - Duration initialOffsetDelay: const Duration(seconds: 1), + Duration frameInterval = const Duration(milliseconds: 16), + Offset initialOffset = Offset.zero, + Duration initialOffsetDelay = const Duration(seconds: 1), }) { return flingFrom( getCenter(finder), @@ -354,9 +354,9 @@ class WidgetController { /// drag started). Future flingFrom(Offset startLocation, Offset offset, double speed, { int pointer, - Duration frameInterval: const Duration(milliseconds: 16), - Offset initialOffset: Offset.zero, - Duration initialOffsetDelay: const Duration(seconds: 1), + Duration frameInterval = const Duration(milliseconds: 16), + Offset initialOffset = Offset.zero, + Duration initialOffsetDelay = const Duration(seconds: 1), }) { assert(offset.distance > 0.0); assert(speed > 0.0); // speed is pixels/second diff --git a/packages/flutter_test/lib/src/finders.dart b/packages/flutter_test/lib/src/finders.dart index ed65a00e7f..c274d9f310 100644 --- a/packages/flutter_test/lib/src/finders.dart +++ b/packages/flutter_test/lib/src/finders.dart @@ -34,7 +34,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder text(String text, { bool skipOffstage: true }) => new _TextFinder(text, skipOffstage: skipOffstage); + Finder text(String text, { bool skipOffstage = true }) => new _TextFinder(text, skipOffstage: skipOffstage); /// Looks for widgets that contain a [Text] descendant with `text` /// in it. @@ -53,7 +53,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder widgetWithText(Type widgetType, String text, { bool skipOffstage: true }) { + Finder widgetWithText(Type widgetType, String text, { bool skipOffstage = true }) { return find.ancestor( of: find.text(text, skipOffstage: skipOffstage), matching: find.byType(widgetType, skipOffstage: skipOffstage), @@ -70,7 +70,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder byKey(Key key, { bool skipOffstage: true }) => new _KeyFinder(key, skipOffstage: skipOffstage); + Finder byKey(Key key, { bool skipOffstage = true }) => new _KeyFinder(key, skipOffstage: skipOffstage); /// Finds widgets by searching for widgets with a particular type. /// @@ -88,7 +88,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder byType(Type type, { bool skipOffstage: true }) => new _WidgetTypeFinder(type, skipOffstage: skipOffstage); + Finder byType(Type type, { bool skipOffstage = true }) => new _WidgetTypeFinder(type, skipOffstage: skipOffstage); /// Finds [Icon] widgets containing icon data equal to the `icon` /// argument. @@ -101,7 +101,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder byIcon(IconData icon, { bool skipOffstage: true }) => new _WidgetIconFinder(icon, skipOffstage: skipOffstage); + Finder byIcon(IconData icon, { bool skipOffstage = true }) => new _WidgetIconFinder(icon, skipOffstage: skipOffstage); /// Looks for widgets that contain an [Icon] descendant displaying [IconData] /// `icon` in it. @@ -120,7 +120,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder widgetWithIcon(Type widgetType, IconData icon, { bool skipOffstage: true }) { + Finder widgetWithIcon(Type widgetType, IconData icon, { bool skipOffstage = true }) { return find.ancestor( of: find.byIcon(icon), matching: find.byType(widgetType), @@ -143,7 +143,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder byElementType(Type type, { bool skipOffstage: true }) => new _ElementTypeFinder(type, skipOffstage: skipOffstage); + Finder byElementType(Type type, { bool skipOffstage = true }) => new _ElementTypeFinder(type, skipOffstage: skipOffstage); /// Finds widgets whose current widget is the instance given by the /// argument. @@ -162,7 +162,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder byWidget(Widget widget, { bool skipOffstage: true }) => new _WidgetFinder(widget, skipOffstage: skipOffstage); + Finder byWidget(Widget widget, { bool skipOffstage = true }) => new _WidgetFinder(widget, skipOffstage: skipOffstage); /// Finds widgets using a widget [predicate]. /// @@ -182,7 +182,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder byWidgetPredicate(WidgetPredicate predicate, { String description, bool skipOffstage: true }) { + Finder byWidgetPredicate(WidgetPredicate predicate, { String description, bool skipOffstage = true }) { return new _WidgetPredicateFinder(predicate, description: description, skipOffstage: skipOffstage); } @@ -196,7 +196,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder byTooltip(String message, { bool skipOffstage: true }) { + Finder byTooltip(String message, { bool skipOffstage = true }) { return byWidgetPredicate( (Widget widget) => widget is Tooltip && widget.message == message, skipOffstage: skipOffstage, @@ -224,7 +224,7 @@ class CommonFinders { /// /// If the `skipOffstage` argument is true (the default), then this skips /// nodes that are [Offstage] or that are from inactive [Route]s. - Finder byElementPredicate(ElementPredicate predicate, { String description, bool skipOffstage: true }) { + Finder byElementPredicate(ElementPredicate predicate, { String description, bool skipOffstage = true }) { return new _ElementPredicateFinder(predicate, description: description, skipOffstage: skipOffstage); } @@ -244,7 +244,7 @@ class CommonFinders { /// /// If the [skipOffstage] argument is true (the default), then nodes that are /// [Offstage] or that are from inactive [Route]s are skipped. - Finder descendant({ Finder of, Finder matching, bool matchRoot: false, bool skipOffstage: true }) { + Finder descendant({ Finder of, Finder matching, bool matchRoot = false, bool skipOffstage = true }) { return new _DescendantFinder(of, matching, matchRoot: matchRoot, skipOffstage: skipOffstage); } @@ -269,7 +269,7 @@ class CommonFinders { /// /// If the [matchRoot] argument is true then the widget(s) specified by [of] /// will be matched along with the ancestors. - Finder ancestor({ Finder of, Finder matching, bool matchRoot: false}) { + Finder ancestor({ Finder of, Finder matching, bool matchRoot = false}) { return new _AncestorFinder(of, matching, matchRoot: matchRoot); } } @@ -279,7 +279,7 @@ class CommonFinders { abstract class Finder { /// Initializes a Finder. Used by subclasses to initialize the [skipOffstage] /// property. - Finder({ this.skipOffstage: true }); + Finder({ this.skipOffstage = true }); /// Describes what the finder is looking for. The description should be /// a brief English noun phrase describing the finder's pattern. @@ -358,7 +358,7 @@ abstract class Finder { /// /// The [at] parameter specifies the location relative to the size of the /// target element where the hit test is performed. - Finder hitTestable({ Alignment at: Alignment.center }) => new _HitTestableFinder(this, at); + Finder hitTestable({ Alignment at = Alignment.center }) => new _HitTestableFinder(this, at); @override String toString() { @@ -451,7 +451,7 @@ class _HitTestableFinder extends Finder { abstract class MatchFinder extends Finder { /// Initializes a predicate-based Finder. Used by subclasses to initialize the /// [skipOffstage] property. - MatchFinder({ bool skipOffstage: true }) : super(skipOffstage: skipOffstage); + MatchFinder({ bool skipOffstage = true }) : super(skipOffstage: skipOffstage); /// Returns true if the given element matches the pattern. /// @@ -465,7 +465,7 @@ abstract class MatchFinder extends Finder { } class _TextFinder extends MatchFinder { - _TextFinder(this.text, { bool skipOffstage: true }) : super(skipOffstage: skipOffstage); + _TextFinder(this.text, { bool skipOffstage = true }) : super(skipOffstage: skipOffstage); final String text; @@ -486,7 +486,7 @@ class _TextFinder extends MatchFinder { } class _KeyFinder extends MatchFinder { - _KeyFinder(this.key, { bool skipOffstage: true }) : super(skipOffstage: skipOffstage); + _KeyFinder(this.key, { bool skipOffstage = true }) : super(skipOffstage: skipOffstage); final Key key; @@ -500,7 +500,7 @@ class _KeyFinder extends MatchFinder { } class _WidgetTypeFinder extends MatchFinder { - _WidgetTypeFinder(this.widgetType, { bool skipOffstage: true }) : super(skipOffstage: skipOffstage); + _WidgetTypeFinder(this.widgetType, { bool skipOffstage = true }) : super(skipOffstage: skipOffstage); final Type widgetType; @@ -514,7 +514,7 @@ class _WidgetTypeFinder extends MatchFinder { } class _WidgetIconFinder extends MatchFinder { - _WidgetIconFinder(this.icon, { bool skipOffstage: true }) : super(skipOffstage: skipOffstage); + _WidgetIconFinder(this.icon, { bool skipOffstage = true }) : super(skipOffstage: skipOffstage); final IconData icon; @@ -529,7 +529,7 @@ class _WidgetIconFinder extends MatchFinder { } class _ElementTypeFinder extends MatchFinder { - _ElementTypeFinder(this.elementType, { bool skipOffstage: true }) : super(skipOffstage: skipOffstage); + _ElementTypeFinder(this.elementType, { bool skipOffstage = true }) : super(skipOffstage: skipOffstage); final Type elementType; @@ -543,7 +543,7 @@ class _ElementTypeFinder extends MatchFinder { } class _WidgetFinder extends MatchFinder { - _WidgetFinder(this.widget, { bool skipOffstage: true }) : super(skipOffstage: skipOffstage); + _WidgetFinder(this.widget, { bool skipOffstage = true }) : super(skipOffstage: skipOffstage); final Widget widget; @@ -557,7 +557,7 @@ class _WidgetFinder extends MatchFinder { } class _WidgetPredicateFinder extends MatchFinder { - _WidgetPredicateFinder(this.predicate, { String description, bool skipOffstage: true }) + _WidgetPredicateFinder(this.predicate, { String description, bool skipOffstage = true }) : _description = description, super(skipOffstage: skipOffstage); @@ -574,7 +574,7 @@ class _WidgetPredicateFinder extends MatchFinder { } class _ElementPredicateFinder extends MatchFinder { - _ElementPredicateFinder(this.predicate, { String description, bool skipOffstage: true }) + _ElementPredicateFinder(this.predicate, { String description, bool skipOffstage = true }) : _description = description, super(skipOffstage: skipOffstage); @@ -592,8 +592,8 @@ class _ElementPredicateFinder extends MatchFinder { class _DescendantFinder extends Finder { _DescendantFinder(this.ancestor, this.descendant, { - this.matchRoot: false, - bool skipOffstage: true, + this.matchRoot = false, + bool skipOffstage = true, }) : super(skipOffstage: skipOffstage); final Finder ancestor; @@ -625,7 +625,7 @@ class _DescendantFinder extends Finder { } class _AncestorFinder extends Finder { - _AncestorFinder(this.descendant, this.ancestor, { this.matchRoot: false }) : super(skipOffstage: false); + _AncestorFinder(this.descendant, this.ancestor, { this.matchRoot = false }) : super(skipOffstage: false); final Finder ancestor; final Finder descendant; diff --git a/packages/flutter_test/lib/src/matchers.dart b/packages/flutter_test/lib/src/matchers.dart index 140c9db34c..b7eb4fc5e5 100644 --- a/packages/flutter_test/lib/src/matchers.dart +++ b/packages/flutter_test/lib/src/matchers.dart @@ -201,7 +201,7 @@ const Matcher isAssertionError = const isInstanceOf(); /// required and not named. /// * [inInclusiveRange], which matches if the argument is in a specified /// range. -Matcher moreOrLessEquals(double value, { double epsilon: 1e-10 }) { +Matcher moreOrLessEquals(double value, { double epsilon = 1e-10 }) { return new _MoreOrLessEquals(value, epsilon); } diff --git a/packages/flutter_test/lib/src/test_pointer.dart b/packages/flutter_test/lib/src/test_pointer.dart index 7de5613b8d..4328046c76 100644 --- a/packages/flutter_test/lib/src/test_pointer.dart +++ b/packages/flutter_test/lib/src/test_pointer.dart @@ -48,7 +48,7 @@ class TestPointer { /// By default, the time stamp on the event is [Duration.zero]. You /// can give a specific time stamp by passing the `timeStamp` /// argument. - PointerDownEvent down(Offset newLocation, { Duration timeStamp: Duration.zero }) { + PointerDownEvent down(Offset newLocation, { Duration timeStamp = Duration.zero }) { assert(!isDown); _isDown = true; _location = newLocation; @@ -64,7 +64,7 @@ class TestPointer { /// By default, the time stamp on the event is [Duration.zero]. You /// can give a specific time stamp by passing the `timeStamp` /// argument. - PointerMoveEvent move(Offset newLocation, { Duration timeStamp: Duration.zero }) { + PointerMoveEvent move(Offset newLocation, { Duration timeStamp = Duration.zero }) { assert(isDown); final Offset delta = newLocation - location; _location = newLocation; @@ -83,7 +83,7 @@ class TestPointer { /// argument. /// /// The object is no longer usable after this method has been called. - PointerUpEvent up({ Duration timeStamp: Duration.zero }) { + PointerUpEvent up({ Duration timeStamp = Duration.zero }) { assert(isDown); _isDown = false; return new PointerUpEvent( @@ -100,7 +100,7 @@ class TestPointer { /// argument. /// /// The object is no longer usable after this method has been called. - PointerCancelEvent cancel({ Duration timeStamp: Duration.zero }) { + PointerCancelEvent cancel({ Duration timeStamp = Duration.zero }) { assert(isDown); _isDown = false; return new PointerCancelEvent( @@ -135,7 +135,7 @@ class TestGesture { /// argument, and a function to use for dispatching events should be provided /// via the `dispatcher` argument. static Future down(Offset downLocation, { - int pointer: 1, + int pointer = 1, @required HitTester hitTester, @required EventDispatcher dispatcher, }) async { @@ -163,13 +163,13 @@ class TestGesture { final TestPointer _pointer; /// Send a move event moving the pointer by the given offset. - Future moveBy(Offset offset, { Duration timeStamp: Duration.zero }) { + Future moveBy(Offset offset, { Duration timeStamp = Duration.zero }) { assert(_pointer._isDown); return moveTo(_pointer.location + offset, timeStamp: timeStamp); } /// Send a move event moving the pointer to the given location. - Future moveTo(Offset location, { Duration timeStamp: Duration.zero }) { + Future moveTo(Offset location, { Duration timeStamp = Duration.zero }) { return TestAsyncUtils.guard(() { assert(_pointer._isDown); return _dispatcher(_pointer.move(location, timeStamp: timeStamp), _result); diff --git a/packages/flutter_test/lib/src/widget_tester.dart b/packages/flutter_test/lib/src/widget_tester.dart index 2b6096cdb9..f8d8ee718c 100644 --- a/packages/flutter_test/lib/src/widget_tester.dart +++ b/packages/flutter_test/lib/src/widget_tester.dart @@ -51,7 +51,7 @@ typedef Future WidgetTesterCallback(WidgetTester widgetTester); /// ``` @isTest void testWidgets(String description, WidgetTesterCallback callback, { - bool skip: false, + bool skip = false, test_package.Timeout timeout }) { final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/flutter_test/test/matchers_test.dart b/packages/flutter_test/test/matchers_test.dart index 94b2121bc3..ea5ba8730a 100644 --- a/packages/flutter_test/test/matchers_test.dart +++ b/packages/flutter_test/test/matchers_test.dart @@ -30,7 +30,7 @@ class _MockToStringDeep { /// line break. List _lines; - String toStringDeep({ String prefixLineOne: '', String prefixOtherLines: '' }) { + String toStringDeep({ String prefixLineOne = '', String prefixOtherLines = '' }) { final StringBuffer sb = new StringBuffer(); if (_lines.isNotEmpty) sb.write('$prefixLineOne${_lines.first}'); diff --git a/packages/flutter_test/test/test_config/config_test_utils.dart b/packages/flutter_test/test/test_config/config_test_utils.dart index e909c224a9..90c1abefcf 100644 --- a/packages/flutter_test/test/test_config/config_test_utils.dart +++ b/packages/flutter_test/test/test_config/config_test_utils.dart @@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; void testConfig( String description, String expectedStringValue, { - Map otherExpectedValues: const {int: isNull}, + Map otherExpectedValues = const {int: isNull}, }) { final String actualStringValue = Zone.current[String]; final Map otherActualValues = otherExpectedValues.map( diff --git a/packages/flutter_tools/lib/runner.dart b/packages/flutter_tools/lib/runner.dart index 1402982ad4..2154cd3b4b 100644 --- a/packages/flutter_tools/lib/runner.dart +++ b/packages/flutter_tools/lib/runner.dart @@ -29,9 +29,9 @@ import 'src/version.dart'; Future run( List args, List commands, { - bool muteCommandLogging: false, - bool verbose: false, - bool verboseHelp: false, + bool muteCommandLogging = false, + bool verbose = false, + bool verboseHelp = false, bool reportCrashes, String flutterVersion, }) { diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index 633235498c..447e29b1e0 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart @@ -352,10 +352,10 @@ class AndroidDevice extends Device { String route, DebuggingOptions debuggingOptions, Map platformArgs, - bool prebuiltApplication: false, - bool applicationNeedsRebuild: false, - bool usesTerminalUi: true, - bool ipv6: false, + bool prebuiltApplication = false, + bool applicationNeedsRebuild = false, + bool usesTerminalUi = true, + bool ipv6 = false, }) async { if (!await _checkForSupportedAdbVersion() || !await _checkForSupportedAndroidVersion()) return new LaunchResult.failed(); diff --git a/packages/flutter_tools/lib/src/android/apk.dart b/packages/flutter_tools/lib/src/android/apk.dart index 1c34cac911..4a2af8e102 100644 --- a/packages/flutter_tools/lib/src/android/apk.dart +++ b/packages/flutter_tools/lib/src/android/apk.dart @@ -12,7 +12,7 @@ import 'gradle.dart'; Future buildApk({ String target, - BuildInfo buildInfo: BuildInfo.debug + BuildInfo buildInfo = BuildInfo.debug }) async { if (!isProjectUsingGradle()) { throwToolExit( diff --git a/packages/flutter_tools/lib/src/android/gradle.dart b/packages/flutter_tools/lib/src/android/gradle.dart index 155466c88e..4a81a7dad9 100644 --- a/packages/flutter_tools/lib/src/android/gradle.dart +++ b/packages/flutter_tools/lib/src/android/gradle.dart @@ -141,7 +141,7 @@ void handleKnownGradleExceptions(String exceptionString) { } } -String _locateProjectGradlew({ bool ensureExecutable: true }) { +String _locateProjectGradlew({ bool ensureExecutable = true }) { final String path = fs.path.join( 'android', platform.isWindows ? 'gradlew.bat' : 'gradlew', diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart index b5514e54d6..ba81d81c8c 100644 --- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart @@ -35,15 +35,15 @@ abstract class AssetBundle { bool wasBuiltOnce(); - bool needsBuild({String manifestPath: _ManifestAssetBundle.defaultManifestPath}); + bool needsBuild({String manifestPath = _ManifestAssetBundle.defaultManifestPath}); /// Returns 0 for success; non-zero for failure. Future build({ - String manifestPath: _ManifestAssetBundle.defaultManifestPath, + String manifestPath = _ManifestAssetBundle.defaultManifestPath, String assetDirPath, String packagesPath, - bool includeDefaultFonts: true, - bool reportLicensedPackages: false + bool includeDefaultFonts = true, + bool reportLicensedPackages = false }); } @@ -74,7 +74,7 @@ class _ManifestAssetBundle implements AssetBundle { bool wasBuiltOnce() => _lastBuildTimestamp != null; @override - bool needsBuild({String manifestPath: defaultManifestPath}) { + bool needsBuild({String manifestPath = defaultManifestPath}) { if (_lastBuildTimestamp == null) return true; @@ -87,11 +87,11 @@ class _ManifestAssetBundle implements AssetBundle { @override Future build({ - String manifestPath: defaultManifestPath, + String manifestPath = defaultManifestPath, String assetDirPath, String packagesPath, - bool includeDefaultFonts: true, - bool reportLicensedPackages: false + bool includeDefaultFonts = true, + bool reportLicensedPackages = false }) async { assetDirPath ??= getAssetBuildDirectory(); packagesPath ??= fs.path.absolute(PackageMap.globalPackagesPath); @@ -521,7 +521,7 @@ Map<_Asset, List<_Asset>> _parseAssets( PackageMap packageMap, FlutterManifest flutterManifest, String assetBase, { - List excludeDirs: const [], + List excludeDirs = const [], String packageName }) { final Map<_Asset, List<_Asset>> result = <_Asset, List<_Asset>>{}; @@ -566,7 +566,7 @@ void _parseAssetsFromFolder(PackageMap packageMap, _AssetDirectoryCache cache, Map<_Asset, List<_Asset>> result, Uri assetUri, { - List excludeDirs: const [], + List excludeDirs = const [], String packageName }) { final String directoryPath = fs.path.join( @@ -597,7 +597,7 @@ void _parseAssetFromFile(PackageMap packageMap, _AssetDirectoryCache cache, Map<_Asset, List<_Asset>> result, Uri assetUri, { - List excludeDirs: const [], + List excludeDirs = const [], String packageName }) { final _Asset asset = _resolveAsset( diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index a5394c2a87..d96be68e01 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart @@ -41,7 +41,7 @@ class GenSnapshot { @required String packagesPath, @required String depfilePath, IOSArch iosArch, - Iterable additionalArgs: const [], + Iterable additionalArgs = const [], }) { final List args = [ '--await_is_keyword', @@ -139,7 +139,7 @@ class AOTSnapshotter { @required bool previewDart2, @required bool buildSharedLibrary, IOSArch iosArch, - List extraGenSnapshotOptions: const [], + List extraGenSnapshotOptions = const [], }) async { if (!_isValidAotPlatform(platform, buildMode)) { printError('${getNameForTargetPlatform(platform)} does not support AOT compilation.'); @@ -361,7 +361,7 @@ class AOTSnapshotter { @required BuildMode buildMode, @required String mainPath, @required String outputPath, - List extraFrontEndOptions: const [], + List extraFrontEndOptions = const [], }) async { final Directory outputDir = fs.directory(outputPath); outputDir.createSync(recursive: true); diff --git a/packages/flutter_tools/lib/src/base/fingerprint.dart b/packages/flutter_tools/lib/src/base/fingerprint.dart index d8fee1c1c1..476bb1f6aa 100644 --- a/packages/flutter_tools/lib/src/base/fingerprint.dart +++ b/packages/flutter_tools/lib/src/base/fingerprint.dart @@ -27,7 +27,7 @@ class Fingerprinter { @required this.fingerprintPath, @required Iterable paths, @required Map properties, - Iterable depfilePaths: const [], + Iterable depfilePaths = const [], FingerprintPathFilter pathFilter, }) : _paths = paths.toList(), _properties = new Map.from(properties), diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart index 9cdbd09ac7..7248c7793e 100644 --- a/packages/flutter_tools/lib/src/base/logger.dart +++ b/packages/flutter_tools/lib/src/base/logger.dart @@ -25,13 +25,13 @@ abstract class Logger { /// Display an error level message to the user. Commands should use this if they /// fail in some way. - void printError(String message, { StackTrace stackTrace, bool emphasis: false }); + void printError(String message, { StackTrace stackTrace, bool emphasis = false }); /// Display normal output of the command. This should be used for things like /// progress messages, success messages, or just normal command output. void printStatus( String message, - { bool emphasis: false, bool newline: true, String ansiAlternative, int indent } + { bool emphasis = false, bool newline = true, String ansiAlternative, int indent } ); /// Use this for verbose tracing output. Users can turn this output on in order @@ -48,8 +48,8 @@ abstract class Logger { Status startProgress( String message, { String progressId, - bool expectSlowOperation: false, - int progressIndicatorPadding: kDefaultStatusPadding, + bool expectSlowOperation = false, + int progressIndicatorPadding = kDefaultStatusPadding, }); } @@ -63,7 +63,7 @@ class StdoutLogger extends Logger { bool get isVerbose => false; @override - void printError(String message, { StackTrace stackTrace, bool emphasis: false }) { + void printError(String message, { StackTrace stackTrace, bool emphasis = false }) { _status?.cancel(); _status = null; @@ -77,7 +77,7 @@ class StdoutLogger extends Logger { @override void printStatus( String message, - { bool emphasis: false, bool newline: true, String ansiAlternative, int indent } + { bool emphasis = false, bool newline = true, String ansiAlternative, int indent } ) { _status?.cancel(); _status = null; @@ -104,8 +104,8 @@ class StdoutLogger extends Logger { Status startProgress( String message, { String progressId, - bool expectSlowOperation: false, - int progressIndicatorPadding: 59, + bool expectSlowOperation = false, + int progressIndicatorPadding = 59, }) { if (_status != null) { // Ignore nested progresses; return a no-op status object. @@ -154,14 +154,14 @@ class BufferLogger extends Logger { String get traceText => _trace.toString(); @override - void printError(String message, { StackTrace stackTrace, bool emphasis: false }) { + void printError(String message, { StackTrace stackTrace, bool emphasis = false }) { _error.writeln(message); } @override void printStatus( String message, - { bool emphasis: false, bool newline: true, String ansiAlternative, int indent } + { bool emphasis = false, bool newline = true, String ansiAlternative, int indent } ) { if (newline) _status.writeln(message); @@ -176,8 +176,8 @@ class BufferLogger extends Logger { Status startProgress( String message, { String progressId, - bool expectSlowOperation: false, - int progressIndicatorPadding: kDefaultStatusPadding, + bool expectSlowOperation = false, + int progressIndicatorPadding = kDefaultStatusPadding, }) { printStatus(message); return new Status(); @@ -205,14 +205,14 @@ class VerboseLogger extends Logger { bool get isVerbose => true; @override - void printError(String message, { StackTrace stackTrace, bool emphasis: false }) { + void printError(String message, { StackTrace stackTrace, bool emphasis = false }) { _emit(_LogType.error, message, stackTrace); } @override void printStatus( String message, - { bool emphasis: false, bool newline: true, String ansiAlternative, int indent } + { bool emphasis = false, bool newline = true, String ansiAlternative, int indent } ) { _emit(_LogType.status, message); } @@ -226,8 +226,8 @@ class VerboseLogger extends Logger { Status startProgress( String message, { String progressId, - bool expectSlowOperation: false, - int progressIndicatorPadding: kDefaultStatusPadding, + bool expectSlowOperation = false, + int progressIndicatorPadding = kDefaultStatusPadding, }) { printStatus(message); return new Status(); diff --git a/packages/flutter_tools/lib/src/base/os.dart b/packages/flutter_tools/lib/src/base/os.dart index fe825234de..f452b79a8b 100644 --- a/packages/flutter_tools/lib/src/base/os.dart +++ b/packages/flutter_tools/lib/src/base/os.dart @@ -68,7 +68,7 @@ abstract class OperatingSystemUtils { return osNames.containsKey(osName) ? osNames[osName] : osName; } - List _which(String execName, {bool all: false}); + List _which(String execName, {bool all = false}); /// Returns the separator between items in the PATH environment variable. String get pathVarSeparator; @@ -83,7 +83,7 @@ class _PosixUtils extends OperatingSystemUtils { } @override - List _which(String execName, {bool all: false}) { + List _which(String execName, {bool all = false}) { final List command = ['which']; if (all) command.add('-a'); @@ -159,7 +159,7 @@ class _WindowsUtils extends OperatingSystemUtils { } @override - List _which(String execName, {bool all: false}) { + List _which(String execName, {bool all = false}) { // `where` always returns all matches, not just the first one. final ProcessResult result = processManager.runSync(['where', execName]); if (result.exitCode != 0) diff --git a/packages/flutter_tools/lib/src/base/process.dart b/packages/flutter_tools/lib/src/base/process.dart index c01b6f376c..992687a2e7 100644 --- a/packages/flutter_tools/lib/src/base/process.dart +++ b/packages/flutter_tools/lib/src/base/process.dart @@ -108,7 +108,7 @@ Map _environment(bool allowReentrantFlutter, [Map runCommand(List cmd, { String workingDirectory, - bool allowReentrantFlutter: false, + bool allowReentrantFlutter = false, Map environment }) { _traceCommand(cmd, workingDirectory: workingDirectory); @@ -123,9 +123,9 @@ Future runCommand(List cmd, { /// this process' stdout/stderr. Completes with the process's exit code. Future runCommandAndStreamOutput(List cmd, { String workingDirectory, - bool allowReentrantFlutter: false, - String prefix: '', - bool trace: false, + bool allowReentrantFlutter = false, + String prefix = '', + bool trace = false, RegExp filter, StringConverter mapFunction, Map environment @@ -182,7 +182,7 @@ Future runCommandAndStreamOutput(List cmd, { /// the exit code of the child process. Future runInteractively(List command, { String workingDirectory, - bool allowReentrantFlutter: false, + bool allowReentrantFlutter = false, Map environment }) async { final Process process = await runCommand( @@ -220,7 +220,7 @@ Future runDetached(List cmd) { Future runAsync(List cmd, { String workingDirectory, - bool allowReentrantFlutter: false, + bool allowReentrantFlutter = false, Map environment }) async { _traceCommand(cmd, workingDirectory: workingDirectory); @@ -236,7 +236,7 @@ Future runAsync(List cmd, { Future runCheckedAsync(List cmd, { String workingDirectory, - bool allowReentrantFlutter: false, + bool allowReentrantFlutter = false, Map environment }) async { final RunResult result = await runAsync( @@ -273,8 +273,8 @@ Future exitsHappyAsync(List cli) async { /// Throws an error if cmd exits with a non-zero value. String runCheckedSync(List cmd, { String workingDirectory, - bool allowReentrantFlutter: false, - bool hideStdout: false, + bool allowReentrantFlutter = false, + bool hideStdout = false, Map environment, }) { return _runWithLoggingSync( @@ -291,7 +291,7 @@ String runCheckedSync(List cmd, { /// Run cmd and return stdout. String runSync(List cmd, { String workingDirectory, - bool allowReentrantFlutter: false + bool allowReentrantFlutter = false }) { return _runWithLoggingSync( cmd, @@ -309,12 +309,12 @@ void _traceCommand(List args, { String workingDirectory }) { } String _runWithLoggingSync(List cmd, { - bool checked: false, - bool noisyErrors: false, - bool throwStandardErrorOnError: false, + bool checked = false, + bool noisyErrors = false, + bool throwStandardErrorOnError = false, String workingDirectory, - bool allowReentrantFlutter: false, - bool hideStdout: false, + bool allowReentrantFlutter = false, + bool hideStdout = false, Map environment, }) { _traceCommand(cmd, workingDirectory: workingDirectory); @@ -352,7 +352,7 @@ String _runWithLoggingSync(List cmd, { } class ProcessExit implements Exception { - ProcessExit(this.exitCode, {this.immediate: false}); + ProcessExit(this.exitCode, {this.immediate = false}); final bool immediate; final int exitCode; diff --git a/packages/flutter_tools/lib/src/base/terminal.dart b/packages/flutter_tools/lib/src/base/terminal.dart index 799043673f..03d7d040d7 100644 --- a/packages/flutter_tools/lib/src/base/terminal.dart +++ b/packages/flutter_tools/lib/src/base/terminal.dart @@ -105,7 +105,7 @@ class AnsiTerminal { List acceptedCharacters, { String prompt, int defaultChoiceIndex, - bool displayAcceptedCharacters: true, + bool displayAcceptedCharacters = true, Duration timeout, }) async { assert(acceptedCharacters != null); diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart index 735ab94483..aa1eaa9b10 100644 --- a/packages/flutter_tools/lib/src/base/utils.dart +++ b/packages/flutter_tools/lib/src/base/utils.dart @@ -239,7 +239,7 @@ typedef Future AsyncCallback(); /// - has a different initial value for the first callback delay /// - waits for a callback to be complete before it starts the next timer class Poller { - Poller(this.callback, this.pollingInterval, { this.initialDelay: Duration.zero }) { + Poller(this.callback, this.pollingInterval, { this.initialDelay = Duration.zero }) { new Future.delayed(initialDelay, _handleCallback); } diff --git a/packages/flutter_tools/lib/src/build_info.dart b/packages/flutter_tools/lib/src/build_info.dart index 7488d5c063..fbcab759a2 100644 --- a/packages/flutter_tools/lib/src/build_info.dart +++ b/packages/flutter_tools/lib/src/build_info.dart @@ -11,8 +11,8 @@ import 'globals.dart'; /// Information about a build to be performed or used. class BuildInfo { const BuildInfo(this.mode, this.flavor, { - this.previewDart2: false, - this.trackWidgetCreation: false, + this.previewDart2 = false, + this.trackWidgetCreation = false, this.extraFrontEndOptions, this.extraGenSnapshotOptions, this.buildSharedLibrary, diff --git a/packages/flutter_tools/lib/src/bundle.dart b/packages/flutter_tools/lib/src/bundle.dart index 1844c678e5..02a65101d4 100644 --- a/packages/flutter_tools/lib/src/bundle.dart +++ b/packages/flutter_tools/lib/src/bundle.dart @@ -31,19 +31,19 @@ const String _kDylibKey = 'libapp.so'; const String _kPlatformKernelKey = 'platform.dill'; Future build({ - String mainPath: defaultMainPath, - String manifestPath: defaultManifestPath, + String mainPath = defaultMainPath, + String manifestPath = defaultManifestPath, String snapshotPath, String applicationKernelFilePath, String depfilePath, - String privateKeyPath: defaultPrivateKeyPath, + String privateKeyPath = defaultPrivateKeyPath, String assetDirPath, String packagesPath, - bool previewDart2 : false, - bool precompiledSnapshot: false, - bool reportLicensedPackages: false, - bool trackWidgetCreation: false, - List extraFrontEndOptions: const [], + bool previewDart2 = false, + bool precompiledSnapshot = false, + bool reportLicensedPackages = false, + bool trackWidgetCreation = false, + List extraFrontEndOptions = const [], List fileSystemRoots, String fileSystemScheme, }) async { @@ -119,8 +119,8 @@ Future buildAssets({ String manifestPath, String assetDirPath, String packagesPath, - bool includeDefaultFonts: true, - bool reportLicensedPackages: false + bool includeDefaultFonts = true, + bool reportLicensedPackages = false }) async { assetDirPath ??= getAssetBuildDirectory(); packagesPath ??= fs.path.absolute(PackageMap.globalPackagesPath); @@ -145,7 +145,7 @@ Future assemble({ DevFSContent kernelContent, File snapshotFile, File dylibFile, - String privateKeyPath: defaultPrivateKeyPath, + String privateKeyPath = defaultPrivateKeyPath, String assetDirPath, }) async { assetDirPath ??= getAssetBuildDirectory(); diff --git a/packages/flutter_tools/lib/src/commands/analyze.dart b/packages/flutter_tools/lib/src/commands/analyze.dart index 4968cbf402..42e8a326fb 100644 --- a/packages/flutter_tools/lib/src/commands/analyze.dart +++ b/packages/flutter_tools/lib/src/commands/analyze.dart @@ -10,7 +10,7 @@ import 'analyze_continuously.dart'; import 'analyze_once.dart'; class AnalyzeCommand extends FlutterCommand { - AnalyzeCommand({bool verboseHelp: false, this.workingDirectory}) { + AnalyzeCommand({bool verboseHelp = false, this.workingDirectory}) { argParser.addFlag('flutter-repo', negatable: false, help: 'Include all the examples and tests from the Flutter repository.', diff --git a/packages/flutter_tools/lib/src/commands/analyze_continuously.dart b/packages/flutter_tools/lib/src/commands/analyze_continuously.dart index 9d8376525f..a31eff324b 100644 --- a/packages/flutter_tools/lib/src/commands/analyze_continuously.dart +++ b/packages/flutter_tools/lib/src/commands/analyze_continuously.dart @@ -20,7 +20,7 @@ import 'analyze_base.dart'; class AnalyzeContinuously extends AnalyzeBase { AnalyzeContinuously(ArgResults argResults, this.repoRoots, this.repoPackages, { - this.previewDart2: false, + this.previewDart2 = false, }) : super(argResults); final List repoRoots; diff --git a/packages/flutter_tools/lib/src/commands/analyze_once.dart b/packages/flutter_tools/lib/src/commands/analyze_once.dart index acc3c2f4b2..b8840a90ee 100644 --- a/packages/flutter_tools/lib/src/commands/analyze_once.dart +++ b/packages/flutter_tools/lib/src/commands/analyze_once.dart @@ -24,7 +24,7 @@ class AnalyzeOnce extends AnalyzeBase { this.repoRoots, this.repoPackages, { this.workingDirectory, - this.previewDart2: false, + this.previewDart2 = false, }) : super(argResults); final List repoRoots; diff --git a/packages/flutter_tools/lib/src/commands/build.dart b/packages/flutter_tools/lib/src/commands/build.dart index b6c693a312..baabf491cb 100644 --- a/packages/flutter_tools/lib/src/commands/build.dart +++ b/packages/flutter_tools/lib/src/commands/build.dart @@ -17,7 +17,7 @@ import 'build_flx.dart'; import 'build_ios.dart'; class BuildCommand extends FlutterCommand { - BuildCommand({bool verboseHelp: false}) { + BuildCommand({bool verboseHelp = false}) { addSubcommand(new BuildApkCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildAotCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildIOSCommand(verboseHelp: verboseHelp)); diff --git a/packages/flutter_tools/lib/src/commands/build_aot.dart b/packages/flutter_tools/lib/src/commands/build_aot.dart index 12f8839bc2..2d9fe924c9 100644 --- a/packages/flutter_tools/lib/src/commands/build_aot.dart +++ b/packages/flutter_tools/lib/src/commands/build_aot.dart @@ -17,7 +17,7 @@ import '../runner/flutter_command.dart'; import 'build.dart'; class BuildAotCommand extends BuildSubCommand { - BuildAotCommand({bool verboseHelp: false}) { + BuildAotCommand({bool verboseHelp = false}) { usesTargetOption(); addBuildModeFlags(); usesPubOption(); diff --git a/packages/flutter_tools/lib/src/commands/build_apk.dart b/packages/flutter_tools/lib/src/commands/build_apk.dart index b00da4025d..e6e2cc54f3 100644 --- a/packages/flutter_tools/lib/src/commands/build_apk.dart +++ b/packages/flutter_tools/lib/src/commands/build_apk.dart @@ -8,7 +8,7 @@ import '../android/apk.dart'; import 'build.dart'; class BuildApkCommand extends BuildSubCommand { - BuildApkCommand({bool verboseHelp: false}) { + BuildApkCommand({bool verboseHelp = false}) { usesTargetOption(); addBuildModeFlags(); usesFlavorOption(); diff --git a/packages/flutter_tools/lib/src/commands/build_bundle.dart b/packages/flutter_tools/lib/src/commands/build_bundle.dart index e999e3af6a..811433414f 100644 --- a/packages/flutter_tools/lib/src/commands/build_bundle.dart +++ b/packages/flutter_tools/lib/src/commands/build_bundle.dart @@ -10,7 +10,7 @@ import '../runner/flutter_command.dart' show FlutterOptions; import 'build.dart'; class BuildBundleCommand extends BuildSubCommand { - BuildBundleCommand({bool verboseHelp: false}) { + BuildBundleCommand({bool verboseHelp = false}) { usesTargetOption(); argParser ..addFlag('precompiled', negatable: false) diff --git a/packages/flutter_tools/lib/src/commands/build_flx.dart b/packages/flutter_tools/lib/src/commands/build_flx.dart index eea83b0db6..14b398ab9a 100644 --- a/packages/flutter_tools/lib/src/commands/build_flx.dart +++ b/packages/flutter_tools/lib/src/commands/build_flx.dart @@ -9,7 +9,7 @@ import 'build.dart'; class BuildFlxCommand extends BuildSubCommand { - BuildFlxCommand({bool verboseHelp: false}); + BuildFlxCommand({bool verboseHelp = false}); @override final String name = 'flx'; diff --git a/packages/flutter_tools/lib/src/commands/build_ios.dart b/packages/flutter_tools/lib/src/commands/build_ios.dart index 397d2faf3d..5196e1bf59 100644 --- a/packages/flutter_tools/lib/src/commands/build_ios.dart +++ b/packages/flutter_tools/lib/src/commands/build_ios.dart @@ -13,7 +13,7 @@ import '../ios/mac.dart'; import 'build.dart'; class BuildIOSCommand extends BuildSubCommand { - BuildIOSCommand({bool verboseHelp: false}) { + BuildIOSCommand({bool verboseHelp = false}) { usesTargetOption(); usesFlavorOption(); usesPubOption(); diff --git a/packages/flutter_tools/lib/src/commands/channel.dart b/packages/flutter_tools/lib/src/commands/channel.dart index 95df08df08..8161ae84f9 100644 --- a/packages/flutter_tools/lib/src/commands/channel.dart +++ b/packages/flutter_tools/lib/src/commands/channel.dart @@ -12,7 +12,7 @@ import '../runner/flutter_command.dart'; import '../version.dart'; class ChannelCommand extends FlutterCommand { - ChannelCommand({ bool verboseHelp: false }) { + ChannelCommand({ bool verboseHelp = false }) { argParser.addFlag( 'all', abbr: 'a', diff --git a/packages/flutter_tools/lib/src/commands/config.dart b/packages/flutter_tools/lib/src/commands/config.dart index decbb8c9ed..aaf28e6247 100644 --- a/packages/flutter_tools/lib/src/commands/config.dart +++ b/packages/flutter_tools/lib/src/commands/config.dart @@ -12,7 +12,7 @@ import '../runner/flutter_command.dart'; import '../usage.dart'; class ConfigCommand extends FlutterCommand { - ConfigCommand({ bool verboseHelp: false }) { + ConfigCommand({ bool verboseHelp = false }) { argParser.addFlag('analytics', negatable: true, help: 'Enable or disable reporting anonymously tool usage statistics and crash reports.'); diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart index 4f55cec2f4..01a32590ba 100644 --- a/packages/flutter_tools/lib/src/commands/create.dart +++ b/packages/flutter_tools/lib/src/commands/create.dart @@ -305,8 +305,8 @@ To edit platform code in an IDE see https://flutter.io/platform-plugins/#edit-co String androidLanguage, String iosLanguage, String flutterRoot, - bool renderDriverTest: false, - bool withPluginHook: false, + bool renderDriverTest = false, + bool withPluginHook = false, }) { flutterRoot = fs.path.normalize(flutterRoot); diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index 6cdb2aa267..a675722990 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -37,7 +37,7 @@ const String protocolVersion = '0.3.0'; /// It can be shutdown with a `daemon.shutdown` command (or by killing the /// process). class DaemonCommand extends FlutterCommand { - DaemonCommand({ this.hidden: false }); + DaemonCommand({ this.hidden = false }); @override final String name = 'daemon'; @@ -83,7 +83,7 @@ class Daemon { this.sendCommand, { this.daemonCommand, this.notifyingLogger, - this.logToStdout: false + this.logToStdout = false }) { // Set up domains. _registerDomain(daemonDomain = new DaemonDomain(this)); @@ -204,7 +204,7 @@ abstract class Domain { void _send(Map map) => daemon._send(map); - String _getStringArg(Map args, String name, { bool required: false }) { + String _getStringArg(Map args, String name, { bool required = false }) { if (required && !args.containsKey(name)) throw '$name is required'; final dynamic val = args[name]; @@ -213,7 +213,7 @@ abstract class Domain { return val; } - bool _getBoolArg(Map args, String name, { bool required: false }) { + bool _getBoolArg(Map args, String name, { bool required = false }) { if (required && !args.containsKey(name)) throw '$name is required'; final dynamic val = args[name]; @@ -222,7 +222,7 @@ abstract class Domain { return val; } - int _getIntArg(Map args, String name, { bool required: false }) { + int _getIntArg(Map args, String name, { bool required = false }) { if (required && !args.containsKey(name)) throw '$name is required'; final dynamic val = args[name]; @@ -373,7 +373,7 @@ class AppDomain extends Domain { String projectRootPath, String packagesFilePath, String dillOutputPath, - bool ipv6: false, + bool ipv6 = false, }) async { if (await device.isLocalEmulator && !options.buildInfo.supportsEmulator) { throw '${toTitleCase(options.buildInfo.modeName)} mode is not supported for emulators.'; @@ -777,14 +777,14 @@ class NotifyingLogger extends Logger { Stream get onMessage => _messageController.stream; @override - void printError(String message, { StackTrace stackTrace, bool emphasis: false }) { + void printError(String message, { StackTrace stackTrace, bool emphasis = false }) { _messageController.add(new LogMessage('error', message, stackTrace)); } @override void printStatus( String message, - { bool emphasis: false, bool newline: true, String ansiAlternative, int indent } + { bool emphasis = false, bool newline = true, String ansiAlternative, int indent } ) { _messageController.add(new LogMessage('status', message)); } @@ -798,8 +798,8 @@ class NotifyingLogger extends Logger { Status startProgress( String message, { String progressId, - bool expectSlowOperation: false, - int progressIndicatorPadding: kDefaultStatusPadding, + bool expectSlowOperation = false, + int progressIndicatorPadding = kDefaultStatusPadding, }) { printStatus(message); return new Status(); @@ -820,7 +820,7 @@ class AppInstance { _AppRunLogger _logger; - Future restart({ bool fullRestart: false, bool pauseAfterRestart: false }) { + Future restart({ bool fullRestart = false, bool pauseAfterRestart = false }) { return runner.restart(fullRestart: fullRestart, pauseAfterRestart: pauseAfterRestart); } @@ -887,7 +887,7 @@ class _AppRunLogger extends Logger { int _nextProgressId = 0; @override - void printError(String message, { StackTrace stackTrace, bool emphasis: false }) { + void printError(String message, { StackTrace stackTrace, bool emphasis = false }) { if (parent != null) { parent.printError(message, stackTrace: stackTrace, emphasis: emphasis); } else { @@ -909,7 +909,7 @@ class _AppRunLogger extends Logger { @override void printStatus( String message, { - bool emphasis: false, bool newline: true, String ansiAlternative, int indent + bool emphasis = false, bool newline = true, String ansiAlternative, int indent }) { if (parent != null) { parent.printStatus(message, emphasis: emphasis, newline: newline, @@ -934,8 +934,8 @@ class _AppRunLogger extends Logger { Status startProgress( String message, { String progressId, - bool expectSlowOperation: false, - int progressIndicatorPadding: 52, + bool expectSlowOperation = false, + int progressIndicatorPadding = 52, }) { // Ignore nested progresses; return a no-op status object. if (_status != null) diff --git a/packages/flutter_tools/lib/src/commands/doctor.dart b/packages/flutter_tools/lib/src/commands/doctor.dart index b441c205d9..0dd0b80671 100644 --- a/packages/flutter_tools/lib/src/commands/doctor.dart +++ b/packages/flutter_tools/lib/src/commands/doctor.dart @@ -8,7 +8,7 @@ import '../doctor.dart'; import '../runner/flutter_command.dart'; class DoctorCommand extends FlutterCommand { - DoctorCommand({this.verbose: false}) { + DoctorCommand({this.verbose = false}) { argParser.addFlag('android-licenses', defaultsTo: false, negatable: false, diff --git a/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart b/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart index 47e0323e31..17723c5275 100644 --- a/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart +++ b/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart @@ -196,7 +196,7 @@ class FuchsiaReloadCommand extends FlutterCommand { static const String _bold = '\u001B[0;1m'; static const String _reset = '\u001B[0m'; - String _vmServiceToString(VMService vmService, {int tabDepth: 0}) { + String _vmServiceToString(VMService vmService, {int tabDepth = 0}) { final Uri addr = vmService.httpAddress; final String embedder = vmService.vm.embedder; final int numIsolates = vmService.vm.isolates.length; @@ -237,7 +237,7 @@ class FuchsiaReloadCommand extends FlutterCommand { return stringBuffer.toString(); } - String _isolateToString(Isolate isolate, {int tabDepth: 0}) { + String _isolateToString(Isolate isolate, {int tabDepth = 0}) { final Uri vmServiceAddr = isolate.owner.vmService.httpAddress; final String name = isolate.name; final String shortName = name.substring(0, name.indexOf('\$')); diff --git a/packages/flutter_tools/lib/src/commands/ide_config.dart b/packages/flutter_tools/lib/src/commands/ide_config.dart index 048bebe779..ffae0016c9 100644 --- a/packages/flutter_tools/lib/src/commands/ide_config.dart +++ b/packages/flutter_tools/lib/src/commands/ide_config.dart @@ -12,7 +12,7 @@ import '../runner/flutter_command.dart'; import '../template.dart'; class IdeConfigCommand extends FlutterCommand { - IdeConfigCommand({this.hidden: false}) { + IdeConfigCommand({this.hidden = false}) { argParser.addFlag( 'overwrite', negatable: true, diff --git a/packages/flutter_tools/lib/src/commands/inject_plugins.dart b/packages/flutter_tools/lib/src/commands/inject_plugins.dart index 6886937ecb..8d8b47cfeb 100644 --- a/packages/flutter_tools/lib/src/commands/inject_plugins.dart +++ b/packages/flutter_tools/lib/src/commands/inject_plugins.dart @@ -9,7 +9,7 @@ import '../plugins.dart'; import '../runner/flutter_command.dart'; class InjectPluginsCommand extends FlutterCommand { - InjectPluginsCommand({ this.hidden: false }) { + InjectPluginsCommand({ this.hidden = false }) { requiresPubspecYaml(); } diff --git a/packages/flutter_tools/lib/src/commands/install.dart b/packages/flutter_tools/lib/src/commands/install.dart index edc6959c4a..c2fcc58085 100644 --- a/packages/flutter_tools/lib/src/commands/install.dart +++ b/packages/flutter_tools/lib/src/commands/install.dart @@ -45,7 +45,7 @@ class InstallCommand extends FlutterCommand { } } -Future installApp(Device device, ApplicationPackage package, { bool uninstall: true }) async { +Future installApp(Device device, ApplicationPackage package, { bool uninstall = true }) async { if (package == null) return false; diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart index 7a21158b9e..2fb8efe00f 100644 --- a/packages/flutter_tools/lib/src/commands/run.dart +++ b/packages/flutter_tools/lib/src/commands/run.dart @@ -79,7 +79,7 @@ class RunCommand extends RunCommandBase { @override final String description = 'Run your Flutter app on an attached device.'; - RunCommand({ bool verboseHelp: false }) { + RunCommand({ bool verboseHelp = false }) { requiresPubspecYaml(); argParser diff --git a/packages/flutter_tools/lib/src/commands/test.dart b/packages/flutter_tools/lib/src/commands/test.dart index 88ea238499..a9252d27fc 100644 --- a/packages/flutter_tools/lib/src/commands/test.dart +++ b/packages/flutter_tools/lib/src/commands/test.dart @@ -20,7 +20,7 @@ import '../test/runner.dart'; import '../test/watcher.dart'; class TestCommand extends FlutterCommand { - TestCommand({ bool verboseHelp: false }) { + TestCommand({ bool verboseHelp = false }) { requiresPubspecYaml(); usesPubOption(); argParser @@ -92,7 +92,7 @@ class TestCommand extends FlutterCommand { @override String get description => 'Run Flutter unit tests for the current project.'; - Future _collectCoverageData(CoverageCollector collector, { bool mergeCoverageData: false }) async { + Future _collectCoverageData(CoverageCollector collector, { bool mergeCoverageData = false }) async { final Status status = logger.startProgress('Collecting coverage information...'); final String coverageData = await collector.finalizeCoverage( timeout: const Duration(seconds: 30), diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index 4c98e2bbc1..5e4ce4c583 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -31,7 +31,7 @@ const Map _kManuallyPinnedDependencies = const { }; class UpdatePackagesCommand extends FlutterCommand { - UpdatePackagesCommand({ this.hidden: false }) { + UpdatePackagesCommand({ this.hidden = false }) { argParser ..addFlag( 'force-upgrade', diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index dc065d6d0c..396aa9814f 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -27,7 +27,7 @@ class CompilerOutput { } class _StdoutHandler { - _StdoutHandler({this.consumer: printError}) { + _StdoutHandler({this.consumer = printError}) { reset(); } @@ -71,10 +71,10 @@ class KernelCompiler { String mainPath, String outputFilePath, String depFilePath, - bool linkPlatformKernelIn: false, - bool aot: false, + bool linkPlatformKernelIn = false, + bool aot = false, List entryPointsJsonFiles, - bool trackWidgetCreation: false, + bool trackWidgetCreation = false, List extraFrontEndOptions, String incrementalCompilerByteStorePath, String packagesPath, @@ -192,9 +192,9 @@ class KernelCompiler { /// The wrapper is intended to stay resident in memory as user changes, reloads, /// restarts the Flutter app. class ResidentCompiler { - ResidentCompiler(this._sdkRoot, {bool trackWidgetCreation: false, + ResidentCompiler(this._sdkRoot, {bool trackWidgetCreation = false, String packagesPath, List fileSystemRoots, String fileSystemScheme , - CompilerMessageConsumer compilerMessageConsumer: printError}) + CompilerMessageConsumer compilerMessageConsumer = printError}) : assert(_sdkRoot != null), _trackWidgetCreation = trackWidgetCreation, _packagesPath = packagesPath, diff --git a/packages/flutter_tools/lib/src/dart/analysis.dart b/packages/flutter_tools/lib/src/dart/analysis.dart index 09d2425848..65e6d10a47 100644 --- a/packages/flutter_tools/lib/src/dart/analysis.dart +++ b/packages/flutter_tools/lib/src/dart/analysis.dart @@ -13,7 +13,7 @@ import '../base/process_manager.dart'; import '../globals.dart'; class AnalysisServer { - AnalysisServer(this.sdkPath, this.directories, {this.previewDart2: false}); + AnalysisServer(this.sdkPath, this.directories, {this.previewDart2 = false}); final String sdkPath; final List directories; diff --git a/packages/flutter_tools/lib/src/dart/pub.dart b/packages/flutter_tools/lib/src/dart/pub.dart index bbbbf9238f..d633374aa0 100644 --- a/packages/flutter_tools/lib/src/dart/pub.dart +++ b/packages/flutter_tools/lib/src/dart/pub.dart @@ -72,10 +72,10 @@ bool _shouldRunPubGet({ File pubSpecYaml, File dotPackages }) { Future pubGet({ @required PubContext context, String directory, - bool skipIfAbsent: false, - bool upgrade: false, - bool offline: false, - bool checkLastModified: true + bool skipIfAbsent = false, + bool upgrade = false, + bool offline = false, + bool checkLastModified = true }) async { directory ??= fs.currentDirectory.path; @@ -137,7 +137,7 @@ Future pub(List arguments, { @required PubContext context, String directory, MessageFilter filter, - String failureMessage: 'pub failed', + String failureMessage = 'pub failed', @required bool retry, bool showTraceForErrors, }) async { diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index eaf1248d9f..846b7de89d 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -403,12 +403,12 @@ class DevFS { String target, AssetBundle bundle, DateTime firstBuildTime, - bool bundleFirstUpload: false, - bool bundleDirty: false, + bool bundleFirstUpload = false, + bool bundleDirty = false, Set fileFilter, ResidentCompiler generator, String dillOutputPath, - bool fullRestart: false, + bool fullRestart = false, String projectRootPath, }) async { // Mark all entries as possibly deleted. @@ -575,7 +575,7 @@ class DevFS { bool _shouldSkip(FileSystemEntity file, String relativePath, Uri directoryUriOnDevice, { - bool ignoreDotFiles: true, + bool ignoreDotFiles = true, }) { if (file is Directory) { // Skip non-files. @@ -609,7 +609,7 @@ class DevFS { Future _scanFilteredDirectory(Set fileFilter, Directory directory, {Uri directoryUriOnDevice, - bool ignoreDotFiles: true}) async { + bool ignoreDotFiles = true}) async { directoryUriOnDevice = _directoryUriOnDevice(directoryUriOnDevice, directory); try { @@ -640,8 +640,8 @@ class DevFS { /// Scan all files in [directory] that pass various filters (e.g. ignoreDotFiles). Future _scanDirectory(Directory directory, {Uri directoryUriOnDevice, - bool recursive: false, - bool ignoreDotFiles: true, + bool recursive = false, + bool ignoreDotFiles = true, Set fileFilter}) async { directoryUriOnDevice = _directoryUriOnDevice(directoryUriOnDevice, directory); if ((fileFilter != null) && fileFilter.isNotEmpty) { diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index dd7475cba4..108a4391d7 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -263,10 +263,10 @@ abstract class Device { String route, DebuggingOptions debuggingOptions, Map platformArgs, - bool prebuiltApplication: false, - bool applicationNeedsRebuild: false, - bool usesTerminalUi: true, - bool ipv6: false, + bool prebuiltApplication = false, + bool applicationNeedsRebuild = false, + bool usesTerminalUi = true, + bool ipv6 = false, }); /// Does this device implement support for hot reloading / restarting? @@ -339,11 +339,11 @@ abstract class Device { class DebuggingOptions { DebuggingOptions.enabled(this.buildInfo, { - this.startPaused: false, - this.enableSoftwareRendering: false, - this.skiaDeterministicRendering: false, - this.traceSkia: false, - this.useTestFonts: false, + this.startPaused = false, + this.enableSoftwareRendering = false, + this.skiaDeterministicRendering = false, + this.traceSkia = false, + this.useTestFonts = false, this.observatoryPort, }) : debuggingEnabled = true; diff --git a/packages/flutter_tools/lib/src/doctor.dart b/packages/flutter_tools/lib/src/doctor.dart index 3453216304..9d9dc90473 100644 --- a/packages/flutter_tools/lib/src/doctor.dart +++ b/packages/flutter_tools/lib/src/doctor.dart @@ -132,7 +132,7 @@ class Doctor { } /// Print information about the state of installed tooling. - Future diagnose({ bool androidLicenses: false, bool verbose: true }) async { + Future diagnose({ bool androidLicenses = false, bool verbose = true }) async { if (androidLicenses) return AndroidWorkflow.runLicenseManager(); diff --git a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart index a66435698c..f6cb30f0ef 100644 --- a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart +++ b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart @@ -64,10 +64,10 @@ class FuchsiaDevice extends Device { String route, DebuggingOptions debuggingOptions, Map platformArgs, - bool prebuiltApplication: false, - bool applicationNeedsRebuild: false, - bool usesTerminalUi: false, - bool ipv6: false, + bool prebuiltApplication = false, + bool applicationNeedsRebuild = false, + bool usesTerminalUi = false, + bool ipv6 = false, }) => new Future.error('unimplemented'); @override diff --git a/packages/flutter_tools/lib/src/globals.dart b/packages/flutter_tools/lib/src/globals.dart index f4beb35ca5..b36eb1b851 100644 --- a/packages/flutter_tools/lib/src/globals.dart +++ b/packages/flutter_tools/lib/src/globals.dart @@ -17,7 +17,7 @@ Artifacts get artifacts => Artifacts.instance; /// fail in some way. /// /// Set `emphasis` to true to make the output bold if it's supported. -void printError(String message, { StackTrace stackTrace, bool emphasis: false }) { +void printError(String message, { StackTrace stackTrace, bool emphasis = false }) { logger.printError(message, stackTrace: stackTrace, emphasis: emphasis); } @@ -35,7 +35,7 @@ void printError(String message, { StackTrace stackTrace, bool emphasis: false }) /// whitespaces. void printStatus( String message, - { bool emphasis: false, bool newline: true, String ansiAlternative, int indent }) { + { bool emphasis = false, bool newline = true, String ansiAlternative, int indent }) { logger.printStatus( message, emphasis: emphasis, diff --git a/packages/flutter_tools/lib/src/ios/cocoapods.dart b/packages/flutter_tools/lib/src/ios/cocoapods.dart index f0643197e7..40b6e2ba62 100644 --- a/packages/flutter_tools/lib/src/ios/cocoapods.dart +++ b/packages/flutter_tools/lib/src/ios/cocoapods.dart @@ -83,8 +83,8 @@ class CocoaPods { @required Directory appIosDirectory, // For backward compatibility with previously created Podfile only. @required String iosEngineDir, - bool isSwift: false, - bool dependenciesChanged: true, + bool isSwift = false, + bool dependenciesChanged = true, }) async { if (!(await appIosDirectory.childFile('Podfile').exists())) { throwToolExit('Podfile missing'); diff --git a/packages/flutter_tools/lib/src/ios/code_signing.dart b/packages/flutter_tools/lib/src/ios/code_signing.dart index 2e1d5c23df..0b3ed8e97b 100644 --- a/packages/flutter_tools/lib/src/ios/code_signing.dart +++ b/packages/flutter_tools/lib/src/ios/code_signing.dart @@ -90,7 +90,7 @@ final RegExp _certificateOrganizationalUnitExtractionPattern = new RegExp(r'OU=( /// project has a development team set in the project's build settings. Future> getCodeSigningIdentityDevelopmentTeam({ BuildableIOSApp iosApp, - bool usesTerminalUi: true + bool usesTerminalUi = true }) async{ if (iosApp.buildSettings == null) return null; diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index 563ef8eaef..abc212be51 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -154,10 +154,10 @@ class IOSDevice extends Device { String route, DebuggingOptions debuggingOptions, Map platformArgs, - bool prebuiltApplication: false, - bool applicationNeedsRebuild: false, - bool usesTerminalUi: true, - bool ipv6: false, + bool prebuiltApplication = false, + bool applicationNeedsRebuild = false, + bool usesTerminalUi = true, + bool ipv6 = false, }) async { if (!prebuiltApplication) { // TODO(chinmaygarde): Use mainPath, route. diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index c4c14536bc..3d49c80582 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -190,8 +190,8 @@ Future buildXcodeProject({ BuildInfo buildInfo, String targetOverride, bool buildForDevice, - bool codesign: true, - bool usesTerminalUi: true, + bool codesign = true, + bool usesTerminalUi = true, }) async { if (!await upgradePbxProjWithFlutterAssets(app.name, app.appDirectory)) return new XcodeBuildResult(success: false); diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index 84a5d91b45..edd34041a1 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -274,10 +274,10 @@ class IOSSimulator extends Device { String route, DebuggingOptions debuggingOptions, Map platformArgs, - bool prebuiltApplication: false, - bool applicationNeedsRebuild: false, - bool usesTerminalUi: true, - bool ipv6: false, + bool prebuiltApplication = false, + bool applicationNeedsRebuild = false, + bool usesTerminalUi = true, + bool ipv6 = false, }) async { if (!prebuiltApplication) { printTrace('Building ${package.name} for $id.'); diff --git a/packages/flutter_tools/lib/src/protocol_discovery.dart b/packages/flutter_tools/lib/src/protocol_discovery.dart index e3320af246..a1f849dab7 100644 --- a/packages/flutter_tools/lib/src/protocol_discovery.dart +++ b/packages/flutter_tools/lib/src/protocol_discovery.dart @@ -30,7 +30,7 @@ class ProtocolDiscovery { DeviceLogReader logReader, { DevicePortForwarder portForwarder, int hostPort, - bool ipv6: false, + bool ipv6 = false, }) { const String kObservatoryService = 'Observatory'; return new ProtocolDiscovery._( diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 0889174d9e..5265114a7b 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -137,7 +137,7 @@ class FlutterDevice { List>> reloadSources( String entryPath, { - bool pause: false + bool pause = false }) { final Uri deviceEntryUri = devFS.baseUri.resolveUri(fs.path.toUri(entryPath)); final Uri devicePackagesUri = devFS.baseUri.resolve('.packages'); @@ -313,7 +313,7 @@ class FlutterDevice { Future runCold({ ColdRunner coldRunner, String route, - bool shouldBuild: true, + bool shouldBuild = true, }) async { final TargetPlatform targetPlatform = await device.targetPlatform; package = await getApplicationPackageForPlatform( @@ -373,10 +373,10 @@ class FlutterDevice { String target, AssetBundle bundle, DateTime firstBuildTime, - bool bundleFirstUpload: false, - bool bundleDirty: false, + bool bundleFirstUpload = false, + bool bundleDirty = false, Set fileFilter, - bool fullRestart: false, + bool fullRestart = false, String projectRootPath, }) async { final Status devFSStatus = logger.startProgress( @@ -420,7 +420,7 @@ abstract class ResidentRunner { ResidentRunner(this.flutterDevices, { this.target, this.debuggingOptions, - this.usesTerminalUI: true, + this.usesTerminalUI = true, String projectRootPath, String packagesFilePath, this.stayResident, @@ -460,12 +460,12 @@ abstract class ResidentRunner { Completer connectionInfoCompleter, Completer appStartedCompleter, String route, - bool shouldBuild: true + bool shouldBuild = true }); bool get supportsRestart => false; - Future restart({ bool fullRestart: false, bool pauseAfterRestart: false }) { + Future restart({ bool fullRestart = false, bool pauseAfterRestart = false }) { throw 'unsupported'; } diff --git a/packages/flutter_tools/lib/src/run_cold.dart b/packages/flutter_tools/lib/src/run_cold.dart index 20872b53a1..9e5958e8b5 100644 --- a/packages/flutter_tools/lib/src/run_cold.dart +++ b/packages/flutter_tools/lib/src/run_cold.dart @@ -17,11 +17,11 @@ class ColdRunner extends ResidentRunner { List devices, { String target, DebuggingOptions debuggingOptions, - bool usesTerminalUI: true, - this.traceStartup: false, + bool usesTerminalUI = true, + this.traceStartup = false, this.applicationBinary, - bool stayResident: true, - bool ipv6: false, + bool stayResident = true, + bool ipv6 = false, }) : super(devices, target: target, debuggingOptions: debuggingOptions, @@ -37,7 +37,7 @@ class ColdRunner extends ResidentRunner { Completer connectionInfoCompleter, Completer appStartedCompleter, String route, - bool shouldBuild: true + bool shouldBuild = true }) async { final bool prebuiltMode = applicationBinary != null; if (!prebuiltMode) { diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index 6c98710b00..77be01fcb7 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart @@ -36,15 +36,15 @@ class HotRunner extends ResidentRunner { List devices, { String target, DebuggingOptions debuggingOptions, - bool usesTerminalUI: true, - this.benchmarkMode: false, + bool usesTerminalUI = true, + this.benchmarkMode = false, this.applicationBinary, - this.hostIsIde: false, + this.hostIsIde = false, String projectRootPath, String packagesFilePath, this.dillOutputPath, - bool stayResident: true, - bool ipv6: false, + bool stayResident = true, + bool ipv6 = false, }) : super(devices, target: target, debuggingOptions: debuggingOptions, @@ -94,7 +94,7 @@ class HotRunner extends ResidentRunner { } Future _reloadSourcesService(String isolateId, - { bool force: false, bool pause: false }) async { + { bool force = false, bool pause = false }) async { // TODO(cbernaschina): check that isolateId is the id of the UI isolate. final OperationResult result = await restart(pauseAfterRestart: pause); if (!result.isOk) { @@ -194,7 +194,7 @@ class HotRunner extends ResidentRunner { Completer connectionInfoCompleter, Completer appStartedCompleter, String route, - bool shouldBuild: true + bool shouldBuild = true }) async { if (!fs.isFileSync(mainPath)) { String message = 'Tried to run $mainPath, but that file does not exist.'; @@ -256,7 +256,7 @@ class HotRunner extends ResidentRunner { return devFSUris; } - Future _updateDevFS({ bool fullRestart: false }) async { + Future _updateDevFS({ bool fullRestart = false }) async { if (!_refreshDartDependencies()) { // Did not update DevFS because of a Dart source error. return false; @@ -411,7 +411,7 @@ class HotRunner extends ResidentRunner { /// Returns [true] if the reload was successful. /// Prints errors if [printErrors] is [true]. static bool validateReloadReport(Map reloadReport, - { bool printErrors: true }) { + { bool printErrors = true }) { if (reloadReport == null) { if (printErrors) printError('Hot reload did not receive reload report.'); @@ -449,7 +449,7 @@ class HotRunner extends ResidentRunner { bool get supportsRestart => true; @override - Future restart({ bool fullRestart: false, bool pauseAfterRestart: false }) async { + Future restart({ bool fullRestart = false, bool pauseAfterRestart = false }) async { if (fullRestart) { final Status status = logger.startProgress( 'Performing hot restart...', @@ -498,7 +498,7 @@ class HotRunner extends ResidentRunner { return path; } - Future _reloadSources({ bool pause: false }) async { + Future _reloadSources({ bool pause = false }) async { for (FlutterDevice device in flutterDevices) { for (FlutterView view in device.views) { if (view.uiIsolate == null) diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart index fb9802df9d..ad85b9ce05 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart @@ -141,7 +141,7 @@ abstract class FlutterCommand extends Command { valueHelp: 'x.y.z'); } - void addBuildModeFlags({bool defaultToRelease: true}) { + void addBuildModeFlags({bool defaultToRelease = true}) { defaultBuildMode = defaultToRelease ? BuildMode.release : BuildMode.debug; argParser.addFlag('debug', diff --git a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart index 37567f1ca8..26dcd4fe33 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart @@ -38,7 +38,7 @@ const String kFlutterToolsScriptFileName = 'flutter_tools.dart'; // in //flutter const String kFlutterEnginePackageName = 'sky_engine'; class FlutterCommandRunner extends CommandRunner { - FlutterCommandRunner({ bool verboseHelp: false }) : super( + FlutterCommandRunner({ bool verboseHelp = false }) : super( 'flutter', 'Manage your Flutter app development.\n' '\n' diff --git a/packages/flutter_tools/lib/src/template.dart b/packages/flutter_tools/lib/src/template.dart index a2fa206ddc..71c47bae1f 100644 --- a/packages/flutter_tools/lib/src/template.dart +++ b/packages/flutter_tools/lib/src/template.dart @@ -65,7 +65,7 @@ class Template { int render( Directory destination, Map context, { - bool overwriteExisting: true, + bool overwriteExisting = true, }) { destination.createSync(recursive: true); int fileCount = 0; diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index d20c1ec4e8..81948aeb16 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -64,16 +64,16 @@ final Map _kHosts = runTests( List testFiles, { Directory workDir, - List names: const [], - List plainNames: const [], - bool enableObservatory: false, - bool startPaused: false, - bool ipv6: false, - bool machine: false, - bool previewDart2: false, - bool trackWidgetCreation: false, - bool updateGoldens: false, + List names = const [], + List plainNames = const [], + bool enableObservatory = false, + bool startPaused = false, + bool ipv6 = false, + bool machine = false, + bool previewDart2 = false, + bool trackWidgetCreation = false, + bool updateGoldens = false, TestWatcher watcher, }) async { if (trackWidgetCreation && !previewDart2) { diff --git a/packages/flutter_tools/lib/src/tester/flutter_tester.dart b/packages/flutter_tools/lib/src/tester/flutter_tester.dart index c318941aed..53f67fafff 100644 --- a/packages/flutter_tools/lib/src/tester/flutter_tester.dart +++ b/packages/flutter_tools/lib/src/tester/flutter_tester.dart @@ -94,10 +94,10 @@ class FlutterTesterDevice extends Device { String route, @required DebuggingOptions debuggingOptions, Map platformArgs, - bool prebuiltApplication: false, - bool applicationNeedsRebuild: false, - bool usesTerminalUi: true, - bool ipv6: false, + bool prebuiltApplication = false, + bool applicationNeedsRebuild = false, + bool usesTerminalUi = true, + bool ipv6 = false, }) async { final BuildInfo buildInfo = debuggingOptions.buildInfo; diff --git a/packages/flutter_tools/lib/src/tracing.dart b/packages/flutter_tools/lib/src/tracing.dart index 0c4b5c0ba1..79ebc6951b 100644 --- a/packages/flutter_tools/lib/src/tracing.dart +++ b/packages/flutter_tools/lib/src/tracing.dart @@ -32,7 +32,7 @@ class Tracing { /// Stops tracing; optionally wait for first frame. Future> stopTracingAndDownloadTimeline({ - bool waitForFirstFrame: false + bool waitForFirstFrame = false }) async { Map timeline; diff --git a/packages/flutter_tools/lib/src/usage.dart b/packages/flutter_tools/lib/src/usage.dart index 1202a1950b..06b2d4bdf4 100644 --- a/packages/flutter_tools/lib/src/usage.dart +++ b/packages/flutter_tools/lib/src/usage.dart @@ -22,7 +22,7 @@ Usage get flutterUsage => Usage.instance; class Usage { /// Create a new Usage instance; [versionOverride] and [configDirOverride] are /// used for testing. - Usage({ String settingsName: 'flutter', String versionOverride, String configDirOverride}) { + Usage({ String settingsName = 'flutter', String versionOverride, String configDirOverride}) { final FlutterVersion flutterVersion = FlutterVersion.instance; final String version = versionOverride ?? flutterVersion.getVersionString(redactUnknownBranches: true); _analytics = new AnalyticsIO(_kFlutterUA, settingsName, version, diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index 520ee9845f..40d3b941a7 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -170,7 +170,7 @@ class FlutterVersion { static FlutterVersion get instance => context[FlutterVersion]; /// Return a short string for the version (e.g. `master/0.0.59-pre.92`, `scroll_refactor/a76bc8e22b`). - String getVersionString({bool redactUnknownBranches: false}) { + String getVersionString({bool redactUnknownBranches = false}) { if (frameworkVersion != 'unknown') return '${getBranchName(redactUnknownBranches: redactUnknownBranches)}/$frameworkVersion'; return '${getBranchName(redactUnknownBranches: redactUnknownBranches)}/$frameworkRevisionShort'; @@ -180,7 +180,7 @@ class FlutterVersion { /// /// If [redactUnknownBranches] is true and the branch is unknown, /// the branch name will be returned as `'[user-branch]'`. - String getBranchName({ bool redactUnknownBranches: false }) { + String getBranchName({ bool redactUnknownBranches = false }) { if (redactUnknownBranches || _branch.isEmpty) { // Only return the branch names we know about; arbitrary branch names might contain PII. if (!officialChannels.contains(_branch) && !obsoleteBranches.containsKey(_branch)) @@ -429,7 +429,7 @@ class VersionCheckError implements Exception { /// /// If [lenient] is true and the command fails, returns an empty string. /// Otherwise, throws a [ToolExit] exception. -String _runSync(List command, {bool lenient: true}) { +String _runSync(List command, {bool lenient = true}) { final ProcessResult results = processManager.runSync(command, workingDirectory: Cache.flutterRoot); if (results.exitCode == 0) diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index 642c174af7..88420de9ca 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -178,7 +178,7 @@ class VMService { /// See: https://github.com/dart-lang/sdk/commit/df8bf384eb815cf38450cb50a0f4b62230fba217 static Future connect( Uri httpUri, { - Duration requestTimeout: kDefaultRequestTimeout, + Duration requestTimeout = kDefaultRequestTimeout, ReloadSources reloadSources, }) async { final Uri wsUri = httpUri.replace(scheme: 'ws', path: fs.path.join(httpUri.path, 'ws')); @@ -774,9 +774,9 @@ class VM extends ServiceObjectOwner { /// If `timeoutFatal` is false, then a timeout will result in a null return /// value. Otherwise, it results in an exception. Future> invokeRpcRaw(String method, { - Map params: const {}, + Map params = const {}, Duration timeout, - bool timeoutFatal: true, + bool timeoutFatal = true, }) async { printTrace('$method: $params'); @@ -804,7 +804,7 @@ class VM extends ServiceObjectOwner { /// Invoke the RPC and return a [ServiceObject] response. Future invokeRpc(String method, { - Map params: const {}, + Map params = const {}, Duration timeout, }) async { final Map response = await invokeRpcRaw( @@ -1043,7 +1043,7 @@ class Isolate extends ServiceObjectOwner { Future> invokeRpcRaw(String method, { Map params, Duration timeout, - bool timeoutFatal: true, + bool timeoutFatal = true, }) { // Inject the 'isolateId' parameter. if (params == null) { @@ -1087,7 +1087,7 @@ class Isolate extends ServiceObjectOwner { static const int kIsolateReloadBarred = 1005; Future> reloadSources( - { bool pause: false, + { bool pause = false, Uri rootLibUri, Uri packagesUri}) async { try { @@ -1178,7 +1178,7 @@ class Isolate extends ServiceObjectOwner { String method, { Map params, Duration timeout, - bool timeoutFatal: true, + bool timeoutFatal = true, } ) async { try { diff --git a/packages/flutter_tools/test/base/build_test.dart b/packages/flutter_tools/test/base/build_test.dart index 7012112e62..754af833dd 100644 --- a/packages/flutter_tools/test/base/build_test.dart +++ b/packages/flutter_tools/test/base/build_test.dart @@ -28,7 +28,7 @@ class MockXcode extends Mock implements Xcode {} class _FakeGenSnapshot implements GenSnapshot { _FakeGenSnapshot({ - this.succeed: true, + this.succeed = true, }); final bool succeed; @@ -136,7 +136,7 @@ void main() { } void expectFingerprintHas({ - String entryPoint: 'main.dart', + String entryPoint = 'main.dart', Map checksums = const {}, }) { final Map jsonObject = json.decode(fs.file('output.snapshot.d.fingerprint').readAsStringSync()); diff --git a/packages/flutter_tools/test/cache_test.dart b/packages/flutter_tools/test/cache_test.dart index 9d53dcd7c1..0b227e5022 100644 --- a/packages/flutter_tools/test/cache_test.dart +++ b/packages/flutter_tools/test/cache_test.dart @@ -124,7 +124,7 @@ class MockFileSystem extends ForwardingFileSystem { class MockFile extends Mock implements File { @override - Future open({FileMode mode: FileMode.READ}) async { // ignore: deprecated_member_use + Future open({FileMode mode = FileMode.READ}) async { // ignore: deprecated_member_use return new MockRandomAccessFile(); } } diff --git a/packages/flutter_tools/test/commands/analyze_continuously_test.dart b/packages/flutter_tools/test/commands/analyze_continuously_test.dart index 2a67faa7fc..850efb9222 100644 --- a/packages/flutter_tools/test/commands/analyze_continuously_test.dart +++ b/packages/flutter_tools/test/commands/analyze_continuously_test.dart @@ -109,7 +109,7 @@ void main() { }); } -void _createSampleProject(Directory directory, { bool brokenCode: false }) { +void _createSampleProject(Directory directory, { bool brokenCode = false }) { final File pubspecFile = fs.file(fs.path.join(directory.path, 'pubspec.yaml')); pubspecFile.writeAsStringSync(''' name: foo_project diff --git a/packages/flutter_tools/test/commands/analyze_once_test.dart b/packages/flutter_tools/test/commands/analyze_once_test.dart index d14fe980ee..e721ac64d1 100644 --- a/packages/flutter_tools/test/commands/analyze_once_test.dart +++ b/packages/flutter_tools/test/commands/analyze_once_test.dart @@ -224,7 +224,7 @@ Future runCommand({ List arguments, List statusTextContains, List errorTextContains, - bool toolExit: false, + bool toolExit = false, String exitMessageContains, }) async { try { diff --git a/packages/flutter_tools/test/commands/create_test.dart b/packages/flutter_tools/test/commands/create_test.dart index a893d95710..466608080e 100644 --- a/packages/flutter_tools/test/commands/create_test.dart +++ b/packages/flutter_tools/test/commands/create_test.dart @@ -503,9 +503,9 @@ class LoggingProcessManager extends LocalProcessManager { List command, { String workingDirectory, Map environment, - bool includeParentEnvironment: true, - bool runInShell: false, - ProcessStartMode mode: ProcessStartMode.NORMAL, // ignore: deprecated_member_use + bool includeParentEnvironment = true, + bool runInShell = false, + ProcessStartMode mode = ProcessStartMode.NORMAL, // ignore: deprecated_member_use }) { commands.add(command); return super.start( diff --git a/packages/flutter_tools/test/commands/daemon_test.dart b/packages/flutter_tools/test/commands/daemon_test.dart index 1a8a45ee6f..037c123593 100644 --- a/packages/flutter_tools/test/commands/daemon_test.dart +++ b/packages/flutter_tools/test/commands/daemon_test.dart @@ -326,14 +326,14 @@ bool _notEvent(Map map) => map['event'] == null; bool _isConnectedEvent(Map map) => map['event'] == 'daemon.connected'; class MockAndroidWorkflow extends AndroidWorkflow { - MockAndroidWorkflow({ this.canListDevices: true }); + MockAndroidWorkflow({ this.canListDevices = true }); @override final bool canListDevices; } class MockIOSWorkflow extends IOSWorkflow { - MockIOSWorkflow({ this.canListDevices:true }); + MockIOSWorkflow({ this.canListDevices =true }); @override final bool canListDevices; diff --git a/packages/flutter_tools/test/commands/devices_test.dart b/packages/flutter_tools/test/commands/devices_test.dart index 333fe1940f..395d3101ac 100644 --- a/packages/flutter_tools/test/commands/devices_test.dart +++ b/packages/flutter_tools/test/commands/devices_test.dart @@ -46,10 +46,10 @@ class MockProcessManager extends Mock implements ProcessManager { List command, { String workingDirectory, Map environment, - bool includeParentEnvironment: true, - bool runInShell: false, - Encoding stdoutEncoding: SYSTEM_ENCODING, // ignore: deprecated_member_use - Encoding stderrEncoding: SYSTEM_ENCODING, // ignore: deprecated_member_use + bool includeParentEnvironment = true, + bool runInShell = false, + Encoding stdoutEncoding = SYSTEM_ENCODING, // ignore: deprecated_member_use + Encoding stderrEncoding = SYSTEM_ENCODING, // ignore: deprecated_member_use }) async { return new ProcessResult(0, 0, '', ''); } @@ -59,10 +59,10 @@ class MockProcessManager extends Mock implements ProcessManager { List command, { String workingDirectory, Map environment, - bool includeParentEnvironment: true, - bool runInShell: false, - Encoding stdoutEncoding: SYSTEM_ENCODING, // ignore: deprecated_member_use - Encoding stderrEncoding: SYSTEM_ENCODING, // ignore: deprecated_member_use + bool includeParentEnvironment = true, + bool runInShell = false, + Encoding stdoutEncoding = SYSTEM_ENCODING, // ignore: deprecated_member_use + Encoding stderrEncoding = SYSTEM_ENCODING, // ignore: deprecated_member_use }) { return new ProcessResult(0, 0, '', ''); } diff --git a/packages/flutter_tools/test/commands/fuchsia_reload_test.dart b/packages/flutter_tools/test/commands/fuchsia_reload_test.dart index 600b839984..7fdcb603c8 100644 --- a/packages/flutter_tools/test/commands/fuchsia_reload_test.dart +++ b/packages/flutter_tools/test/commands/fuchsia_reload_test.dart @@ -36,10 +36,10 @@ class MockProcessManager extends Mock implements ProcessManager { List command, { String workingDirectory, Map environment, - bool includeParentEnvironment: true, - bool runInShell: false, - Encoding stdoutEncoding: SYSTEM_ENCODING, // ignore: deprecated_member_use - Encoding stderrEncoding: SYSTEM_ENCODING, // ignore: deprecated_member_use + bool includeParentEnvironment = true, + bool runInShell = false, + Encoding stdoutEncoding = SYSTEM_ENCODING, // ignore: deprecated_member_use + Encoding stderrEncoding = SYSTEM_ENCODING, // ignore: deprecated_member_use }) async { return new ProcessResult(0, 0, '1234\n5678\n5', ''); } diff --git a/packages/flutter_tools/test/commands/ide_config_test.dart b/packages/flutter_tools/test/commands/ide_config_test.dart index f1bfa6490a..a12eb79453 100644 --- a/packages/flutter_tools/test/commands/ide_config_test.dart +++ b/packages/flutter_tools/test/commands/ide_config_test.dart @@ -40,7 +40,7 @@ void main() { return contents; } - Map _getManifest(Directory base, String marker, {bool isTemplate: false}) { + Map _getManifest(Directory base, String marker, {bool isTemplate = false}) { final String basePath = fs.path.relative(base.path, from: temp.absolute.path); final String suffix = isTemplate ? Template.copyTemplateExtension : ''; return { diff --git a/packages/flutter_tools/test/commands/test_test.dart b/packages/flutter_tools/test/commands/test_test.dart index c423eae784..1bed1d5d57 100644 --- a/packages/flutter_tools/test/commands/test_test.dart +++ b/packages/flutter_tools/test/commands/test_test.dart @@ -146,7 +146,7 @@ Future _runFlutterTest( String testName, String workingDirectory, String testDirectory, { - List extraArgs: const [], + List extraArgs = const [], }) async { final String testFilePath = fs.path.join(testDirectory, '${testName}_test.dart'); diff --git a/packages/flutter_tools/test/dart/pub_get_test.dart b/packages/flutter_tools/test/dart/pub_get_test.dart index 550429c51b..f9c2b7a349 100644 --- a/packages/flutter_tools/test/dart/pub_get_test.dart +++ b/packages/flutter_tools/test/dart/pub_get_test.dart @@ -162,9 +162,9 @@ class MockProcessManager implements ProcessManager { List command, { String workingDirectory, Map environment, - bool includeParentEnvironment: true, - bool runInShell: false, - ProcessStartMode mode: ProcessStartMode.NORMAL, // ignore: deprecated_member_use + bool includeParentEnvironment = true, + bool runInShell = false, + ProcessStartMode mode = ProcessStartMode.NORMAL, // ignore: deprecated_member_use }) { lastPubEnvironment = environment['PUB_ENVIRONMENT']; lastPubCache = environment['PUB_CACHE']; @@ -237,7 +237,7 @@ class MockFileSystem extends ForwardingFileSystem { class MockFile implements File { @override - Future open({FileMode mode: FileMode.READ}) async { // ignore: deprecated_member_use + Future open({FileMode mode = FileMode.READ}) async { // ignore: deprecated_member_use return new MockRandomAccessFile(); } diff --git a/packages/flutter_tools/test/devfs_test.dart b/packages/flutter_tools/test/devfs_test.dart index 223587acbe..2f165a3ddc 100644 --- a/packages/flutter_tools/test/devfs_test.dart +++ b/packages/flutter_tools/test/devfs_test.dart @@ -443,9 +443,9 @@ class MockVM implements VM { @override Future> invokeRpcRaw(String method, { - Map params: const {}, + Map params = const {}, Duration timeout, - bool timeoutFatal: true, + bool timeoutFatal = true, }) async { _service.messages.add('$method $params'); return {'success': true}; @@ -471,7 +471,7 @@ void _cleanupTempDirs() { } } -Future _createPackage(FileSystem fs, String pkgName, String pkgFileName, { bool doubleSlash: false }) async { +Future _createPackage(FileSystem fs, String pkgName, String pkgFileName, { bool doubleSlash = false }) async { final Directory pkgTempDir = _newTempDir(fs); String pkgFilePath = fs.path.join(pkgTempDir.path, pkgName, 'lib', pkgFileName); if (doubleSlash) { diff --git a/packages/flutter_tools/test/ios/ios_workflow_test.dart b/packages/flutter_tools/test/ios/ios_workflow_test.dart index fb71785609..ba3bae089a 100644 --- a/packages/flutter_tools/test/ios/ios_workflow_test.dart +++ b/packages/flutter_tools/test/ios/ios_workflow_test.dart @@ -310,8 +310,8 @@ final ProcessResult exitsHappy = new ProcessResult( class MockIMobileDevice extends IMobileDevice { MockIMobileDevice({ - this.isInstalled: true, - bool isWorking: true, + this.isInstalled = true, + bool isWorking = true, }) : isWorking = new Future.value(isWorking); @override @@ -327,11 +327,11 @@ class MockCocoaPods extends Mock implements CocoaPods {} class IOSWorkflowTestTarget extends IOSWorkflow { IOSWorkflowTestTarget({ - this.hasPythonSixModule: true, - this.hasHomebrew: true, - bool hasIosDeploy: true, - String iosDeployVersionText: '1.9.2', - bool hasIDeviceInstaller: true, + this.hasPythonSixModule = true, + this.hasHomebrew = true, + bool hasIosDeploy = true, + String iosDeployVersionText = '1.9.2', + bool hasIDeviceInstaller = true, }) : hasIosDeploy = new Future.value(hasIosDeploy), iosDeployVersionText = new Future.value(iosDeployVersionText), hasIDeviceInstaller = new Future.value(hasIDeviceInstaller); diff --git a/packages/flutter_tools/test/resident_runner_test.dart b/packages/flutter_tools/test/resident_runner_test.dart index 44e88c97b6..ebe65cd8be 100644 --- a/packages/flutter_tools/test/resident_runner_test.dart +++ b/packages/flutter_tools/test/resident_runner_test.dart @@ -38,7 +38,7 @@ class TestRunner extends ResidentRunner { Completer connectionInfoCompleter, Completer appStartedCompleter, String route, - bool shouldBuild: true, + bool shouldBuild = true, }) => null; } diff --git a/packages/flutter_tools/test/runner/flutter_command_test.dart b/packages/flutter_tools/test/runner/flutter_command_test.dart index 3e6fb46850..6366eb05a8 100644 --- a/packages/flutter_tools/test/runner/flutter_command_test.dart +++ b/packages/flutter_tools/test/runner/flutter_command_test.dart @@ -149,8 +149,8 @@ typedef Future CommandFunction(); class DummyFlutterCommand extends FlutterCommand { DummyFlutterCommand({ - this.shouldUpdateCache : false, - this.noUsagePath : false, + this.shouldUpdateCache = false, + this.noUsagePath = false, this.commandFunction, }); diff --git a/packages/flutter_tools/test/src/context.dart b/packages/flutter_tools/test/src/context.dart index 260d70852d..32a5e230a5 100644 --- a/packages/flutter_tools/test/src/context.dart +++ b/packages/flutter_tools/test/src/context.dart @@ -41,8 +41,8 @@ typedef void ContextInitializer(AppContext testContext); @isTest void testUsingContext(String description, dynamic testMethod(), { Timeout timeout, - Map overrides: const {}, - bool initializeFlutterRoot: true, + Map overrides = const {}, + bool initializeFlutterRoot = true, String testOn, bool skip, // should default to `false`, but https://github.com/dart-lang/test/issues/545 doesn't allow this }) { diff --git a/packages/flutter_tools/test/src/mocks.dart b/packages/flutter_tools/test/src/mocks.dart index de59e59273..fe732a9870 100644 --- a/packages/flutter_tools/test/src/mocks.dart +++ b/packages/flutter_tools/test/src/mocks.dart @@ -38,10 +38,10 @@ class MockApplicationPackageStore extends ApplicationPackageStore { /// An SDK installation with several SDK levels (19, 22, 23). class MockAndroidSdk extends Mock implements AndroidSdk { static Directory createSdkDirectory({ - bool withAndroidN: false, + bool withAndroidN = false, String withNdkDir, - bool withNdkSysroot: false, - bool withSdkManager: true, + bool withNdkSysroot = false, + bool withSdkManager = true, }) { final Directory dir = fs.systemTempDirectory.createTempSync('android-sdk'); @@ -120,9 +120,9 @@ class MockProcessManager implements ProcessManager { List command, { String workingDirectory, Map environment, - bool includeParentEnvironment: true, - bool runInShell: false, - ProcessStartMode mode: ProcessStartMode.NORMAL, // ignore: deprecated_member_use + bool includeParentEnvironment = true, + bool runInShell = false, + ProcessStartMode mode = ProcessStartMode.NORMAL, // ignore: deprecated_member_use }) { if (!succeed) { final String executable = command[0]; @@ -141,11 +141,11 @@ class MockProcessManager implements ProcessManager { /// A process that exits successfully with no output and ignores all input. class MockProcess extends Mock implements Process { MockProcess({ - this.pid: 1, + this.pid = 1, Future exitCode, Stream> stdin, - this.stdout: const Stream>.empty(), - this.stderr: const Stream>.empty(), + this.stdout = const Stream>.empty(), + this.stderr = const Stream>.empty(), }) : exitCode = exitCode ?? new Future.value(0), stdin = stdin ?? new MemoryIOSink(); diff --git a/packages/flutter_tools/test/version_test.dart b/packages/flutter_tools/test/version_test.dart index 51fbccaf87..9770ef9784 100644 --- a/packages/flutter_tools/test/version_test.dart +++ b/packages/flutter_tools/test/version_test.dart @@ -361,9 +361,9 @@ void fakeData( DateTime remoteCommitDate, VersionCheckStamp stamp, String stampJson, - bool errorOnFetch: false, - bool expectSetStamp: false, - bool expectServerPing: false, + bool errorOnFetch = false, + bool expectSetStamp = false, + bool expectServerPing = false, }) { ProcessResult success(String standardOutput) { return new ProcessResult(1, 0, standardOutput, '');