From 08a70e7ac836245cfb6e6156835fca2439722899 Mon Sep 17 00:00:00 2001 From: "Hattomo (TomohiroHattori)" <45988993+Hattomo@users.noreply.github.com> Date: Thu, 20 May 2021 01:54:02 +0900 Subject: [PATCH] Enable avoid_escaping_inner_quotes lint (#81153) --- analysis_options.yaml | 2 +- .../lib/main.dart | 4 +- dev/bots/test/analyze_sample_code_test.dart | 12 +++--- .../bin/tasks/build_aar_module_test.dart | 2 +- .../tasks/gradle_desugar_classes_test.dart | 2 +- .../bin/tasks/gradle_java8_compile_test.dart | 2 +- dev/devicelab/lib/framework/browser.dart | 2 +- dev/tools/lib/codesign.dart | 2 +- dev/tools/lib/repository.dart | 2 +- .../flutter/lib/src/material/date_picker.dart | 10 ++--- .../lib/src/material/selectable_text.dart | 4 +- packages/flutter/lib/src/material/tabs.dart | 12 +++--- packages/flutter/lib/src/rendering/box.dart | 2 +- .../flutter/lib/src/rendering/proxy_box.dart | 2 +- .../flutter/lib/src/widgets/autocomplete.dart | 2 +- packages/flutter/lib/src/widgets/basic.dart | 6 +-- .../flutter/lib/src/widgets/navigator.dart | 2 +- .../lib/src/widgets/scroll_position.dart | 2 +- .../flutter/lib/src/widgets/scrollbar.dart | 2 +- packages/flutter/lib/src/widgets/sliver.dart | 2 +- .../flutter/lib/src/widgets/viewport.dart | 8 ++-- .../test/cupertino/text_selection_test.dart | 2 +- .../test/gestures/pointer_router_test.dart | 2 +- .../test/material/data_table_theme_test.dart | 4 +- .../flutter/test/material/list_tile_test.dart | 4 +- .../test/material/scrollbar_theme_test.dart | 8 ++-- packages/flutter/test/material/tabs_test.dart | 8 ++-- .../test/material/text_form_field_test.dart | 4 +- .../test/material/text_selection_test.dart | 2 +- .../painting/image_cache_clearing_test.dart | 2 +- .../rendering/view_chrome_style_test.dart | 10 ++--- .../flutter/test/widgets/baseline_test.dart | 2 +- packages/flutter/test/widgets/debug_test.dart | 2 +- .../test/widgets/editable_text_test.dart | 4 +- .../flutter/test/widgets/navigator_test.dart | 2 +- .../test/widgets/scroll_physics_test.dart | 2 +- .../test/widgets/scroll_position_test.dart | 2 +- .../flutter/test/widgets/scrollbar_test.dart | 2 +- .../test/widgets/slivers_padding_test.dart | 4 +- packages/flutter/test/widgets/stack_test.dart | 6 +-- .../lib/src/driver/web_driver.dart | 2 +- .../lib/src/android/android_device.dart | 2 +- ...red_components_gen_snapshot_validator.dart | 14 +++---- .../lib/src/android/gradle_errors.dart | 2 +- .../lib/src/android/gradle_utils.dart | 4 +- .../lib/src/base/error_handling_io.dart | 2 +- packages/flutter_tools/lib/src/base/os.dart | 2 +- .../lib/src/commands/build_apk.dart | 2 +- .../src/commands/generate_localizations.dart | 4 +- .../lib/src/commands/packages.dart | 2 +- .../flutter_tools/lib/src/commands/run.dart | 2 +- .../lib/src/commands/screenshot.dart | 2 +- .../lib/src/commands/upgrade.dart | 6 +-- .../lib/src/flutter_plugins.dart | 2 +- .../lib/src/isolated/devfs_web.dart | 2 +- .../lib/src/localizations/gen_l10n.dart | 18 ++++----- .../lib/src/macos/cocoapods.dart | 2 +- .../commands.shard/hermetic/devices_test.dart | 2 +- .../commands.shard/hermetic/test_test.dart | 2 +- .../permeable/analyze_once_test.dart | 8 ++-- .../commands.shard/permeable/create_test.dart | 2 +- .../android/adb_log_reader_test.dart | 2 +- ...omponents_gen_snapshot_validator_test.dart | 22 +++++------ .../android/gradle_errors_test.dart | 2 +- .../test/general.shard/args_test.dart | 2 +- .../targets/dart_plugin_registrant_test.dart | 28 +++++++------- .../build_system/targets/linux_test.dart | 6 +-- .../custom_devices/custom_device_test.dart | 4 +- .../test/general.shard/dart_plugin_test.dart | 38 +++++++++---------- .../generate_localizations_test.dart | 2 +- .../general.shard/license_collector_test.dart | 2 +- .../general.shard/macos/cocoapods_test.dart | 4 +- .../test/general.shard/plugins_test.dart | 6 +-- .../test/general.shard/template_test.dart | 2 +- .../test/general.shard/web/chrome_test.dart | 2 +- .../web/web_expression_compiler_test.dart | 2 +- .../test/integration.shard/gen_l10n_test.dart | 10 ++--- .../test/integration.shard/test_utils.dart | 4 +- .../integration.shard/tool_backend_test.dart | 2 +- .../expression_evaluation_web_test.dart | 2 +- packages/flutter_tools/tool/global_count.dart | 2 +- 81 files changed, 192 insertions(+), 192 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 4730a98e78..81756d29d6 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -64,7 +64,7 @@ linter: # - avoid_dynamic_calls # not yet tested - avoid_empty_else - avoid_equals_and_hash_code_on_mutable_classes - # - avoid_escaping_inner_quotes # not yet tested + - avoid_escaping_inner_quotes - avoid_field_initializers_in_const_classes - avoid_function_literals_in_foreach_calls # - avoid_implementing_value_types # not yet tested diff --git a/dev/benchmarks/platform_channels_benchmarks/lib/main.dart b/dev/benchmarks/platform_channels_benchmarks/lib/main.dart index 716955be5e..a10675c1ca 100644 --- a/dev/benchmarks/platform_channels_benchmarks/lib/main.dart +++ b/dev/benchmarks/platform_channels_benchmarks/lib/main.dart @@ -74,7 +74,7 @@ Future _runBasicStandardLarge(BasicMessageChannel basicStandard, if (size != largeBuffer.length * count) { throw Exception( - 'There is an error with the echo channel, the results don\'t add up: $size', + "There is an error with the echo channel, the results don't add up: $size", ); } @@ -94,7 +94,7 @@ Future _runBasicBinary(BasicMessageChannel basicBinary, watch.stop(); if (size != buffer.lengthInBytes * count) { throw Exception( - 'There is an error with the echo channel, the results don\'t add up: $size', + "There is an error with the echo channel, the results don't add up: $size", ); } diff --git a/dev/bots/test/analyze_sample_code_test.dart b/dev/bots/test/analyze_sample_code_test.dart index 0482f50d5b..7493fbd29d 100644 --- a/dev/bots/test/analyze_sample_code_test.dart +++ b/dev/bots/test/analyze_sample_code_test.dart @@ -27,23 +27,23 @@ void main() { 'In sample starting at dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:117:bool? _visible = true;', '>>> info: Use late for private members with non-nullable type (use_late_for_private_fields_and_variables)', 'In sample starting at dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:117: child: Text(title),', - '>>> error: The final variable \'title\' can\'t be read because it is potentially unassigned at this point (read_potentially_unassigned_final)', + ">>> error: The final variable 'title' can't be read because it is potentially unassigned at this point (read_potentially_unassigned_final)", 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:30:9: new Opacity(', '>>> info: Unnecessary new keyword (unnecessary_new)', 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:62:9: new Opacity(', '>>> info: Unnecessary new keyword (unnecessary_new)', - 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:95:9: const text0 = Text(\'Poor wandering ones!\');', + "dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:95:9: const text0 = Text('Poor wandering ones!');", '>>> info: Specify type annotations (always_specify_types)', - 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:103:9: const text1 = _Text(\'Poor wandering ones!\');', + "dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:103:9: const text1 = _Text('Poor wandering ones!');", '>>> info: Specify type annotations (always_specify_types)', - 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:111:9: final String? bar = \'Hello\';', + "dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:111:9: final String? bar = 'Hello';", '>>> info: Prefer const over final for declarations (prefer_const_declarations)', - 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:111:23: final String? bar = \'Hello\';', + "dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:111:23: final String? bar = 'Hello';", '>>> info: Use a non-nullable type for a final variable initialized with a non-nullable value (unnecessary_nullable_for_final_variable_declarations)', 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:112:9: final int foo = null;', '>>> info: Prefer const over final for declarations (prefer_const_declarations)', 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:112:25: final int foo = null;', - '>>> error: A value of type \'Null\' can\'t be assigned to a variable of type \'int\' (invalid_assignment)', + ">>> error: A value of type 'Null' can't be assigned to a variable of type 'int' (invalid_assignment)", '', 'Found 2 sample code errors.', '' diff --git a/dev/devicelab/bin/tasks/build_aar_module_test.dart b/dev/devicelab/bin/tasks/build_aar_module_test.dart index 73b7a9e6e0..dcf8d7b9c6 100644 --- a/dev/devicelab/bin/tasks/build_aar_module_test.dart +++ b/dev/devicelab/bin/tasks/build_aar_module_test.dart @@ -48,7 +48,7 @@ Future main() async { ); }); - section('Create plugin that doesn\'t support android project'); + section("Create plugin that doesn't support android project"); await inDirectory(tempDir, () async { await flutter( diff --git a/dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart b/dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart index e9c3629982..62271f1bd3 100644 --- a/dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart +++ b/dev/devicelab/bin/tasks/gradle_desugar_classes_test.dart @@ -26,7 +26,7 @@ Future main() async { ]); final File apk = File('${flutterProject.rootPath}/build/app/outputs/flutter-apk/app-debug.apk'); if (!apk.existsSync()) { - throw TaskResult.failure('Expected ${apk.path} to exist, but it doesn\'t'); + throw TaskResult.failure("Expected ${apk.path} to exist, but it doesn't"); } // https://github.com/flutter/flutter/issues/72185 await checkApkContainsMethods(apk, [ diff --git a/dev/devicelab/bin/tasks/gradle_java8_compile_test.dart b/dev/devicelab/bin/tasks/gradle_java8_compile_test.dart index 5fd4edbcc2..64581e593c 100644 --- a/dev/devicelab/bin/tasks/gradle_java8_compile_test.dart +++ b/dev/devicelab/bin/tasks/gradle_java8_compile_test.dart @@ -33,7 +33,7 @@ Future main() async { ); if (!pluginMainKotlinFile.existsSync()) { - throw TaskResult.failure('Expected ${pluginMainKotlinFile.path} to exist, but it doesn\'t'); + throw TaskResult.failure("Expected ${pluginMainKotlinFile.path} to exist, but it doesn't"); } section('add java 8 feature'); diff --git a/dev/devicelab/lib/framework/browser.dart b/dev/devicelab/lib/framework/browser.dart index d0a3f84b24..e38cb47598 100644 --- a/dev/devicelab/lib/framework/browser.dart +++ b/dev/devicelab/lib/framework/browser.dart @@ -292,7 +292,7 @@ class BlinkTraceSummary { Exception noMeasuredFramesFound() => Exception( 'No measured frames found in benchmark tracing data. This likely ' 'indicates a bug in the benchmark. For example, the benchmark failed ' - 'to pump enough frames. It may also indicate a change in Chrome\'s ' + "to pump enough frames. It may also indicate a change in Chrome's " 'tracing data format. Check if Chrome version changed recently and ' 'adjust the parsing code accordingly.', ); diff --git a/dev/tools/lib/codesign.dart b/dev/tools/lib/codesign.dart index 9b2e547ca0..a69df0e4c6 100644 --- a/dev/tools/lib/codesign.dart +++ b/dev/tools/lib/codesign.dart @@ -56,7 +56,7 @@ class CodesignCommand extends Command { argParser.addOption( kUpstream, defaultsTo: FrameworkRepository.defaultUpstream, - help: 'The git remote URL to use as the Flutter framework\'s upstream.', + help: "The git remote URL to use as the Flutter framework's upstream.", ); argParser.addOption( kRevision, diff --git a/dev/tools/lib/repository.dart b/dev/tools/lib/repository.dart index 64c052fb85..14536889c4 100644 --- a/dev/tools/lib/repository.dart +++ b/dev/tools/lib/repository.dart @@ -377,7 +377,7 @@ abstract class Repository { 'commit', '--allow-empty', '-m', - '\'$message\'', + "'$message'", ], 'create an empty commit', workingDirectory: checkoutDirectory.path, diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index a7a9ed00b3..71e0a8e880 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -1057,7 +1057,7 @@ Future showDateRangePicker({ ); assert( initialDateRange == null || !initialDateRange.start.isAfter(initialDateRange.end), - 'initialDateRange\'s start date must not be after it\'s end date.', + "initialDateRange's start date must not be after it's end date.", ); initialDateRange = initialDateRange == null ? null : DateUtils.datesOnly(initialDateRange); assert(firstDate != null); @@ -1070,19 +1070,19 @@ Future showDateRangePicker({ ); assert( initialDateRange == null || !initialDateRange.start.isBefore(firstDate), - 'initialDateRange\'s start date must be on or after firstDate $firstDate.', + "initialDateRange's start date must be on or after firstDate $firstDate.", ); assert( initialDateRange == null || !initialDateRange.end.isBefore(firstDate), - 'initialDateRange\'s end date must be on or after firstDate $firstDate.', + "initialDateRange's end date must be on or after firstDate $firstDate.", ); assert( initialDateRange == null || !initialDateRange.start.isAfter(lastDate), - 'initialDateRange\'s start date must be on or before lastDate $lastDate.', + "initialDateRange's start date must be on or before lastDate $lastDate.", ); assert( initialDateRange == null || !initialDateRange.end.isAfter(lastDate), - 'initialDateRange\'s end date must be on or before lastDate $lastDate.', + "initialDateRange's end date must be on or before lastDate $lastDate.", ); currentDate = DateUtils.dateOnly(currentDate ?? DateTime.now()); assert(initialEntryMode != null); diff --git a/packages/flutter/lib/src/material/selectable_text.dart b/packages/flutter/lib/src/material/selectable_text.dart index 5fa64289de..3b852b0eb4 100644 --- a/packages/flutter/lib/src/material/selectable_text.dart +++ b/packages/flutter/lib/src/material/selectable_text.dart @@ -204,7 +204,7 @@ class SelectableText extends StatefulWidget { assert(minLines == null || minLines > 0), assert( (maxLines == null) || (minLines == null) || (maxLines >= minLines), - 'minLines can\'t be greater than maxLines', + "minLines can't be greater than maxLines", ), assert( data != null, @@ -257,7 +257,7 @@ class SelectableText extends StatefulWidget { assert(minLines == null || minLines > 0), assert( (maxLines == null) || (minLines == null) || (maxLines >= minLines), - 'minLines can\'t be greater than maxLines', + "minLines can't be greater than maxLines", ), assert( textSpan != null, diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 2d8ac4ac4d..8155368a68 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -606,13 +606,13 @@ class _TabBarScrollController extends ScrollController { /// body: const TabBarView( /// children: [ /// Center( -/// child: Text('It\'s cloudy here'), +/// child: Text("It's cloudy here"), /// ), /// Center( -/// child: Text('It\'s rainy here'), +/// child: Text("It's rainy here"), /// ), /// Center( -/// child: Text('It\'s sunny here'), +/// child: Text("It's sunny here"), /// ), /// ], /// ), @@ -661,13 +661,13 @@ class _TabBarScrollController extends ScrollController { /// controller: _tabController, /// children: const [ /// Center( -/// child: Text('It\'s cloudy here'), +/// child: Text("It's cloudy here"), /// ), /// Center( -/// child: Text('It\'s rainy here'), +/// child: Text("It's rainy here"), /// ), /// Center( -/// child: Text('It\'s sunny here'), +/// child: Text("It's sunny here"), /// ), /// ], /// ), diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 4785fbe2b8..b71e1835f3 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -1941,7 +1941,7 @@ abstract class RenderBox extends RenderObject { 'otherwise, the only object that is allowed to read RenderBox.size ' 'is its parent, if they have said they will. It you hit this assert ' 'trying to access a child\'s size, pass "parentUsesSize: true" to ' - 'that child\'s layout().', + "that child's layout().", ); } assert(_size == this._size); diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index faaec503a3..63faa29206 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -501,7 +501,7 @@ class RenderAspectRatio extends RenderProxyBox { '$runtimeType has unbounded constraints.\n' 'This $runtimeType was given an aspect ratio of $aspectRatio but was given ' 'both unbounded width and unbounded height constraints. Because both ' - 'constraints were unbounded, this render object doesn\'t know how much ' + "constraints were unbounded, this render object doesn't know how much " 'size to consume.', ); } diff --git a/packages/flutter/lib/src/widgets/autocomplete.dart b/packages/flutter/lib/src/widgets/autocomplete.dart index 6d20930e8e..fb0fa5e67f 100644 --- a/packages/flutter/lib/src/widgets/autocomplete.dart +++ b/packages/flutter/lib/src/widgets/autocomplete.dart @@ -372,7 +372,7 @@ typedef AutocompleteOptionToString = String Function(T option) /// ), /// validator: (String? value) { /// if (value == null || value.isEmpty) { -/// return 'Can\'t be empty.'; +/// return "Can't be empty."; /// } /// return null; /// }, diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index e0b0057c44..f7f2e6238f 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -3852,9 +3852,9 @@ class Stack extends MultiChildRenderObjectWidget { if (alignment is AlignmentDirectional && textDirection == null) { assert(debugCheckHasDirectionality( context, - why: 'to resolve the \'alignment\' argument', - hint: alignment == AlignmentDirectional.topStart ? 'The default value for \'alignment\' is AlignmentDirectional.topStart, which requires a text direction.' : null, - alternative: 'Instead of providing a Directionality widget, another solution would be passing a non-directional \'alignment\', or an explicit \'textDirection\', to the $runtimeType.', + why: "to resolve the 'alignment' argument", + hint: alignment == AlignmentDirectional.topStart ? "The default value for 'alignment' is AlignmentDirectional.topStart, which requires a text direction." : null, + alternative: "Instead of providing a Directionality widget, another solution would be passing a non-directional 'alignment', or an explicit 'textDirection', to the $runtimeType.", )); } return true; diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index 0d9a6fac0b..ed5041c272 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -3464,7 +3464,7 @@ class NavigatorState extends State with TickerProviderStateMixin, Res 'All routes returned by onGenerateInitialRoutes are not restorable. ' 'Please make sure that all routes returned by onGenerateInitialRoutes ' 'have their RouteSettings defined with names that are defined in the ' - 'app\'s routes table.', + "app's routes table.", ); assert(!_debugLocked); assert(() { _debugLocked = true; return true; }()); diff --git a/packages/flutter/lib/src/widgets/scroll_position.dart b/packages/flutter/lib/src/widgets/scroll_position.dart index eb6ad4e151..08432fd50d 100644 --- a/packages/flutter/lib/src/widgets/scroll_position.dart +++ b/packages/flutter/lib/src/widgets/scroll_position.dart @@ -254,7 +254,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { /// If there is any overscroll, it is reported using [didOverscrollBy]. double setPixels(double newPixels) { assert(hasPixels); - assert(SchedulerBinding.instance!.schedulerPhase != SchedulerPhase.persistentCallbacks, 'A scrollable\'s position should not change during the build, layout, and paint phases, otherwise the rendering will be confused.'); + assert(SchedulerBinding.instance!.schedulerPhase != SchedulerPhase.persistentCallbacks, "A scrollable's position should not change during the build, layout, and paint phases, otherwise the rendering will be confused."); if (newPixels != pixels) { final double overscroll = applyBoundaryConditions(newPixels); assert(() { diff --git a/packages/flutter/lib/src/widgets/scrollbar.dart b/packages/flutter/lib/src/widgets/scrollbar.dart index 248a1dc0ed..d629ecf769 100644 --- a/packages/flutter/lib/src/widgets/scrollbar.dart +++ b/packages/flutter/lib/src/widgets/scrollbar.dart @@ -972,7 +972,7 @@ class RawScrollbarState extends State with TickerProv if (!scrollController!.hasClients) { throw FlutterError.fromParts([ ErrorSummary( - 'The Scrollbar\'s ScrollController has no ScrollPosition attached.', + "The Scrollbar's ScrollController has no ScrollPosition attached.", ), ErrorDescription( 'A Scrollbar cannot be painted without a ScrollPosition. ', diff --git a/packages/flutter/lib/src/widgets/sliver.dart b/packages/flutter/lib/src/widgets/sliver.dart index c70bf7a0fa..44d5d0b8d8 100644 --- a/packages/flutter/lib/src/widgets/sliver.dart +++ b/packages/flutter/lib/src/widgets/sliver.dart @@ -1352,7 +1352,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render } else { throw FlutterError( 'Could not find the number of children in ${widget.delegate}.\n' - 'The childCount getter was called (implying that the delegate\'s builder returned null ' + "The childCount getter was called (implying that the delegate's builder returned null " 'for a positive index), but even building the child with index $hi (the maximum ' 'possible integer) did not return null. Consider implementing childCount to avoid ' 'the cost of searching for the final child.', diff --git a/packages/flutter/lib/src/widgets/viewport.dart b/packages/flutter/lib/src/widgets/viewport.dart index de658f6711..17d4607100 100644 --- a/packages/flutter/lib/src/widgets/viewport.dart +++ b/packages/flutter/lib/src/widgets/viewport.dart @@ -144,8 +144,8 @@ class Viewport extends MultiChildRenderObjectWidget { case AxisDirection.up: assert(debugCheckHasDirectionality( context, - why: 'to determine the cross-axis direction when the viewport has an \'up\' axisDirection', - alternative: 'Alternatively, consider specifying the \'crossAxisDirection\' argument on the Viewport.', + why: "to determine the cross-axis direction when the viewport has an 'up' axisDirection", + alternative: "Alternatively, consider specifying the 'crossAxisDirection' argument on the Viewport.", )); return textDirectionToAxisDirection(Directionality.of(context)); case AxisDirection.right: @@ -153,8 +153,8 @@ class Viewport extends MultiChildRenderObjectWidget { case AxisDirection.down: assert(debugCheckHasDirectionality( context, - why: 'to determine the cross-axis direction when the viewport has a \'down\' axisDirection', - alternative: 'Alternatively, consider specifying the \'crossAxisDirection\' argument on the Viewport.', + why: "to determine the cross-axis direction when the viewport has a 'down' axisDirection", + alternative: "Alternatively, consider specifying the 'crossAxisDirection' argument on the Viewport.", )); return textDirectionToAxisDirection(Directionality.of(context)); case AxisDirection.left: diff --git a/packages/flutter/test/cupertino/text_selection_test.dart b/packages/flutter/test/cupertino/text_selection_test.dart index 8335de1cbd..551342f539 100644 --- a/packages/flutter/test/cupertino/text_selection_test.dart +++ b/packages/flutter/test/cupertino/text_selection_test.dart @@ -296,7 +296,7 @@ void main() { variant: const TargetPlatformVariant({ TargetPlatform.iOS }), ); - testWidgets('When a menu item doesn\'t fit, a second page is used.', (WidgetTester tester) async { + testWidgets("When a menu item doesn't fit, a second page is used.", (WidgetTester tester) async { // Set the screen size to more narrow, so that Paste can't fit. tester.binding.window.physicalSizeTestValue = const Size(800, 800); addTearDown(tester.binding.window.clearPhysicalSizeTestValue); diff --git a/packages/flutter/test/gestures/pointer_router_test.dart b/packages/flutter/test/gestures/pointer_router_test.dart index 964083aa7c..7e52e6e660 100644 --- a/packages/flutter/test/gestures/pointer_router_test.dart +++ b/packages/flutter/test/gestures/pointer_router_test.dart @@ -156,7 +156,7 @@ void main() { final PointerRouter router = PointerRouter(); router.addRoute(2, (PointerEvent event) => throw 'Pointer exception'); } catch (e) { - expect(e, contains('router: Instance of \'PointerRouter\'')); + expect(e, contains("router: Instance of 'PointerRouter'")); expect(e, contains('route: Closure: (PointerEvent) => Null')); expect(e, contains('event: PointerDownEvent#[a-zA-Z0-9]{5}(position: Offset(0.0, 0.0))')); } diff --git a/packages/flutter/test/material/data_table_theme_test.dart b/packages/flutter/test/material/data_table_theme_test.dart index b93dba170c..3e019bd235 100644 --- a/packages/flutter/test/material/data_table_theme_test.dart +++ b/packages/flutter/test/material/data_table_theme_test.dart @@ -78,10 +78,10 @@ void main() { .toList(); expect(description[0], 'decoration: BoxDecoration(color: Color(0xfffffff0))'); - expect(description[1], 'dataRowColor: Instance of \'_MaterialStatePropertyWith\''); + expect(description[1], "dataRowColor: Instance of '_MaterialStatePropertyWith'"); expect(description[2], 'dataRowHeight: 51.0'); expect(description[3], 'dataTextStyle: TextStyle(inherit: true, size: 12.0)'); - expect(description[4], 'headingRowColor: Instance of \'_MaterialStatePropertyWith\''); + expect(description[4], "headingRowColor: Instance of '_MaterialStatePropertyWith'"); expect(description[5], 'headingRowHeight: 52.0'); expect(description[6], 'headingTextStyle: TextStyle(inherit: true, size: 14.0)'); expect(description[7], 'horizontalMargin: 3.0'); diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index d75e7505a9..220fabbf92 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -1716,7 +1716,7 @@ void main() { expect(find.byType(Material), paints..path(color: defaultColor)); }); - testWidgets('ListTile respects ListTileTheme\'s tileColor & selectedTileColor', (WidgetTester tester) async { + testWidgets("ListTile respects ListTileTheme's tileColor & selectedTileColor", (WidgetTester tester) async { late ListTileTheme theme; bool isSelected = false; @@ -1754,7 +1754,7 @@ void main() { expect(find.byType(Material), paints..path(color: theme.selectedTileColor)); }); - testWidgets('ListTileTheme\'s tileColor & selectedTileColor are overridden by ListTile properties', (WidgetTester tester) async { + testWidgets("ListTileTheme's tileColor & selectedTileColor are overridden by ListTile properties", (WidgetTester tester) async { bool isSelected = false; final Color tileColor = Colors.green.shade500; final Color selectedTileColor = Colors.red.shade500; diff --git a/packages/flutter/test/material/scrollbar_theme_test.dart b/packages/flutter/test/material/scrollbar_theme_test.dart index 17bfbe0f7d..351573f998 100644 --- a/packages/flutter/test/material/scrollbar_theme_test.dart +++ b/packages/flutter/test/material/scrollbar_theme_test.dart @@ -607,13 +607,13 @@ void main() { .toList(); expect(description, [ - 'thickness: Instance of \'_MaterialStatePropertyWith\'', + "thickness: Instance of '_MaterialStatePropertyWith'", 'showTrackOnHover: true', 'isAlwaysShown: true', 'radius: Radius.circular(3.0)', - 'thumbColor: Instance of \'_MaterialStatePropertyWith\'', - 'trackColor: Instance of \'_MaterialStatePropertyWith\'', - 'trackBorderColor: Instance of \'_MaterialStatePropertyWith\'', + "thumbColor: Instance of '_MaterialStatePropertyWith'", + "trackColor: Instance of '_MaterialStatePropertyWith'", + "trackBorderColor: Instance of '_MaterialStatePropertyWith'", 'crossAxisMargin: 3.0', 'mainAxisMargin: 6.0', 'minThumbLength: 120.0', diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 5dd2cbe73a..db5a483307 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -2778,7 +2778,7 @@ void main() { }); group('Tab overlayColor affects ink response', () { - testWidgets('Tab\'s ink well changes color on hover with Tab overlayColor', (WidgetTester tester) async { + testWidgets("Tab's ink well changes color on hover with Tab overlayColor", (WidgetTester tester) async { await tester.pumpWidget( boilerplate( child: DefaultTabController( @@ -2810,7 +2810,7 @@ void main() { }); testWidgets( - 'Tab\'s ink response splashColor matches resolved Tab overlayColor for MaterialState.pressed', + "Tab's ink response splashColor matches resolved Tab overlayColor for MaterialState.pressed", (WidgetTester tester) async { const Color splashColor = Color(0xf00fffff); await tester.pumpWidget( @@ -3430,7 +3430,7 @@ void main() { // because we tried to send a notification on dispose. }); - testWidgets('TabController\'s animation value should be in sync with TabBarView\'s scroll value when user interrupts ballistic scroll', (WidgetTester tester) async { + testWidgets("TabController's animation value should be in sync with TabBarView's scroll value when user interrupts ballistic scroll", (WidgetTester tester) async { final TabController tabController = TabController( vsync: const TestVSync(), length: 3, @@ -3520,7 +3520,7 @@ void main() { expect(log, ['init: 0', 'init: 3', 'dispose: 0']); }); - testWidgets('TabController\'s animation value should be updated when TabController\'s index >= tabs\'s length', (WidgetTester tester) async { + testWidgets("TabController's animation value should be updated when TabController's index >= tabs's length", (WidgetTester tester) async { // This is a regression test for the issue brought up here // https://github.com/flutter/flutter/issues/79226 diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart index d7c5d21220..fda0cf28be 100644 --- a/packages/flutter/test/material/text_form_field_test.dart +++ b/packages/flutter/test/material/text_form_field_test.dart @@ -524,7 +524,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/34847. - testWidgets('didChange resets the text field\'s value to empty when passed null', (WidgetTester tester) async { + testWidgets("didChange resets the text field's value to empty when passed null", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( @@ -549,7 +549,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/34847. - testWidgets('reset resets the text field\'s value to empty when intialValue is null', (WidgetTester tester) async { + testWidgets("reset resets the text field's value to empty when intialValue is null", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( diff --git a/packages/flutter/test/material/text_selection_test.dart b/packages/flutter/test/material/text_selection_test.dart index 91bfb43b0e..831afe1826 100644 --- a/packages/flutter/test/material/text_selection_test.dart +++ b/packages/flutter/test/material/text_selection_test.dart @@ -153,7 +153,7 @@ void main() { variant: const TargetPlatformVariant({ TargetPlatform.android }), ); - testWidgets('When menu items don\'t fit, an overflow menu is used.', (WidgetTester tester) async { + testWidgets("When menu items don't fit, an overflow menu is used.", (WidgetTester tester) async { // Set the screen size to more narrow, so that Select all can't fit. tester.binding.window.physicalSizeTestValue = const Size(1000, 800); addTearDown(tester.binding.window.clearPhysicalSizeTestValue); diff --git a/packages/flutter/test/painting/image_cache_clearing_test.dart b/packages/flutter/test/painting/image_cache_clearing_test.dart index 95561d276a..5e346816a9 100644 --- a/packages/flutter/test/painting/image_cache_clearing_test.dart +++ b/packages/flutter/test/painting/image_cache_clearing_test.dart @@ -14,7 +14,7 @@ import '../rendering/rendering_tester.dart'; void main() { TestRenderingFlutterBinding(); - test('Clearing images while they\'re pending does not crash', () async { + test("Clearing images while they're pending does not crash", () async { final Uint8List bytes = Uint8List.fromList(kTransparentImage); final MemoryImage memoryImage = MemoryImage(bytes); final ImageStream stream = memoryImage.resolve(ImageConfiguration.empty); diff --git a/packages/flutter/test/rendering/view_chrome_style_test.dart b/packages/flutter/test/rendering/view_chrome_style_test.dart index 4977f0eeb5..e5a751f76f 100644 --- a/packages/flutter/test/rendering/view_chrome_style_test.dart +++ b/packages/flutter/test/rendering/view_chrome_style_test.dart @@ -40,7 +40,7 @@ void main() { group('status bar', () { testWidgets( - 'statusBarColor isn\'t set for unannotated view', + "statusBarColor isn't set for unannotated view", (WidgetTester tester) async { await tester.pumpWidget(const SizedBox.expand()); await tester.pumpAndSettle(); @@ -70,7 +70,7 @@ void main() { ); testWidgets( - 'statusBarColor isn\'t set when view covers less than half of the system status bar', + "statusBarColor isn't set when view covers less than half of the system status bar", (WidgetTester tester) async { setupTestDevice(); const double lessThanHalfOfTheStatusBarHeight = @@ -125,7 +125,7 @@ void main() { group('navigation color (Android only)', () { testWidgets( - 'systemNavigationBarColor isn\'t set for non Android device', + "systemNavigationBarColor isn't set for non Android device", (WidgetTester tester) async { setupTestDevice(); await tester.pumpWidget(const AnnotatedRegion( @@ -145,7 +145,7 @@ void main() { ); testWidgets( - 'systemNavigationBarColor isn\'t set for unannotated view', + "systemNavigationBarColor isn't set for unannotated view", (WidgetTester tester) async { await tester.pumpWidget(const SizedBox.expand()); await tester.pumpAndSettle(); @@ -176,7 +176,7 @@ void main() { ); testWidgets( - 'systemNavigationBarColor isn\'t set when view covers less than half of navigation bar', + "systemNavigationBarColor isn't set when view covers less than half of navigation bar", (WidgetTester tester) async { setupTestDevice(); const double lessThanHalfOfTheNavigationBarHeight = diff --git a/packages/flutter/test/widgets/baseline_test.dart b/packages/flutter/test/widgets/baseline_test.dart index bf8ac70403..e01941cb6e 100644 --- a/packages/flutter/test/widgets/baseline_test.dart +++ b/packages/flutter/test/widgets/baseline_test.dart @@ -94,7 +94,7 @@ void main() { expect(calls, 2); }); - testWidgets('LayoutBuilder returns child\'s baseline', (WidgetTester tester) async { + testWidgets("LayoutBuilder returns child's baseline", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( home: Material( diff --git a/packages/flutter/test/widgets/debug_test.dart b/packages/flutter/test/widgets/debug_test.dart index 299edaedcd..888b0799f0 100644 --- a/packages/flutter/test/widgets/debug_test.dart +++ b/packages/flutter/test/widgets/debug_test.dart @@ -33,7 +33,7 @@ void main() { ' must have unique keys.\n' ' Flex(direction: vertical, mainAxisAlignment: start,\n' ' crossAxisAlignment: center) has multiple children with key\n' - ' [<\'key\'>].\n', + " [<'key'>].\n", ), ); } diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index 551c3a70ed..5814a65f43 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -6869,7 +6869,7 @@ void main() { }); // Regression test for https://github.com/flutter/flutter/issues/68086. - testWidgets('composing range removed if it\'s overflowed the truncated value\'s length', (WidgetTester tester) async { + testWidgets("composing range removed if it's overflowed the truncated value's length", (WidgetTester tester) async { await setupWidget( tester, LengthLimitingTextInputFormatter( @@ -6929,7 +6929,7 @@ void main() { } }); - testWidgets('composing range handled correctly when it\'s overflowed', (WidgetTester tester) async { + testWidgets("composing range handled correctly when it's overflowed", (WidgetTester tester) async { const String string = '👨‍👩‍👦0123456'; await setupWidget(tester, LengthLimitingTextInputFormatter(maxLength)); diff --git a/packages/flutter/test/widgets/navigator_test.dart b/packages/flutter/test/widgets/navigator_test.dart index 0ce390ca59..fdbb8075bd 100644 --- a/packages/flutter/test/widgets/navigator_test.dart +++ b/packages/flutter/test/widgets/navigator_test.dart @@ -1285,7 +1285,7 @@ void main() { expect(log, ['building B', 'building C', 'found C', 'building D']); }); - testWidgets('Routes don\'t rebuild just because their animations ended', (WidgetTester tester) async { + testWidgets("Routes don't rebuild just because their animations ended", (WidgetTester tester) async { final GlobalKey key = GlobalKey(); final List log = []; Route? nextRoute = PageRouteBuilder( diff --git a/packages/flutter/test/widgets/scroll_physics_test.dart b/packages/flutter/test/widgets/scroll_physics_test.dart index 15792cd6aa..2178f51bb9 100644 --- a/packages/flutter/test/widgets/scroll_physics_test.dart +++ b/packages/flutter/test/widgets/scroll_physics_test.dart @@ -93,7 +93,7 @@ void main() { ); }); - test('ScrollPhysics scrolling subclasses - Creating the simulation doesn\'t alter the velocity for time 0', () { + test("ScrollPhysics scrolling subclasses - Creating the simulation doesn't alter the velocity for time 0", () { final ScrollMetrics position = FixedScrollMetrics( minScrollExtent: 0.0, maxScrollExtent: 100.0, diff --git a/packages/flutter/test/widgets/scroll_position_test.dart b/packages/flutter/test/widgets/scroll_position_test.dart index 25eb2f2894..e5d8e349d6 100644 --- a/packages/flutter/test/widgets/scroll_position_test.dart +++ b/packages/flutter/test/widgets/scroll_position_test.dart @@ -137,7 +137,7 @@ Future performTest(WidgetTester tester, bool maintainState) async { } void main() { - testWidgets('ScrollPosition jumpTo() doesn\'t call notifyListeners twice', (WidgetTester tester) async { + testWidgets("ScrollPosition jumpTo() doesn't call notifyListeners twice", (WidgetTester tester) async { int count = 0; await tester.pumpWidget(MaterialApp( home: ListView.builder( diff --git a/packages/flutter/test/widgets/scrollbar_test.dart b/packages/flutter/test/widgets/scrollbar_test.dart index 64845a6fc5..e7f5284361 100644 --- a/packages/flutter/test/widgets/scrollbar_test.dart +++ b/packages/flutter/test/widgets/scrollbar_test.dart @@ -1043,7 +1043,7 @@ void main() { expect(exception, isAssertionError); expect( (exception as AssertionError).message, - contains('The Scrollbar\'s ScrollController has no ScrollPosition attached.'), + contains("The Scrollbar's ScrollController has no ScrollPosition attached."), ); }); diff --git a/packages/flutter/test/widgets/slivers_padding_test.dart b/packages/flutter/test/widgets/slivers_padding_test.dart index f9f1e28f0d..fe074f9776 100644 --- a/packages/flutter/test/widgets/slivers_padding_test.dart +++ b/packages/flutter/test/widgets/slivers_padding_test.dart @@ -469,7 +469,7 @@ void main() { ); }); - testWidgets('SliverPadding consumes only its padding from the overlap of its parent\'s constraints', (WidgetTester tester) async { + testWidgets("SliverPadding consumes only its padding from the overlap of its parent's constraints", (WidgetTester tester) async { final _MockRenderSliver mock = _MockRenderSliver(); final RenderSliverPadding renderObject = RenderSliverPadding( padding: const EdgeInsets.only(top: 20), @@ -494,7 +494,7 @@ void main() { expect(mock.constraints.overlap, 80.0); }); - testWidgets('SliverPadding passes the overlap to the child if it\'s negative', (WidgetTester tester) async { + testWidgets("SliverPadding passes the overlap to the child if it's negative", (WidgetTester tester) async { final _MockRenderSliver mock = _MockRenderSliver(); final RenderSliverPadding renderObject = RenderSliverPadding( padding: const EdgeInsets.only(top: 20), diff --git a/packages/flutter/test/widgets/stack_test.dart b/packages/flutter/test/widgets/stack_test.dart index 9e19c09e19..00bb7e0d04 100644 --- a/packages/flutter/test/widgets/stack_test.dart +++ b/packages/flutter/test/widgets/stack_test.dart @@ -765,8 +765,8 @@ void main() { expect( tester.takeException().toString(), 'No Directionality widget found.\n' - 'Stack widgets require a Directionality widget ancestor to resolve the \'alignment\' argument.\n' - 'The default value for \'alignment\' is AlignmentDirectional.topStart, which requires a text direction.\n' + "Stack widgets require a Directionality widget ancestor to resolve the 'alignment' argument.\n" + "The default value for 'alignment' is AlignmentDirectional.topStart, which requires a text direction.\n" 'The specific widget that could not find a Directionality ancestor was:\n' ' Stack\n' 'The ownership chain for the affected widget is: "Stack ← [root]"\n' @@ -775,7 +775,7 @@ void main() { 'example, to determine how to lay out text, how to interpret "start" and "end" values, and to resolve ' 'EdgeInsetsDirectional, AlignmentDirectional, and other *Directional objects.\n' 'Instead of providing a Directionality widget, another solution would be passing a non-directional ' - '\'alignment\', or an explicit \'textDirection\', to the Stack.', + "'alignment', or an explicit 'textDirection', to the Stack.", ); }); } diff --git a/packages/flutter_driver/lib/src/driver/web_driver.dart b/packages/flutter_driver/lib/src/driver/web_driver.dart index 8309494b51..f3382868bd 100644 --- a/packages/flutter_driver/lib/src/driver/web_driver.dart +++ b/packages/flutter_driver/lib/src/driver/web_driver.dart @@ -106,7 +106,7 @@ class WebFlutterDriver extends FlutterDriver { // // TODO(angjieli): Support Mobile Web. (https://github.com/flutter/flutter/issues/65192) await webDriver.execute( - 'document.querySelector(\'flt-semantics-placeholder\').click();', + "document.querySelector('flt-semantics-placeholder').click();", []); _accessibilityEnabled = true; } diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index e076ee18fc..eb22ef1a72 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart @@ -1031,7 +1031,7 @@ class AdbLogReader extends DeviceLogReader { final String lastLogcatTimestamp = await device.lastLogcatTimestamp(); args.addAll([ '-T', - if (lastLogcatTimestamp != null) '\'$lastLogcatTimestamp\'' else '0', + if (lastLogcatTimestamp != null) "'$lastLogcatTimestamp'" else '0', ]); } final Process process = await processManager.start(device.adbCommandForDevice(args)); diff --git a/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart b/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart index e3c755e96a..2c91effb7a 100644 --- a/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart +++ b/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart @@ -80,7 +80,7 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator if (!appManifestFile.existsSync()) { invalidFiles[appManifestFile.path] = 'Error: $appManifestFile does not ' 'exist or could not be found. Please ensure an AndroidManifest.xml ' - 'exists for the app\'s base module.'; + "exists for the app's base module."; return false; } XmlDocument document; @@ -222,37 +222,37 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator final YamlMap data = loadYaml(cacheFile.readAsStringSync()) as YamlMap; // validate yaml format. if (!data.containsKey('loading-units')) { - invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'loading-units\' ' + invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' " 'entry did not exist.'; return loadingUnits; } else { if (data['loading-units'] is! YamlList && data['loading-units'] != null) { - invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'loading-units\' ' + invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' " 'is not a list.'; return loadingUnits; } if (data['loading-units'] != null) { for (final dynamic loadingUnitData in data['loading-units']) { if (loadingUnitData is! YamlMap) { - invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'loading-units\' ' + invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'loading-units' " 'is not a list of maps.'; return loadingUnits; } final YamlMap loadingUnitDataMap = loadingUnitData as YamlMap; if (loadingUnitDataMap['id'] == null) { invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, all ' - 'loading units must have an \'id\''; + "loading units must have an 'id'"; return loadingUnits; } if (loadingUnitDataMap['libraries'] != null) { if (loadingUnitDataMap['libraries'] is! YamlList) { - invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'libraries\' ' + invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'libraries' " 'is not a list.'; return loadingUnits; } for (final dynamic node in loadingUnitDataMap['libraries'] as YamlList) { if (node is! String) { - invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, \'libraries\' ' + invalidFiles[cacheFile.path] = "Invalid loading units yaml file, 'libraries' " 'is not a list of strings.'; return loadingUnits; } diff --git a/packages/flutter_tools/lib/src/android/gradle_errors.dart b/packages/flutter_tools/lib/src/android/gradle_errors.dart index 495efaf312..0e475d99b4 100644 --- a/packages/flutter_tools/lib/src/android/gradle_errors.dart +++ b/packages/flutter_tools/lib/src/android/gradle_errors.dart @@ -388,7 +388,7 @@ final GradleHandledError minSdkVersion = GradleHandledError( ' }\n' '}\n\n' )+ - 'Note that your app won\'t be available to users running Android SDKs below ${minSdkVersionMatch.group(2)}.\n' + "Note that your app won't be available to users running Android SDKs below ${minSdkVersionMatch.group(2)}.\n" 'Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.' ); return GradleBuildStatus.exit; diff --git a/packages/flutter_tools/lib/src/android/gradle_utils.dart b/packages/flutter_tools/lib/src/android/gradle_utils.dart index 1c5e2f0f8f..0177ee3899 100644 --- a/packages/flutter_tools/lib/src/android/gradle_utils.dart +++ b/packages/flutter_tools/lib/src/android/gradle_utils.dart @@ -110,13 +110,13 @@ distributionUrl=https\\://services.gradle.org/distributions/gradle-$gradleVersio String getGradleVersionForAndroidPlugin(Directory directory, Logger logger) { final File buildFile = directory.childFile('build.gradle'); if (!buildFile.existsSync()) { - logger.printTrace('$buildFile doesn\'t exist, assuming AGP version: $_defaultGradleVersion'); + logger.printTrace("$buildFile doesn't exist, assuming AGP version: $_defaultGradleVersion"); return _defaultGradleVersion; } final String buildFileContent = buildFile.readAsStringSync(); final Iterable pluginMatches = _androidPluginRegExp.allMatches(buildFileContent); if (pluginMatches.isEmpty) { - logger.printTrace('$buildFile doesn\'t provide an AGP version, assuming AGP version: $_defaultGradleVersion'); + logger.printTrace("$buildFile doesn't provide an AGP version, assuming AGP version: $_defaultGradleVersion"); return _defaultGradleVersion; } final String androidPluginVersion = pluginMatches.first.group(1); diff --git a/packages/flutter_tools/lib/src/base/error_handling_io.dart b/packages/flutter_tools/lib/src/base/error_handling_io.dart index 2d3dbd4993..5ad6f59edb 100644 --- a/packages/flutter_tools/lib/src/base/error_handling_io.dart +++ b/packages/flutter_tools/lib/src/base/error_handling_io.dart @@ -90,7 +90,7 @@ class ErrorHandlingFileSystem extends ForwardingFileSystem { if (file.existsSync()) { throwToolExit( 'The Flutter tool tried to delete the file or directory ${file.path} but was ' - 'unable to. This may be due to the file and/or project\'s location on a read-only ' + "unable to. This may be due to the file and/or project's location on a read-only " 'volume. Consider relocating the project and trying again', ); } diff --git a/packages/flutter_tools/lib/src/base/os.dart b/packages/flutter_tools/lib/src/base/os.dart index 62f50607ef..f4faf8b627 100644 --- a/packages/flutter_tools/lib/src/base/os.dart +++ b/packages/flutter_tools/lib/src/base/os.dart @@ -351,7 +351,7 @@ class _LinuxUtils extends _PosixUtils { final String value = entryKeyValuePair[1]; // Remove quotes from either end of the value if they exist final String quote = value[0]; - if (quote == '\'' || quote == '"') { + if (quote == "'" || quote == '"') { return value.substring(0, value.length - 1).substring(1); } else { return value; diff --git a/packages/flutter_tools/lib/src/commands/build_apk.dart b/packages/flutter_tools/lib/src/commands/build_apk.dart index f81f29252e..c335b6a536 100644 --- a/packages/flutter_tools/lib/src/commands/build_apk.dart +++ b/packages/flutter_tools/lib/src/commands/build_apk.dart @@ -63,7 +63,7 @@ class BuildApkCommand extends BuildSubCommand { "This command can build debug and release versions of your application. 'debug' builds support " "debugging and a quick development cycle. 'release' builds don't support debugging and are " 'suitable for deploying to app stores. If you are deploying the app to the Play Store, ' - 'it\'s recommended to use app bundles or split the APK to reduce the APK size. Learn more at:\n\n' + "it's recommended to use app bundles or split the APK to reduce the APK size. Learn more at:\n\n" ' * https://developer.android.com/guide/app-bundle\n' ' * https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split'; diff --git a/packages/flutter_tools/lib/src/commands/generate_localizations.dart b/packages/flutter_tools/lib/src/commands/generate_localizations.dart index a91bf0cb41..a402923472 100644 --- a/packages/flutter_tools/lib/src/commands/generate_localizations.dart +++ b/packages/flutter_tools/lib/src/commands/generate_localizations.dart @@ -128,11 +128,11 @@ class GenerateLocalizationsCommand extends FlutterCommand { 'gen-inputs-and-outputs-list', valueHelp: 'path-to-output-directory', help: 'When specified, the tool generates a JSON file containing the ' - 'tool\'s inputs and outputs named gen_l10n_inputs_and_outputs.json.\n' + "tool's inputs and outputs named gen_l10n_inputs_and_outputs.json.\n" '\n' 'This can be useful for keeping track of which files of the Flutter ' 'project were used when generating the latest set of localizations. ' - 'For example, the Flutter tool\'s build system uses this file to ' + "For example, the Flutter tool's build system uses this file to " 'keep track of when to call gen_l10n during hot reload.\n' '\n' 'The value of this option is the directory where the JSON file will be ' diff --git a/packages/flutter_tools/lib/src/commands/packages.dart b/packages/flutter_tools/lib/src/commands/packages.dart index 8a6bd96cb7..e9bc1f0f4a 100644 --- a/packages/flutter_tools/lib/src/commands/packages.dart +++ b/packages/flutter_tools/lib/src/commands/packages.dart @@ -23,7 +23,7 @@ import '../runner/flutter_command.dart'; class PackagesCommand extends FlutterCommand { PackagesCommand() { addSubcommand(PackagesGetCommand('get', false)); - addSubcommand(PackagesInteractiveGetCommand('upgrade', 'Upgrade the current package\'s dependencies to latest versions.')); + addSubcommand(PackagesInteractiveGetCommand('upgrade', "Upgrade the current package's dependencies to latest versions.")); addSubcommand(PackagesInteractiveGetCommand('add', 'Add a dependency to pubspec.yaml.')); addSubcommand(PackagesInteractiveGetCommand('remove', 'Removes a dependency from the current package.')); addSubcommand(PackagesTestCommand()); diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart index c747b999c6..3d66717313 100644 --- a/packages/flutter_tools/lib/src/commands/run.dart +++ b/packages/flutter_tools/lib/src/commands/run.dart @@ -261,7 +261,7 @@ class RunCommand extends RunCommandBase { 'or just dump the trace as soon as the application is running. The first frame ' 'is detected by looking for a Timeline event with the name ' '"${Tracing.firstUsefulFrameEventName}". ' - 'By default, the widgets library\'s binding takes care of sending this event.', + "By default, the widgets library's binding takes care of sending this event.", ) ..addFlag('use-test-fonts', negatable: true, diff --git a/packages/flutter_tools/lib/src/commands/screenshot.dart b/packages/flutter_tools/lib/src/commands/screenshot.dart index 89cf14b15a..86e106f93f 100644 --- a/packages/flutter_tools/lib/src/commands/screenshot.dart +++ b/packages/flutter_tools/lib/src/commands/screenshot.dart @@ -44,7 +44,7 @@ class ScreenshotCommand extends FlutterCommand { help: 'The type of screenshot to retrieve.', allowed: const [_kDeviceType, _kSkiaType, _kRasterizerType], allowedHelp: const { - _kDeviceType: 'Delegate to the device\'s native screenshot capabilities. This ' + _kDeviceType: "Delegate to the device's native screenshot capabilities. This " 'screenshots the entire screen currently being displayed (including content ' 'not rendered by Flutter, like the device status bar).', _kSkiaType: 'Render the Flutter app as a Skia picture. Requires "--$_kObservatoryUrl".', diff --git a/packages/flutter_tools/lib/src/commands/upgrade.dart b/packages/flutter_tools/lib/src/commands/upgrade.dart index 4e66e83be8..811248517c 100644 --- a/packages/flutter_tools/lib/src/commands/upgrade.dart +++ b/packages/flutter_tools/lib/src/commands/upgrade.dart @@ -246,15 +246,15 @@ class UpgradeCommandRunner { if (errorString.contains('fatal: HEAD does not point to a branch')) { throwToolExit( 'You are not currently on a release branch. Use git to ' - 'check out an official branch (\'stable\', \'beta\', \'dev\', or \'master\') ' + "check out an official branch ('stable', 'beta', 'dev', or 'master') " 'and retry, for example:\n' ' git checkout stable' ); } else if (errorString.contains('fatal: no upstream configured for branch')) { throwToolExit( 'Unable to upgrade Flutter: no origin repository configured. ' - 'Run \'git remote add origin ' - 'https://github.com/flutter/flutter\' in $workingDirectory'); + "Run 'git remote add origin " + "https://github.com/flutter/flutter' in $workingDirectory"); } else { throwToolExit(errorString); } diff --git a/packages/flutter_tools/lib/src/flutter_plugins.dart b/packages/flutter_tools/lib/src/flutter_plugins.dart index 13b6b8534a..7634f383fc 100644 --- a/packages/flutter_tools/lib/src/flutter_plugins.dart +++ b/packages/flutter_tools/lib/src/flutter_plugins.dart @@ -1098,7 +1098,7 @@ List resolvePlatformImplementation( if (defaultImplementation == null) { if (throwOnPluginPubspecError) { globals.printError( - 'Plugin `${plugin.name}` doesn\'t implement a plugin interface, nor sets ' + "Plugin `${plugin.name}` doesn't implement a plugin interface, nor sets " 'a default implementation in pubspec.yaml.\n\n' 'To set a default implementation, use:\n' 'flutter:\n' diff --git a/packages/flutter_tools/lib/src/isolated/devfs_web.dart b/packages/flutter_tools/lib/src/isolated/devfs_web.dart index 8adac8ef2c..ba07f7dca3 100644 --- a/packages/flutter_tools/lib/src/isolated/devfs_web.dart +++ b/packages/flutter_tools/lib/src/isolated/devfs_web.dart @@ -106,7 +106,7 @@ class WebExpressionCompiler implements ExpressionCompiler { } return ExpressionCompilationResult( - 'InternalError: frontend server failed to compile \'$expression\'', + "InternalError: frontend server failed to compile '$expression'", true); } diff --git a/packages/flutter_tools/lib/src/localizations/gen_l10n.dart b/packages/flutter_tools/lib/src/localizations/gen_l10n.dart index 51f71e5962..11180ade49 100644 --- a/packages/flutter_tools/lib/src/localizations/gen_l10n.dart +++ b/packages/flutter_tools/lib/src/localizations/gen_l10n.dart @@ -107,7 +107,7 @@ String generateDateFormattingLogic(Message message) { 'the "${placeholder.type}" type. To properly resolve for the right ' '${placeholder.type} format, the "format" attribute needs to be set ' 'to determine which DateFormat to use. \n' - 'Check the intl library\'s DateFormat class constructors for allowed ' + "Check the intl library's DateFormat class constructors for allowed " 'date formats.' ); } @@ -115,7 +115,7 @@ String generateDateFormattingLogic(Message message) { throw L10nException( 'Date format "$placeholderFormat" for placeholder ' '${placeholder.name} does not have a corresponding DateFormat ' - 'constructor\n. Check the intl library\'s DateFormat class ' + "constructor\n. Check the intl library's DateFormat class " 'constructors for allowed date formats.' ); } @@ -140,7 +140,7 @@ String generateNumberFormattingLogic(Message message) { throw L10nException( 'Number format $placeholderFormat for the ${placeholder.name} ' 'placeholder does not have a corresponding NumberFormat constructor.\n' - 'Check the intl library\'s NumberFormat class constructors for allowed ' + "Check the intl library's NumberFormat class constructors for allowed " 'number formats.' ); } @@ -765,7 +765,7 @@ class LocalizationsGenerator { if (!directory.existsSync()) { throw L10nException( 'Directory does not exist: $directory.\n' - 'Please select a directory that contains the project\'s localizations ' + "Please select a directory that contains the project's localizations " 'resource files.' ); } @@ -1078,18 +1078,18 @@ class LocalizationsGenerator { final String? scriptCode = locale.scriptCode; if (countryCode == null && scriptCode == null) { - return 'Locale(\'$languageCode\')'; + return "Locale('$languageCode')"; } else if (countryCode != null && scriptCode == null) { - return 'Locale(\'$languageCode\', \'$countryCode\')'; + return "Locale('$languageCode', '$countryCode')"; } else if (countryCode != null && scriptCode != null) { - return 'Locale.fromSubtags(languageCode: \'$languageCode\', countryCode: \'$countryCode\', scriptCode: \'$scriptCode\')'; + return "Locale.fromSubtags(languageCode: '$languageCode', countryCode: '$countryCode', scriptCode: '$scriptCode')"; } else { - return 'Locale.fromSubtags(languageCode: \'$languageCode\', scriptCode: \'$scriptCode\')'; + return "Locale.fromSubtags(languageCode: '$languageCode', scriptCode: '$scriptCode')"; } }); final Set supportedLanguageCodes = Set.from( - _allBundles.locales.map((LocaleInfo locale) => '\'${locale.languageCode}\'') + _allBundles.locales.map((LocaleInfo locale) => "'${locale.languageCode}'") ); final List allLocales = _allBundles.locales.toList()..sort(); diff --git a/packages/flutter_tools/lib/src/macos/cocoapods.dart b/packages/flutter_tools/lib/src/macos/cocoapods.dart index 50f9e124a1..563d28189a 100644 --- a/packages/flutter_tools/lib/src/macos/cocoapods.dart +++ b/packages/flutter_tools/lib/src/macos/cocoapods.dart @@ -408,7 +408,7 @@ class CocoaPods { // the old parsed .flutter-plugins file, prompt the regeneration. Old line was: // plugin_pods = parse_KV_file('../.flutter-plugins') if (xcodeProject.podfile.existsSync() && - xcodeProject.podfile.readAsStringSync().contains('.flutter-plugins\'')) { + xcodeProject.podfile.readAsStringSync().contains(".flutter-plugins'")) { const String error = 'Warning: Podfile is out of date\n' '$outOfDatePluginsPodfileConsequence\n' 'To regenerate the Podfile, run:\n'; diff --git a/packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart index 95cc7014b3..18f69caa07 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart @@ -50,7 +50,7 @@ void main() { Artifacts: () => Artifacts.test(), }); - testUsingContext('get devices\' platform types', () async { + testUsingContext("get devices' platform types", () async { final List platformTypes = Device.devicesPlatformTypes( await globals.deviceManager.getAllConnectedDevices(), ); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart index 8ad9454ddb..5815e919e9 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart @@ -624,7 +624,7 @@ dev_dependencies: DeviceManager: () => _FakeDeviceManager([]), }); - testUsingContext('Don\'t build the asset manifest if --no-test-assets if informed', () async { + testUsingContext("Don't build the asset manifest if --no-test-assets if informed", () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); diff --git a/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart b/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart index df16d12c2b..c09b131d77 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart @@ -226,8 +226,8 @@ void main() { 'Analyzing', 'info $analyzerSeparator Avoid empty else statements', 'info $analyzerSeparator Avoid empty statements', - 'info $analyzerSeparator The declaration \'_incrementCounter\' isn\'t', - 'warning $analyzerSeparator The parameter \'onPressed\' is required', + "info $analyzerSeparator The declaration '_incrementCounter' isn't", + "warning $analyzerSeparator The parameter 'onPressed' is required", ], exitMessageContains: '4 issues found.', toolExit: true, @@ -272,9 +272,9 @@ void main() { arguments: ['analyze', '--no-pub'], statusTextContains: [ 'Analyzing', - 'info $analyzerSeparator The declaration \'_incrementCounter\' isn\'t', + "info $analyzerSeparator The declaration '_incrementCounter' isn't", 'info $analyzerSeparator Only throw instances of classes extending either Exception or Error', - 'warning $analyzerSeparator The parameter \'onPressed\' is required', + "warning $analyzerSeparator The parameter 'onPressed' is required", ], exitMessageContains: '3 issues found.', toolExit: true, diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index c136e05ac2..8809517e4f 100755 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -36,7 +36,7 @@ import '../../src/fakes.dart'; import '../../src/pubspec_schema.dart'; import '../../src/test_flutter_command_runner.dart'; -const String _kNoPlatformsMessage = 'You\'ve created a plugin project that doesn\'t yet support any platforms.\n'; +const String _kNoPlatformsMessage = "You've created a plugin project that doesn't yet support any platforms.\n"; const String frameworkRevision = '12345678'; const String frameworkChannel = 'omega'; const String _kDisabledPlatformRequestedMessage = 'currently not supported on your local environment.'; diff --git a/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart b/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart index 6376e06e9f..d58d9285b8 100644 --- a/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart +++ b/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart @@ -34,7 +34,7 @@ void main() { '-v', 'time', '-T', - '\'$kLastLogcatTimestamp\'', + "'$kLastLogcatTimestamp'", ], ) ]); diff --git a/packages/flutter_tools/test/general.shard/android/deferred_components_gen_snapshot_validator_test.dart b/packages/flutter_tools/test/general.shard/android/deferred_components_gen_snapshot_validator_test.dart index 6e6231c729..edf9661996 100644 --- a/packages/flutter_tools/test/general.shard/android/deferred_components_gen_snapshot_validator_test.dart +++ b/packages/flutter_tools/test/general.shard/android/deferred_components_gen_snapshot_validator_test.dart @@ -228,7 +228,7 @@ loading-units-spelled-wrong: validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); - expect(logger.statusText, contains('Invalid loading units yaml file, \'loading-units\' entry did not exist.')); + expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' entry did not exist.")); expect(logger.statusText.contains('Previously existing loading units no longer exist:\n\n LoadingUnit 2\n Libraries:\n - lib1\n'), false); }); @@ -253,7 +253,7 @@ loading-units: hello validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); - expect(logger.statusText, contains('Invalid loading units yaml file, \'loading-units\' is not a list.')); + expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' is not a list.")); }); testWithoutContext('loadingUnitCache validator detects malformed file: not a list', () async { @@ -278,7 +278,7 @@ loading-units: validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); - expect(logger.statusText, contains('Invalid loading units yaml file, \'loading-units\' is not a list of maps.')); + expect(logger.statusText, contains("Invalid loading units yaml file, 'loading-units' is not a list of maps.")); }); testWithoutContext('loadingUnitCache validator detects malformed file: missing id', () async { @@ -307,7 +307,7 @@ loading-units: validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); - expect(logger.statusText, contains('Invalid loading units yaml file, all loading units must have an \'id\'')); + expect(logger.statusText, contains("Invalid loading units yaml file, all loading units must have an 'id'")); }); testWithoutContext('loadingUnitCache validator detects malformed file: libraries is list', () async { @@ -335,7 +335,7 @@ loading-units: validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); - expect(logger.statusText, contains('Invalid loading units yaml file, \'libraries\' is not a list.')); + expect(logger.statusText, contains("Invalid loading units yaml file, 'libraries' is not a list.")); }); testWithoutContext('loadingUnitCache validator detects malformed file: libraries is list of strings', () async { @@ -365,7 +365,7 @@ loading-units: validator.attemptToolExit(); expect(logger.statusText, contains('Errors checking the following files:')); - expect(logger.statusText, contains('Invalid loading units yaml file, \'libraries\' is not a list of strings.')); + expect(logger.statusText, contains("Invalid loading units yaml file, 'libraries' is not a list of strings.")); }); testWithoutContext('loadingUnitCache validator detects malformed file: empty libraries allowed', () async { @@ -460,7 +460,7 @@ loading-units: expect(manifestOutput.existsSync(), true); expect(manifestOutput.readAsStringSync().contains(''), true); expect(manifestOutput.readAsStringSync().contains('android:value="invalidmapping"'), false); - expect(manifestOutput.readAsStringSync().contains('