Enable avoid_escaping_inner_quotes lint (#81153)

This commit is contained in:
Hattomo (TomohiroHattori) 2021-05-20 01:54:02 +09:00 committed by GitHub
parent 0c5f2f4ab9
commit 08a70e7ac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
81 changed files with 192 additions and 192 deletions

View File

@ -64,7 +64,7 @@ linter:
# - avoid_dynamic_calls # not yet tested # - avoid_dynamic_calls # not yet tested
- avoid_empty_else - avoid_empty_else
- avoid_equals_and_hash_code_on_mutable_classes - 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_field_initializers_in_const_classes
- avoid_function_literals_in_foreach_calls - avoid_function_literals_in_foreach_calls
# - avoid_implementing_value_types # not yet tested # - avoid_implementing_value_types # not yet tested

View File

@ -74,7 +74,7 @@ Future<double> _runBasicStandardLarge(BasicMessageChannel<Object> basicStandard,
if (size != largeBuffer.length * count) { if (size != largeBuffer.length * count) {
throw Exception( 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<double> _runBasicBinary(BasicMessageChannel<ByteData> basicBinary,
watch.stop(); watch.stop();
if (size != buffer.lengthInBytes * count) { if (size != buffer.lengthInBytes * count) {
throw Exception( 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",
); );
} }

View File

@ -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;', '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)', '>>> 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),', '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(', 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:30:9: new Opacity(',
'>>> info: Unnecessary new keyword (unnecessary_new)', '>>> info: Unnecessary new keyword (unnecessary_new)',
'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:62:9: new Opacity(', 'dev/bots/test/analyze-sample-code-test-input/known_broken_documentation.dart:62:9: new Opacity(',
'>>> info: Unnecessary new keyword (unnecessary_new)', '>>> 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)', '>>> 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)', '>>> 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)', '>>> 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)', '>>> 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;', '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)', '>>> 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;', '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.', 'Found 2 sample code errors.',
'' ''

View File

@ -48,7 +48,7 @@ Future<void> 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 inDirectory(tempDir, () async {
await flutter( await flutter(

View File

@ -26,7 +26,7 @@ Future<void> main() async {
]); ]);
final File apk = File('${flutterProject.rootPath}/build/app/outputs/flutter-apk/app-debug.apk'); final File apk = File('${flutterProject.rootPath}/build/app/outputs/flutter-apk/app-debug.apk');
if (!apk.existsSync()) { 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 // https://github.com/flutter/flutter/issues/72185
await checkApkContainsMethods(apk, <String>[ await checkApkContainsMethods(apk, <String>[

View File

@ -33,7 +33,7 @@ Future<void> main() async {
); );
if (!pluginMainKotlinFile.existsSync()) { 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'); section('add java 8 feature');

View File

@ -292,7 +292,7 @@ class BlinkTraceSummary {
Exception noMeasuredFramesFound() => Exception( Exception noMeasuredFramesFound() => Exception(
'No measured frames found in benchmark tracing data. This likely ' 'No measured frames found in benchmark tracing data. This likely '
'indicates a bug in the benchmark. For example, the benchmark failed ' '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 ' 'tracing data format. Check if Chrome version changed recently and '
'adjust the parsing code accordingly.', 'adjust the parsing code accordingly.',
); );

View File

@ -56,7 +56,7 @@ class CodesignCommand extends Command<void> {
argParser.addOption( argParser.addOption(
kUpstream, kUpstream,
defaultsTo: FrameworkRepository.defaultUpstream, 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( argParser.addOption(
kRevision, kRevision,

View File

@ -377,7 +377,7 @@ abstract class Repository {
'commit', 'commit',
'--allow-empty', '--allow-empty',
'-m', '-m',
'\'$message\'', "'$message'",
], ],
'create an empty commit', 'create an empty commit',
workingDirectory: checkoutDirectory.path, workingDirectory: checkoutDirectory.path,

View File

@ -1057,7 +1057,7 @@ Future<DateTimeRange?> showDateRangePicker({
); );
assert( assert(
initialDateRange == null || !initialDateRange.start.isAfter(initialDateRange.end), 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); initialDateRange = initialDateRange == null ? null : DateUtils.datesOnly(initialDateRange);
assert(firstDate != null); assert(firstDate != null);
@ -1070,19 +1070,19 @@ Future<DateTimeRange?> showDateRangePicker({
); );
assert( assert(
initialDateRange == null || !initialDateRange.start.isBefore(firstDate), 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( assert(
initialDateRange == null || !initialDateRange.end.isBefore(firstDate), 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( assert(
initialDateRange == null || !initialDateRange.start.isAfter(lastDate), 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( assert(
initialDateRange == null || !initialDateRange.end.isAfter(lastDate), 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()); currentDate = DateUtils.dateOnly(currentDate ?? DateTime.now());
assert(initialEntryMode != null); assert(initialEntryMode != null);

View File

@ -204,7 +204,7 @@ class SelectableText extends StatefulWidget {
assert(minLines == null || minLines > 0), assert(minLines == null || minLines > 0),
assert( assert(
(maxLines == null) || (minLines == null) || (maxLines >= minLines), (maxLines == null) || (minLines == null) || (maxLines >= minLines),
'minLines can\'t be greater than maxLines', "minLines can't be greater than maxLines",
), ),
assert( assert(
data != null, data != null,
@ -257,7 +257,7 @@ class SelectableText extends StatefulWidget {
assert(minLines == null || minLines > 0), assert(minLines == null || minLines > 0),
assert( assert(
(maxLines == null) || (minLines == null) || (maxLines >= minLines), (maxLines == null) || (minLines == null) || (maxLines >= minLines),
'minLines can\'t be greater than maxLines', "minLines can't be greater than maxLines",
), ),
assert( assert(
textSpan != null, textSpan != null,

View File

@ -606,13 +606,13 @@ class _TabBarScrollController extends ScrollController {
/// body: const TabBarView( /// body: const TabBarView(
/// children: <Widget>[ /// children: <Widget>[
/// Center( /// Center(
/// child: Text('It\'s cloudy here'), /// child: Text("It's cloudy here"),
/// ), /// ),
/// Center( /// Center(
/// child: Text('It\'s rainy here'), /// child: Text("It's rainy here"),
/// ), /// ),
/// Center( /// Center(
/// child: Text('It\'s sunny here'), /// child: Text("It's sunny here"),
/// ), /// ),
/// ], /// ],
/// ), /// ),
@ -661,13 +661,13 @@ class _TabBarScrollController extends ScrollController {
/// controller: _tabController, /// controller: _tabController,
/// children: const <Widget>[ /// children: const <Widget>[
/// Center( /// Center(
/// child: Text('It\'s cloudy here'), /// child: Text("It's cloudy here"),
/// ), /// ),
/// Center( /// Center(
/// child: Text('It\'s rainy here'), /// child: Text("It's rainy here"),
/// ), /// ),
/// Center( /// Center(
/// child: Text('It\'s sunny here'), /// child: Text("It's sunny here"),
/// ), /// ),
/// ], /// ],
/// ), /// ),

View File

@ -1941,7 +1941,7 @@ abstract class RenderBox extends RenderObject {
'otherwise, the only object that is allowed to read RenderBox.size ' '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 ' '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 ' 'trying to access a child\'s size, pass "parentUsesSize: true" to '
'that child\'s layout().', "that child's layout().",
); );
} }
assert(_size == this._size); assert(_size == this._size);

View File

@ -501,7 +501,7 @@ class RenderAspectRatio extends RenderProxyBox {
'$runtimeType has unbounded constraints.\n' '$runtimeType has unbounded constraints.\n'
'This $runtimeType was given an aspect ratio of $aspectRatio but was given ' 'This $runtimeType was given an aspect ratio of $aspectRatio but was given '
'both unbounded width and unbounded height constraints. Because both ' '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.', 'size to consume.',
); );
} }

View File

@ -372,7 +372,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// ), /// ),
/// validator: (String? value) { /// validator: (String? value) {
/// if (value == null || value.isEmpty) { /// if (value == null || value.isEmpty) {
/// return 'Can\'t be empty.'; /// return "Can't be empty.";
/// } /// }
/// return null; /// return null;
/// }, /// },

View File

@ -3852,9 +3852,9 @@ class Stack extends MultiChildRenderObjectWidget {
if (alignment is AlignmentDirectional && textDirection == null) { if (alignment is AlignmentDirectional && textDirection == null) {
assert(debugCheckHasDirectionality( assert(debugCheckHasDirectionality(
context, context,
why: 'to resolve the \'alignment\' argument', why: "to resolve the 'alignment' argument",
hint: alignment == AlignmentDirectional.topStart ? 'The default value for \'alignment\' is AlignmentDirectional.topStart, which requires a text direction.' : null, 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.', 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; return true;

View File

@ -3464,7 +3464,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
'All routes returned by onGenerateInitialRoutes are not restorable. ' 'All routes returned by onGenerateInitialRoutes are not restorable. '
'Please make sure that all routes returned by onGenerateInitialRoutes ' 'Please make sure that all routes returned by onGenerateInitialRoutes '
'have their RouteSettings defined with names that are defined in the ' 'have their RouteSettings defined with names that are defined in the '
'app\'s routes table.', "app's routes table.",
); );
assert(!_debugLocked); assert(!_debugLocked);
assert(() { _debugLocked = true; return true; }()); assert(() { _debugLocked = true; return true; }());

View File

@ -254,7 +254,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
/// If there is any overscroll, it is reported using [didOverscrollBy]. /// If there is any overscroll, it is reported using [didOverscrollBy].
double setPixels(double newPixels) { double setPixels(double newPixels) {
assert(hasPixels); 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) { if (newPixels != pixels) {
final double overscroll = applyBoundaryConditions(newPixels); final double overscroll = applyBoundaryConditions(newPixels);
assert(() { assert(() {

View File

@ -972,7 +972,7 @@ class RawScrollbarState<T extends RawScrollbar> extends State<T> with TickerProv
if (!scrollController!.hasClients) { if (!scrollController!.hasClients) {
throw FlutterError.fromParts(<DiagnosticsNode>[ throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary( ErrorSummary(
'The Scrollbar\'s ScrollController has no ScrollPosition attached.', "The Scrollbar's ScrollController has no ScrollPosition attached.",
), ),
ErrorDescription( ErrorDescription(
'A Scrollbar cannot be painted without a ScrollPosition. ', 'A Scrollbar cannot be painted without a ScrollPosition. ',

View File

@ -1352,7 +1352,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
} else { } else {
throw FlutterError( throw FlutterError(
'Could not find the number of children in ${widget.delegate}.\n' '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 ' '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 ' 'possible integer) did not return null. Consider implementing childCount to avoid '
'the cost of searching for the final child.', 'the cost of searching for the final child.',

View File

@ -144,8 +144,8 @@ class Viewport extends MultiChildRenderObjectWidget {
case AxisDirection.up: case AxisDirection.up:
assert(debugCheckHasDirectionality( assert(debugCheckHasDirectionality(
context, context,
why: 'to determine the cross-axis direction when the viewport has an \'up\' axisDirection', why: "to determine the cross-axis direction when the viewport has an 'up' axisDirection",
alternative: 'Alternatively, consider specifying the \'crossAxisDirection\' argument on the Viewport.', alternative: "Alternatively, consider specifying the 'crossAxisDirection' argument on the Viewport.",
)); ));
return textDirectionToAxisDirection(Directionality.of(context)); return textDirectionToAxisDirection(Directionality.of(context));
case AxisDirection.right: case AxisDirection.right:
@ -153,8 +153,8 @@ class Viewport extends MultiChildRenderObjectWidget {
case AxisDirection.down: case AxisDirection.down:
assert(debugCheckHasDirectionality( assert(debugCheckHasDirectionality(
context, context,
why: 'to determine the cross-axis direction when the viewport has a \'down\' axisDirection', why: "to determine the cross-axis direction when the viewport has a 'down' axisDirection",
alternative: 'Alternatively, consider specifying the \'crossAxisDirection\' argument on the Viewport.', alternative: "Alternatively, consider specifying the 'crossAxisDirection' argument on the Viewport.",
)); ));
return textDirectionToAxisDirection(Directionality.of(context)); return textDirectionToAxisDirection(Directionality.of(context));
case AxisDirection.left: case AxisDirection.left:

View File

@ -296,7 +296,7 @@ void main() {
variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS }), variant: const TargetPlatformVariant(<TargetPlatform>{ 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. // Set the screen size to more narrow, so that Paste can't fit.
tester.binding.window.physicalSizeTestValue = const Size(800, 800); tester.binding.window.physicalSizeTestValue = const Size(800, 800);
addTearDown(tester.binding.window.clearPhysicalSizeTestValue); addTearDown(tester.binding.window.clearPhysicalSizeTestValue);

View File

@ -156,7 +156,7 @@ void main() {
final PointerRouter router = PointerRouter(); final PointerRouter router = PointerRouter();
router.addRoute(2, (PointerEvent event) => throw 'Pointer exception'); router.addRoute(2, (PointerEvent event) => throw 'Pointer exception');
} catch (e) { } 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('route: Closure: (PointerEvent) => Null'));
expect(e, contains('event: PointerDownEvent#[a-zA-Z0-9]{5}(position: Offset(0.0, 0.0))')); expect(e, contains('event: PointerDownEvent#[a-zA-Z0-9]{5}(position: Offset(0.0, 0.0))'));
} }

View File

@ -78,10 +78,10 @@ void main() {
.toList(); .toList();
expect(description[0], 'decoration: BoxDecoration(color: Color(0xfffffff0))'); expect(description[0], 'decoration: BoxDecoration(color: Color(0xfffffff0))');
expect(description[1], 'dataRowColor: Instance of \'_MaterialStatePropertyWith<Color>\''); expect(description[1], "dataRowColor: Instance of '_MaterialStatePropertyWith<Color>'");
expect(description[2], 'dataRowHeight: 51.0'); expect(description[2], 'dataRowHeight: 51.0');
expect(description[3], 'dataTextStyle: TextStyle(inherit: true, size: 12.0)'); expect(description[3], 'dataTextStyle: TextStyle(inherit: true, size: 12.0)');
expect(description[4], 'headingRowColor: Instance of \'_MaterialStatePropertyWith<Color>\''); expect(description[4], "headingRowColor: Instance of '_MaterialStatePropertyWith<Color>'");
expect(description[5], 'headingRowHeight: 52.0'); expect(description[5], 'headingRowHeight: 52.0');
expect(description[6], 'headingTextStyle: TextStyle(inherit: true, size: 14.0)'); expect(description[6], 'headingTextStyle: TextStyle(inherit: true, size: 14.0)');
expect(description[7], 'horizontalMargin: 3.0'); expect(description[7], 'horizontalMargin: 3.0');

View File

@ -1716,7 +1716,7 @@ void main() {
expect(find.byType(Material), paints..path(color: defaultColor)); 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; late ListTileTheme theme;
bool isSelected = false; bool isSelected = false;
@ -1754,7 +1754,7 @@ void main() {
expect(find.byType(Material), paints..path(color: theme.selectedTileColor)); 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; bool isSelected = false;
final Color tileColor = Colors.green.shade500; final Color tileColor = Colors.green.shade500;
final Color selectedTileColor = Colors.red.shade500; final Color selectedTileColor = Colors.red.shade500;

View File

@ -607,13 +607,13 @@ void main() {
.toList(); .toList();
expect(description, <String>[ expect(description, <String>[
'thickness: Instance of \'_MaterialStatePropertyWith<double?>\'', "thickness: Instance of '_MaterialStatePropertyWith<double?>'",
'showTrackOnHover: true', 'showTrackOnHover: true',
'isAlwaysShown: true', 'isAlwaysShown: true',
'radius: Radius.circular(3.0)', 'radius: Radius.circular(3.0)',
'thumbColor: Instance of \'_MaterialStatePropertyWith<Color?>\'', "thumbColor: Instance of '_MaterialStatePropertyWith<Color?>'",
'trackColor: Instance of \'_MaterialStatePropertyWith<Color?>\'', "trackColor: Instance of '_MaterialStatePropertyWith<Color?>'",
'trackBorderColor: Instance of \'_MaterialStatePropertyWith<Color?>\'', "trackBorderColor: Instance of '_MaterialStatePropertyWith<Color?>'",
'crossAxisMargin: 3.0', 'crossAxisMargin: 3.0',
'mainAxisMargin: 6.0', 'mainAxisMargin: 6.0',
'minThumbLength: 120.0', 'minThumbLength: 120.0',

View File

@ -2778,7 +2778,7 @@ void main() {
}); });
group('Tab overlayColor affects ink response', () { 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( await tester.pumpWidget(
boilerplate( boilerplate(
child: DefaultTabController( child: DefaultTabController(
@ -2810,7 +2810,7 @@ void main() {
}); });
testWidgets( 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 { (WidgetTester tester) async {
const Color splashColor = Color(0xf00fffff); const Color splashColor = Color(0xf00fffff);
await tester.pumpWidget( await tester.pumpWidget(
@ -3430,7 +3430,7 @@ void main() {
// because we tried to send a notification on dispose. // 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( final TabController tabController = TabController(
vsync: const TestVSync(), vsync: const TestVSync(),
length: 3, length: 3,
@ -3520,7 +3520,7 @@ void main() {
expect(log, <String>['init: 0', 'init: 3', 'dispose: 0']); expect(log, <String>['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 // This is a regression test for the issue brought up here
// https://github.com/flutter/flutter/issues/79226 // https://github.com/flutter/flutter/issues/79226

View File

@ -524,7 +524,7 @@ void main() {
}); });
// Regression test for https://github.com/flutter/flutter/issues/34847. // 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( await tester.pumpWidget(
MaterialApp( MaterialApp(
home: Material( home: Material(
@ -549,7 +549,7 @@ void main() {
}); });
// Regression test for https://github.com/flutter/flutter/issues/34847. // 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( await tester.pumpWidget(
MaterialApp( MaterialApp(
home: Material( home: Material(

View File

@ -153,7 +153,7 @@ void main() {
variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.android }), variant: const TargetPlatformVariant(<TargetPlatform>{ 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. // Set the screen size to more narrow, so that Select all can't fit.
tester.binding.window.physicalSizeTestValue = const Size(1000, 800); tester.binding.window.physicalSizeTestValue = const Size(1000, 800);
addTearDown(tester.binding.window.clearPhysicalSizeTestValue); addTearDown(tester.binding.window.clearPhysicalSizeTestValue);

View File

@ -14,7 +14,7 @@ import '../rendering/rendering_tester.dart';
void main() { void main() {
TestRenderingFlutterBinding(); 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 Uint8List bytes = Uint8List.fromList(kTransparentImage);
final MemoryImage memoryImage = MemoryImage(bytes); final MemoryImage memoryImage = MemoryImage(bytes);
final ImageStream stream = memoryImage.resolve(ImageConfiguration.empty); final ImageStream stream = memoryImage.resolve(ImageConfiguration.empty);

View File

@ -40,7 +40,7 @@ void main() {
group('status bar', () { group('status bar', () {
testWidgets( testWidgets(
'statusBarColor isn\'t set for unannotated view', "statusBarColor isn't set for unannotated view",
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget(const SizedBox.expand()); await tester.pumpWidget(const SizedBox.expand());
await tester.pumpAndSettle(); await tester.pumpAndSettle();
@ -70,7 +70,7 @@ void main() {
); );
testWidgets( 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 { (WidgetTester tester) async {
setupTestDevice(); setupTestDevice();
const double lessThanHalfOfTheStatusBarHeight = const double lessThanHalfOfTheStatusBarHeight =
@ -125,7 +125,7 @@ void main() {
group('navigation color (Android only)', () { group('navigation color (Android only)', () {
testWidgets( testWidgets(
'systemNavigationBarColor isn\'t set for non Android device', "systemNavigationBarColor isn't set for non Android device",
(WidgetTester tester) async { (WidgetTester tester) async {
setupTestDevice(); setupTestDevice();
await tester.pumpWidget(const AnnotatedRegion<SystemUiOverlayStyle>( await tester.pumpWidget(const AnnotatedRegion<SystemUiOverlayStyle>(
@ -145,7 +145,7 @@ void main() {
); );
testWidgets( testWidgets(
'systemNavigationBarColor isn\'t set for unannotated view', "systemNavigationBarColor isn't set for unannotated view",
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget(const SizedBox.expand()); await tester.pumpWidget(const SizedBox.expand());
await tester.pumpAndSettle(); await tester.pumpAndSettle();
@ -176,7 +176,7 @@ void main() {
); );
testWidgets( 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 { (WidgetTester tester) async {
setupTestDevice(); setupTestDevice();
const double lessThanHalfOfTheNavigationBarHeight = const double lessThanHalfOfTheNavigationBarHeight =

View File

@ -94,7 +94,7 @@ void main() {
expect(calls, 2); expect(calls, 2);
}); });
testWidgets('LayoutBuilder returns child\'s baseline', (WidgetTester tester) async { testWidgets("LayoutBuilder returns child's baseline", (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
home: Material( home: Material(

View File

@ -33,7 +33,7 @@ void main() {
' must have unique keys.\n' ' must have unique keys.\n'
' Flex(direction: vertical, mainAxisAlignment: start,\n' ' Flex(direction: vertical, mainAxisAlignment: start,\n'
' crossAxisAlignment: center) has multiple children with key\n' ' crossAxisAlignment: center) has multiple children with key\n'
' [<\'key\'>].\n', " [<'key'>].\n",
), ),
); );
} }

View File

@ -6869,7 +6869,7 @@ void main() {
}); });
// Regression test for https://github.com/flutter/flutter/issues/68086. // 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( await setupWidget(
tester, tester,
LengthLimitingTextInputFormatter( 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'; const String string = '👨👩👦0123456';
await setupWidget(tester, LengthLimitingTextInputFormatter(maxLength)); await setupWidget(tester, LengthLimitingTextInputFormatter(maxLength));

View File

@ -1285,7 +1285,7 @@ void main() {
expect(log, <String>['building B', 'building C', 'found C', 'building D']); expect(log, <String>['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<NavigatorState> key = GlobalKey<NavigatorState>(); final GlobalKey<NavigatorState> key = GlobalKey<NavigatorState>();
final List<String> log = <String>[]; final List<String> log = <String>[];
Route<dynamic>? nextRoute = PageRouteBuilder<int>( Route<dynamic>? nextRoute = PageRouteBuilder<int>(

View File

@ -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( final ScrollMetrics position = FixedScrollMetrics(
minScrollExtent: 0.0, minScrollExtent: 0.0,
maxScrollExtent: 100.0, maxScrollExtent: 100.0,

View File

@ -137,7 +137,7 @@ Future<void> performTest(WidgetTester tester, bool maintainState) async {
} }
void main() { 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; int count = 0;
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
home: ListView.builder( home: ListView.builder(

View File

@ -1043,7 +1043,7 @@ void main() {
expect(exception, isAssertionError); expect(exception, isAssertionError);
expect( expect(
(exception as AssertionError).message, (exception as AssertionError).message,
contains('The Scrollbar\'s ScrollController has no ScrollPosition attached.'), contains("The Scrollbar's ScrollController has no ScrollPosition attached."),
); );
}); });

View File

@ -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 _MockRenderSliver mock = _MockRenderSliver();
final RenderSliverPadding renderObject = RenderSliverPadding( final RenderSliverPadding renderObject = RenderSliverPadding(
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
@ -494,7 +494,7 @@ void main() {
expect(mock.constraints.overlap, 80.0); 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 _MockRenderSliver mock = _MockRenderSliver();
final RenderSliverPadding renderObject = RenderSliverPadding( final RenderSliverPadding renderObject = RenderSliverPadding(
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),

View File

@ -765,8 +765,8 @@ void main() {
expect( expect(
tester.takeException().toString(), tester.takeException().toString(),
'No Directionality widget found.\n' 'No Directionality widget found.\n'
'Stack widgets require a Directionality widget ancestor to resolve the \'alignment\' argument.\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 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' 'The specific widget that could not find a Directionality ancestor was:\n'
' Stack\n' ' Stack\n'
'The ownership chain for the affected widget is: "Stack ← [root]"\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 ' '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' 'EdgeInsetsDirectional, AlignmentDirectional, and other *Directional objects.\n'
'Instead of providing a Directionality widget, another solution would be passing a non-directional ' '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.",
); );
}); });
} }

View File

@ -106,7 +106,7 @@ class WebFlutterDriver extends FlutterDriver {
// //
// TODO(angjieli): Support Mobile Web. (https://github.com/flutter/flutter/issues/65192) // TODO(angjieli): Support Mobile Web. (https://github.com/flutter/flutter/issues/65192)
await webDriver.execute( await webDriver.execute(
'document.querySelector(\'flt-semantics-placeholder\').click();', "document.querySelector('flt-semantics-placeholder').click();",
<String>[]); <String>[]);
_accessibilityEnabled = true; _accessibilityEnabled = true;
} }

View File

@ -1031,7 +1031,7 @@ class AdbLogReader extends DeviceLogReader {
final String lastLogcatTimestamp = await device.lastLogcatTimestamp(); final String lastLogcatTimestamp = await device.lastLogcatTimestamp();
args.addAll(<String>[ args.addAll(<String>[
'-T', '-T',
if (lastLogcatTimestamp != null) '\'$lastLogcatTimestamp\'' else '0', if (lastLogcatTimestamp != null) "'$lastLogcatTimestamp'" else '0',
]); ]);
} }
final Process process = await processManager.start(device.adbCommandForDevice(args)); final Process process = await processManager.start(device.adbCommandForDevice(args));

View File

@ -80,7 +80,7 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator
if (!appManifestFile.existsSync()) { if (!appManifestFile.existsSync()) {
invalidFiles[appManifestFile.path] = 'Error: $appManifestFile does not ' invalidFiles[appManifestFile.path] = 'Error: $appManifestFile does not '
'exist or could not be found. Please ensure an AndroidManifest.xml ' '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; return false;
} }
XmlDocument document; XmlDocument document;
@ -222,37 +222,37 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator
final YamlMap data = loadYaml(cacheFile.readAsStringSync()) as YamlMap; final YamlMap data = loadYaml(cacheFile.readAsStringSync()) as YamlMap;
// validate yaml format. // validate yaml format.
if (!data.containsKey('loading-units')) { 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.'; 'entry did not exist.';
return loadingUnits; return loadingUnits;
} else { } else {
if (data['loading-units'] is! YamlList && data['loading-units'] != null) { 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.'; 'is not a list.';
return loadingUnits; return loadingUnits;
} }
if (data['loading-units'] != null) { if (data['loading-units'] != null) {
for (final dynamic loadingUnitData in data['loading-units']) { for (final dynamic loadingUnitData in data['loading-units']) {
if (loadingUnitData is! YamlMap) { 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.'; 'is not a list of maps.';
return loadingUnits; return loadingUnits;
} }
final YamlMap loadingUnitDataMap = loadingUnitData as YamlMap; final YamlMap loadingUnitDataMap = loadingUnitData as YamlMap;
if (loadingUnitDataMap['id'] == null) { if (loadingUnitDataMap['id'] == null) {
invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, all ' invalidFiles[cacheFile.path] = 'Invalid loading units yaml file, all '
'loading units must have an \'id\''; "loading units must have an 'id'";
return loadingUnits; return loadingUnits;
} }
if (loadingUnitDataMap['libraries'] != null) { if (loadingUnitDataMap['libraries'] != null) {
if (loadingUnitDataMap['libraries'] is! YamlList) { 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.'; 'is not a list.';
return loadingUnits; return loadingUnits;
} }
for (final dynamic node in loadingUnitDataMap['libraries'] as YamlList) { for (final dynamic node in loadingUnitDataMap['libraries'] as YamlList) {
if (node is! String) { 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.'; 'is not a list of strings.';
return loadingUnits; return loadingUnits;
} }

View File

@ -388,7 +388,7 @@ final GradleHandledError minSdkVersion = GradleHandledError(
' }\n' ' }\n'
'}\n\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.' 'Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.'
); );
return GradleBuildStatus.exit; return GradleBuildStatus.exit;

View File

@ -110,13 +110,13 @@ distributionUrl=https\\://services.gradle.org/distributions/gradle-$gradleVersio
String getGradleVersionForAndroidPlugin(Directory directory, Logger logger) { String getGradleVersionForAndroidPlugin(Directory directory, Logger logger) {
final File buildFile = directory.childFile('build.gradle'); final File buildFile = directory.childFile('build.gradle');
if (!buildFile.existsSync()) { 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; return _defaultGradleVersion;
} }
final String buildFileContent = buildFile.readAsStringSync(); final String buildFileContent = buildFile.readAsStringSync();
final Iterable<Match> pluginMatches = _androidPluginRegExp.allMatches(buildFileContent); final Iterable<Match> pluginMatches = _androidPluginRegExp.allMatches(buildFileContent);
if (pluginMatches.isEmpty) { 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; return _defaultGradleVersion;
} }
final String androidPluginVersion = pluginMatches.first.group(1); final String androidPluginVersion = pluginMatches.first.group(1);

View File

@ -90,7 +90,7 @@ class ErrorHandlingFileSystem extends ForwardingFileSystem {
if (file.existsSync()) { if (file.existsSync()) {
throwToolExit( throwToolExit(
'The Flutter tool tried to delete the file or directory ${file.path} but was ' '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', 'volume. Consider relocating the project and trying again',
); );
} }

View File

@ -351,7 +351,7 @@ class _LinuxUtils extends _PosixUtils {
final String value = entryKeyValuePair[1]; final String value = entryKeyValuePair[1];
// Remove quotes from either end of the value if they exist // Remove quotes from either end of the value if they exist
final String quote = value[0]; final String quote = value[0];
if (quote == '\'' || quote == '"') { if (quote == "'" || quote == '"') {
return value.substring(0, value.length - 1).substring(1); return value.substring(0, value.length - 1).substring(1);
} else { } else {
return value; return value;

View File

@ -63,7 +63,7 @@ class BuildApkCommand extends BuildSubCommand {
"This command can build debug and release versions of your application. 'debug' builds support " "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 " "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, ' '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/guide/app-bundle\n'
' * https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split'; ' * https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split';

View File

@ -128,11 +128,11 @@ class GenerateLocalizationsCommand extends FlutterCommand {
'gen-inputs-and-outputs-list', 'gen-inputs-and-outputs-list',
valueHelp: 'path-to-output-directory', valueHelp: 'path-to-output-directory',
help: 'When specified, the tool generates a JSON file containing the ' 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' '\n'
'This can be useful for keeping track of which files of the Flutter ' 'This can be useful for keeping track of which files of the Flutter '
'project were used when generating the latest set of localizations. ' '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' 'keep track of when to call gen_l10n during hot reload.\n'
'\n' '\n'
'The value of this option is the directory where the JSON file will be ' 'The value of this option is the directory where the JSON file will be '

View File

@ -23,7 +23,7 @@ import '../runner/flutter_command.dart';
class PackagesCommand extends FlutterCommand { class PackagesCommand extends FlutterCommand {
PackagesCommand() { PackagesCommand() {
addSubcommand(PackagesGetCommand('get', false)); 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('add', 'Add a dependency to pubspec.yaml.'));
addSubcommand(PackagesInteractiveGetCommand('remove', 'Removes a dependency from the current package.')); addSubcommand(PackagesInteractiveGetCommand('remove', 'Removes a dependency from the current package.'));
addSubcommand(PackagesTestCommand()); addSubcommand(PackagesTestCommand());

View File

@ -261,7 +261,7 @@ class RunCommand extends RunCommandBase {
'or just dump the trace as soon as the application is running. The first frame ' '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 ' 'is detected by looking for a Timeline event with the name '
'"${Tracing.firstUsefulFrameEventName}". ' '"${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', ..addFlag('use-test-fonts',
negatable: true, negatable: true,

View File

@ -44,7 +44,7 @@ class ScreenshotCommand extends FlutterCommand {
help: 'The type of screenshot to retrieve.', help: 'The type of screenshot to retrieve.',
allowed: const <String>[_kDeviceType, _kSkiaType, _kRasterizerType], allowed: const <String>[_kDeviceType, _kSkiaType, _kRasterizerType],
allowedHelp: const <String, String>{ allowedHelp: const <String, String>{
_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 ' 'screenshots the entire screen currently being displayed (including content '
'not rendered by Flutter, like the device status bar).', 'not rendered by Flutter, like the device status bar).',
_kSkiaType: 'Render the Flutter app as a Skia picture. Requires "--$_kObservatoryUrl".', _kSkiaType: 'Render the Flutter app as a Skia picture. Requires "--$_kObservatoryUrl".',

View File

@ -246,15 +246,15 @@ class UpgradeCommandRunner {
if (errorString.contains('fatal: HEAD does not point to a branch')) { if (errorString.contains('fatal: HEAD does not point to a branch')) {
throwToolExit( throwToolExit(
'You are not currently on a release branch. Use git to ' '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' 'and retry, for example:\n'
' git checkout stable' ' git checkout stable'
); );
} else if (errorString.contains('fatal: no upstream configured for branch')) { } else if (errorString.contains('fatal: no upstream configured for branch')) {
throwToolExit( throwToolExit(
'Unable to upgrade Flutter: no origin repository configured. ' 'Unable to upgrade Flutter: no origin repository configured. '
'Run \'git remote add origin ' "Run 'git remote add origin "
'https://github.com/flutter/flutter\' in $workingDirectory'); "https://github.com/flutter/flutter' in $workingDirectory");
} else { } else {
throwToolExit(errorString); throwToolExit(errorString);
} }

View File

@ -1098,7 +1098,7 @@ List<PluginInterfaceResolution> resolvePlatformImplementation(
if (defaultImplementation == null) { if (defaultImplementation == null) {
if (throwOnPluginPubspecError) { if (throwOnPluginPubspecError) {
globals.printError( 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' 'a default implementation in pubspec.yaml.\n\n'
'To set a default implementation, use:\n' 'To set a default implementation, use:\n'
'flutter:\n' 'flutter:\n'

View File

@ -106,7 +106,7 @@ class WebExpressionCompiler implements ExpressionCompiler {
} }
return ExpressionCompilationResult( return ExpressionCompilationResult(
'InternalError: frontend server failed to compile \'$expression\'', "InternalError: frontend server failed to compile '$expression'",
true); true);
} }

View File

@ -107,7 +107,7 @@ String generateDateFormattingLogic(Message message) {
'the "${placeholder.type}" type. To properly resolve for the right ' 'the "${placeholder.type}" type. To properly resolve for the right '
'${placeholder.type} format, the "format" attribute needs to be set ' '${placeholder.type} format, the "format" attribute needs to be set '
'to determine which DateFormat to use. \n' '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.' 'date formats.'
); );
} }
@ -115,7 +115,7 @@ String generateDateFormattingLogic(Message message) {
throw L10nException( throw L10nException(
'Date format "$placeholderFormat" for placeholder ' 'Date format "$placeholderFormat" for placeholder '
'${placeholder.name} does not have a corresponding DateFormat ' '${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.' 'constructors for allowed date formats.'
); );
} }
@ -140,7 +140,7 @@ String generateNumberFormattingLogic(Message message) {
throw L10nException( throw L10nException(
'Number format $placeholderFormat for the ${placeholder.name} ' 'Number format $placeholderFormat for the ${placeholder.name} '
'placeholder does not have a corresponding NumberFormat constructor.\n' '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.' 'number formats.'
); );
} }
@ -765,7 +765,7 @@ class LocalizationsGenerator {
if (!directory.existsSync()) { if (!directory.existsSync()) {
throw L10nException( throw L10nException(
'Directory does not exist: $directory.\n' '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.' 'resource files.'
); );
} }
@ -1078,18 +1078,18 @@ class LocalizationsGenerator {
final String? scriptCode = locale.scriptCode; final String? scriptCode = locale.scriptCode;
if (countryCode == null && scriptCode == null) { if (countryCode == null && scriptCode == null) {
return 'Locale(\'$languageCode\')'; return "Locale('$languageCode')";
} else if (countryCode != null && scriptCode == null) { } else if (countryCode != null && scriptCode == null) {
return 'Locale(\'$languageCode\', \'$countryCode\')'; return "Locale('$languageCode', '$countryCode')";
} else if (countryCode != null && scriptCode != null) { } 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 { } else {
return 'Locale.fromSubtags(languageCode: \'$languageCode\', scriptCode: \'$scriptCode\')'; return "Locale.fromSubtags(languageCode: '$languageCode', scriptCode: '$scriptCode')";
} }
}); });
final Set<String> supportedLanguageCodes = Set<String>.from( final Set<String> supportedLanguageCodes = Set<String>.from(
_allBundles.locales.map<String>((LocaleInfo locale) => '\'${locale.languageCode}\'') _allBundles.locales.map<String>((LocaleInfo locale) => "'${locale.languageCode}'")
); );
final List<LocaleInfo> allLocales = _allBundles.locales.toList()..sort(); final List<LocaleInfo> allLocales = _allBundles.locales.toList()..sort();

View File

@ -408,7 +408,7 @@ class CocoaPods {
// the old parsed .flutter-plugins file, prompt the regeneration. Old line was: // the old parsed .flutter-plugins file, prompt the regeneration. Old line was:
// plugin_pods = parse_KV_file('../.flutter-plugins') // plugin_pods = parse_KV_file('../.flutter-plugins')
if (xcodeProject.podfile.existsSync() && 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' const String error = 'Warning: Podfile is out of date\n'
'$outOfDatePluginsPodfileConsequence\n' '$outOfDatePluginsPodfileConsequence\n'
'To regenerate the Podfile, run:\n'; 'To regenerate the Podfile, run:\n';

View File

@ -50,7 +50,7 @@ void main() {
Artifacts: () => Artifacts.test(), Artifacts: () => Artifacts.test(),
}); });
testUsingContext('get devices\' platform types', () async { testUsingContext("get devices' platform types", () async {
final List<String> platformTypes = Device.devicesPlatformTypes( final List<String> platformTypes = Device.devicesPlatformTypes(
await globals.deviceManager.getAllConnectedDevices(), await globals.deviceManager.getAllConnectedDevices(),
); );

View File

@ -624,7 +624,7 @@ dev_dependencies:
DeviceManager: () => _FakeDeviceManager(<Device>[]), DeviceManager: () => _FakeDeviceManager(<Device>[]),
}); });
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 FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
final TestCommand testCommand = TestCommand(testRunner: testRunner); final TestCommand testCommand = TestCommand(testRunner: testRunner);

View File

@ -226,8 +226,8 @@ void main() {
'Analyzing', 'Analyzing',
'info $analyzerSeparator Avoid empty else statements', 'info $analyzerSeparator Avoid empty else statements',
'info $analyzerSeparator Avoid empty statements', 'info $analyzerSeparator Avoid empty statements',
'info $analyzerSeparator The declaration \'_incrementCounter\' isn\'t', "info $analyzerSeparator The declaration '_incrementCounter' isn't",
'warning $analyzerSeparator The parameter \'onPressed\' is required', "warning $analyzerSeparator The parameter 'onPressed' is required",
], ],
exitMessageContains: '4 issues found.', exitMessageContains: '4 issues found.',
toolExit: true, toolExit: true,
@ -272,9 +272,9 @@ void main() {
arguments: <String>['analyze', '--no-pub'], arguments: <String>['analyze', '--no-pub'],
statusTextContains: <String>[ statusTextContains: <String>[
'Analyzing', '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', '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.', exitMessageContains: '3 issues found.',
toolExit: true, toolExit: true,

View File

@ -36,7 +36,7 @@ import '../../src/fakes.dart';
import '../../src/pubspec_schema.dart'; import '../../src/pubspec_schema.dart';
import '../../src/test_flutter_command_runner.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 frameworkRevision = '12345678';
const String frameworkChannel = 'omega'; const String frameworkChannel = 'omega';
const String _kDisabledPlatformRequestedMessage = 'currently not supported on your local environment.'; const String _kDisabledPlatformRequestedMessage = 'currently not supported on your local environment.';

View File

@ -34,7 +34,7 @@ void main() {
'-v', '-v',
'time', 'time',
'-T', '-T',
'\'$kLastLogcatTimestamp\'', "'$kLastLogcatTimestamp'",
], ],
) )
]); ]);

View File

@ -228,7 +228,7 @@ loading-units-spelled-wrong:
validator.attemptToolExit(); validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:')); 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); 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(); validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:')); 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 { testWithoutContext('loadingUnitCache validator detects malformed file: not a list', () async {
@ -278,7 +278,7 @@ loading-units:
validator.attemptToolExit(); validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:')); 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 { testWithoutContext('loadingUnitCache validator detects malformed file: missing id', () async {
@ -307,7 +307,7 @@ loading-units:
validator.attemptToolExit(); validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:')); 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 { testWithoutContext('loadingUnitCache validator detects malformed file: libraries is list', () async {
@ -335,7 +335,7 @@ loading-units:
validator.attemptToolExit(); validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:')); 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 { testWithoutContext('loadingUnitCache validator detects malformed file: libraries is list of strings', () async {
@ -365,7 +365,7 @@ loading-units:
validator.attemptToolExit(); validator.attemptToolExit();
expect(logger.statusText, contains('Errors checking the following files:')); 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 { testWithoutContext('loadingUnitCache validator detects malformed file: empty libraries allowed', () async {
@ -460,7 +460,7 @@ loading-units:
expect(manifestOutput.existsSync(), true); expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync().contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'), true); expect(manifestOutput.readAsStringSync().contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'), true);
expect(manifestOutput.readAsStringSync().contains('android:value="invalidmapping"'), false); expect(manifestOutput.readAsStringSync().contains('android:value="invalidmapping"'), false);
expect(manifestOutput.readAsStringSync().contains('<!-- Don\'t delete the meta-data below.'), true); expect(manifestOutput.readAsStringSync().contains("<!-- Don't delete the meta-data below."), true);
}); });
testWithoutContext('androidStringMapping adds mapping when no existing mapping', () async { testWithoutContext('androidStringMapping adds mapping when no existing mapping', () async {
@ -518,7 +518,7 @@ loading-units:
.childFile('AndroidManifest.xml'); .childFile('AndroidManifest.xml');
expect(manifestOutput.existsSync(), true); expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>')); expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'));
expect(manifestOutput.readAsStringSync(), contains('<!-- Don\'t delete the meta-data below.')); expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below."));
}); });
// The mapping is incorrectly placed in the activity instead of application. // The mapping is incorrectly placed in the activity instead of application.
@ -579,7 +579,7 @@ loading-units:
.childFile('AndroidManifest.xml'); .childFile('AndroidManifest.xml');
expect(manifestOutput.existsSync(), true); expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>')); expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'));
expect(manifestOutput.readAsStringSync(), contains('<!-- Don\'t delete the meta-data below.')); expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below."));
}); });
testWithoutContext('androidStringMapping generates base module loading unit mapping', () async { testWithoutContext('androidStringMapping generates base module loading unit mapping', () async {
@ -640,7 +640,7 @@ loading-units:
.childFile('AndroidManifest.xml'); .childFile('AndroidManifest.xml');
expect(manifestOutput.existsSync(), true); expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2,5:,6:"/>')); expect(manifestOutput.readAsStringSync(), contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2,5:,6:"/>'));
expect(manifestOutput.readAsStringSync(), contains('<!-- Don\'t delete the meta-data below.')); expect(manifestOutput.readAsStringSync(), contains("<!-- Don't delete the meta-data below."));
}); });
// Tests if all of the regexp whitespace detection is working. // Tests if all of the regexp whitespace detection is working.
@ -707,6 +707,6 @@ loading-units:
expect(manifestOutput.existsSync(), true); expect(manifestOutput.existsSync(), true);
expect(manifestOutput.readAsStringSync().contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'), true); expect(manifestOutput.readAsStringSync().contains('<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="3:component1,2:component2,4:component2"/>'), true);
expect(manifestOutput.readAsStringSync().contains(RegExp(r'android:value[\s\n]*=[\s\n]*"invalidmapping"')), false); expect(manifestOutput.readAsStringSync().contains(RegExp(r'android:value[\s\n]*=[\s\n]*"invalidmapping"')), false);
expect(manifestOutput.readAsStringSync().contains('<!-- Don\'t delete the meta-data below.'), true); expect(manifestOutput.readAsStringSync().contains("<!-- Don't delete the meta-data below."), true);
}); });
} }

View File

@ -677,7 +677,7 @@ assembleProfile
' }\n' ' }\n'
'}\n' '}\n'
'\n' '\n'
'Note that your app won\'t be available to users running Android SDKs below 19.\n' "Note that your app won't be available to users running Android SDKs below 19.\n"
'Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.\n' 'Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.\n'
'' ''
) )

View File

@ -49,7 +49,7 @@ final RegExp _bannedQuotePatterns = RegExp(r" '|' |'\.|\('|'\)|`");
final RegExp _bannedArgumentReferencePatterns = RegExp(r'[^"=]--[^ ]'); final RegExp _bannedArgumentReferencePatterns = RegExp(r'[^"=]--[^ ]');
final RegExp _questionablePatterns = RegExp(r'[a-z]\.[A-Z]'); final RegExp _questionablePatterns = RegExp(r'[a-z]\.[A-Z]');
final RegExp _bannedUri = RegExp(r'\b[Uu][Rr][Ii]\b'); final RegExp _bannedUri = RegExp(r'\b[Uu][Rr][Ii]\b');
const String _needHelp = 'Every option must have help explaining what it does, even if it\'s ' const String _needHelp = "Every option must have help explaining what it does, even if it's "
'for testing purposes, because this is the bare minimum of ' 'for testing purposes, because this is the bare minimum of '
'documentation we can add just for ourselves. If it is not intended ' 'documentation we can add just for ourselves. If it is not intended '
'for developers, then use "hide: !verboseHelp" to only show the ' 'for developers, then use "hide: !verboseHelp" to only show the '

View File

@ -243,22 +243,22 @@ void main() {
'\n' '\n'
'// @dart = 2.12\n' '// @dart = 2.12\n'
'\n' '\n'
'import \'package:path_provider_example/main.dart\' as entrypoint;\n' "import 'package:path_provider_example/main.dart' as entrypoint;\n"
'import \'dart:io\'; // flutter_ignore: dart_io_import.\n' "import 'dart:io'; // flutter_ignore: dart_io_import.\n"
'import \'package:path_provider_linux/path_provider_linux.dart\';\n' "import 'package:path_provider_linux/path_provider_linux.dart';\n"
'\n' '\n'
'@pragma(\'vm:entry-point\')\n' "@pragma('vm:entry-point')\n"
'class _PluginRegistrant {\n' 'class _PluginRegistrant {\n'
'\n' '\n'
' @pragma(\'vm:entry-point\')\n' " @pragma('vm:entry-point')\n"
' static void register() {\n' ' static void register() {\n'
' if (Platform.isLinux) {\n' ' if (Platform.isLinux) {\n'
' try {\n' ' try {\n'
' PathProviderLinux.registerWith();\n' ' PathProviderLinux.registerWith();\n'
' } catch (err) {\n' ' } catch (err) {\n'
' print(\n' ' print(\n'
' \'`path_provider_linux` threw an error: \$err. \'\n' " '`path_provider_linux` threw an error: \$err. '\n"
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n' " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n' ' );\n'
' rethrow;\n' ' rethrow;\n'
' }\n' ' }\n'
@ -380,22 +380,22 @@ void main() {
'\n' '\n'
'// @dart = 2.12\n' '// @dart = 2.12\n'
'\n' '\n'
'import \'file:///root/external.dart\' as entrypoint;\n' "import 'file:///root/external.dart' as entrypoint;\n"
'import \'dart:io\'; // flutter_ignore: dart_io_import.\n' "import 'dart:io'; // flutter_ignore: dart_io_import.\n"
'import \'package:path_provider_linux/path_provider_linux.dart\';\n' "import 'package:path_provider_linux/path_provider_linux.dart';\n"
'\n' '\n'
'@pragma(\'vm:entry-point\')\n' "@pragma('vm:entry-point')\n"
'class _PluginRegistrant {\n' 'class _PluginRegistrant {\n'
'\n' '\n'
' @pragma(\'vm:entry-point\')\n' " @pragma('vm:entry-point')\n"
' static void register() {\n' ' static void register() {\n'
' if (Platform.isLinux) {\n' ' if (Platform.isLinux) {\n'
' try {\n' ' try {\n'
' PathProviderLinux.registerWith();\n' ' PathProviderLinux.registerWith();\n'
' } catch (err) {\n' ' } catch (err) {\n'
' print(\n' ' print(\n'
' \'`path_provider_linux` threw an error: \$err. \'\n' " '`path_provider_linux` threw an error: \$err. '\n"
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n' " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n' ' );\n'
' rethrow;\n' ' rethrow;\n'
' }\n' ' }\n'

View File

@ -144,7 +144,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
}); });
testWithoutContext('DebugBundleLinuxAssets\'s name depends on target platforms', () async { testWithoutContext("DebugBundleLinuxAssets's name depends on target platforms", () async {
expect(const DebugBundleLinuxAssets(TargetPlatform.linux_x64).name, 'debug_bundle_linux-x64_assets'); expect(const DebugBundleLinuxAssets(TargetPlatform.linux_x64).name, 'debug_bundle_linux-x64_assets');
expect(const DebugBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'debug_bundle_linux-arm64_assets'); expect(const DebugBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'debug_bundle_linux-arm64_assets');
}); });
@ -183,7 +183,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
}); });
testWithoutContext('ProfileBundleLinuxAssets\'s name depends on target platforms', () async { testWithoutContext("ProfileBundleLinuxAssets's name depends on target platforms", () async {
expect(const ProfileBundleLinuxAssets(TargetPlatform.linux_x64).name, 'profile_bundle_linux-x64_assets'); expect(const ProfileBundleLinuxAssets(TargetPlatform.linux_x64).name, 'profile_bundle_linux-x64_assets');
expect(const ProfileBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'profile_bundle_linux-arm64_assets'); expect(const ProfileBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'profile_bundle_linux-arm64_assets');
}); });
@ -222,7 +222,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
}); });
testWithoutContext('ReleaseBundleLinuxAssets\'s name depends on target platforms', () async { testWithoutContext("ReleaseBundleLinuxAssets's name depends on target platforms", () async {
expect(const ReleaseBundleLinuxAssets(TargetPlatform.linux_x64).name, 'release_bundle_linux-x64_assets'); expect(const ReleaseBundleLinuxAssets(TargetPlatform.linux_x64).name, 'release_bundle_linux-x64_assets');
expect(const ReleaseBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'release_bundle_linux-arm64_assets'); expect(const ReleaseBundleLinuxAssets(TargetPlatform.linux_arm64).name, 'release_bundle_linux-arm64_assets');
}); });

View File

@ -246,7 +246,7 @@ void main() {
expect(pingCommandWasExecuted, true); expect(pingCommandWasExecuted, true);
}); });
testWithoutContext('CustomDevices.discoverDevices doesn\'t report device when ping command fails', () async { testWithoutContext("CustomDevices.discoverDevices doesn't report device when ping command fails", () async {
final MemoryFileSystem fs = MemoryFileSystem.test(); final MemoryFileSystem fs = MemoryFileSystem.test();
final Directory dir = fs.directory('custom_devices_config_dir'); final Directory dir = fs.directory('custom_devices_config_dir');
@ -272,7 +272,7 @@ void main() {
expect(await discovery.discoverDevices(), hasLength(0)); expect(await discovery.discoverDevices(), hasLength(0));
}); });
testWithoutContext('CustomDevices.discoverDevices doesn\'t report device when ping command output doesn\'t match ping success regex', () async { testWithoutContext("CustomDevices.discoverDevices doesn't report device when ping command output doesn't match ping success regex", () async {
final MemoryFileSystem fs = MemoryFileSystem.test(); final MemoryFileSystem fs = MemoryFileSystem.test();
final Directory dir = fs.directory('custom_devices_config_dir'); final Directory dir = fs.directory('custom_devices_config_dir');

View File

@ -467,7 +467,7 @@ void main() {
)); ));
expect( expect(
testLogger.errorText, testLogger.errorText,
'Plugin `url_launcher_linux_1` doesn\'t implement a plugin interface, ' "Plugin `url_launcher_linux_1` doesn't implement a plugin interface, "
'nor sets a default implementation in pubspec.yaml.\n\n' 'nor sets a default implementation in pubspec.yaml.\n\n'
'To set a default implementation, use:\n' 'To set a default implementation, use:\n'
'flutter:\n' 'flutter:\n'
@ -526,7 +526,7 @@ void main() {
)); ));
expect( expect(
testLogger.errorText, testLogger.errorText,
'Plugin `url_launcher_linux` doesn\'t implement a plugin interface, ' "Plugin `url_launcher_linux` doesn't implement a plugin interface, "
'nor sets a default implementation in pubspec.yaml.\n\n' 'nor sets a default implementation in pubspec.yaml.\n\n'
'To set a default implementation, use:\n' 'To set a default implementation, use:\n'
'flutter:\n' 'flutter:\n'
@ -540,7 +540,7 @@ void main() {
' plugin:\n' ' plugin:\n'
' implements: <plugin-interface>' ' implements: <plugin-interface>'
'\n\n' '\n\n'
'Plugin `url_launcher_windows` doesn\'t implement a plugin interface, ' "Plugin `url_launcher_windows` doesn't implement a plugin interface, "
'nor sets a default implementation in pubspec.yaml.\n\n' 'nor sets a default implementation in pubspec.yaml.\n\n'
'To set a default implementation, use:\n' 'To set a default implementation, use:\n'
'flutter:\n' 'flutter:\n'
@ -632,25 +632,25 @@ void main() {
'\n' '\n'
'// @dart = 2.8\n' '// @dart = 2.8\n'
'\n' '\n'
'import \'package:app/main.dart\' as entrypoint;\n' "import 'package:app/main.dart' as entrypoint;\n"
'import \'dart:io\'; // flutter_ignore: dart_io_import.\n' "import 'dart:io'; // flutter_ignore: dart_io_import.\n"
'import \'package:url_launcher_linux/url_launcher_linux.dart\';\n' "import 'package:url_launcher_linux/url_launcher_linux.dart';\n"
'import \'package:awesome_macos/awesome_macos.dart\';\n' "import 'package:awesome_macos/awesome_macos.dart';\n"
'import \'package:url_launcher_macos/url_launcher_macos.dart\';\n' "import 'package:url_launcher_macos/url_launcher_macos.dart';\n"
'import \'package:url_launcher_windows/url_launcher_windows.dart\';\n' "import 'package:url_launcher_windows/url_launcher_windows.dart';\n"
'\n' '\n'
'@pragma(\'vm:entry-point\')\n' "@pragma('vm:entry-point')\n"
'class _PluginRegistrant {\n' 'class _PluginRegistrant {\n'
'\n' '\n'
' @pragma(\'vm:entry-point\')\n' " @pragma('vm:entry-point')\n"
' static void register() {\n' ' static void register() {\n'
' if (Platform.isLinux) {\n' ' if (Platform.isLinux) {\n'
' try {\n' ' try {\n'
' LinuxPlugin.registerWith();\n' ' LinuxPlugin.registerWith();\n'
' } catch (err) {\n' ' } catch (err) {\n'
' print(\n' ' print(\n'
' \'`url_launcher_linux` threw an error: \$err. \'\n' " '`url_launcher_linux` threw an error: \$err. '\n"
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n' " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n' ' );\n'
' rethrow;\n' ' rethrow;\n'
' }\n' ' }\n'
@ -660,8 +660,8 @@ void main() {
' AwesomeMacOS.registerWith();\n' ' AwesomeMacOS.registerWith();\n'
' } catch (err) {\n' ' } catch (err) {\n'
' print(\n' ' print(\n'
' \'`awesome_macos` threw an error: \$err. \'\n' " '`awesome_macos` threw an error: \$err. '\n"
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n' " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n' ' );\n'
' rethrow;\n' ' rethrow;\n'
' }\n' ' }\n'
@ -670,8 +670,8 @@ void main() {
' MacOSPlugin.registerWith();\n' ' MacOSPlugin.registerWith();\n'
' } catch (err) {\n' ' } catch (err) {\n'
' print(\n' ' print(\n'
' \'`url_launcher_macos` threw an error: \$err. \'\n' " '`url_launcher_macos` threw an error: \$err. '\n"
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n' " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n' ' );\n'
' rethrow;\n' ' rethrow;\n'
' }\n' ' }\n'
@ -681,8 +681,8 @@ void main() {
' WindowsPlugin.registerWith();\n' ' WindowsPlugin.registerWith();\n'
' } catch (err) {\n' ' } catch (err) {\n'
' print(\n' ' print(\n'
' \'`url_launcher_windows` threw an error: \$err. \'\n' " '`url_launcher_windows` threw an error: \$err. '\n"
' \'The app may not function as expected until you remove this plugin from pubspec.yaml\'\n' " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n"
' );\n' ' );\n'
' rethrow;\n' ' rethrow;\n'
' }\n' ' }\n'

View File

@ -348,7 +348,7 @@ void main() {
classNameString: defaultClassNameString, classNameString: defaultClassNameString,
).loadResources(); ).loadResources();
} on L10nException catch (e) { } on L10nException catch (e) {
expect(e.message, contains('The following .arb file\'s locale could not be determined')); expect(e.message, contains("The following .arb file's locale could not be determined"));
return; return;
} }

View File

@ -427,7 +427,7 @@ void main() {
expect(licenseResult.dependencies, isEmpty); expect(licenseResult.dependencies, isEmpty);
expect(licenseResult.errorMessages.single, expect(licenseResult.errorMessages.single,
'package foo specified an additional license at /foo.txt, but this file could not be read:' 'package foo specified an additional license at /foo.txt, but this file could not be read:'
'\nFileSystemException: Invalid UTF-8 byte, path = \'/foo.txt\'', "\nFileSystemException: Invalid UTF-8 byte, path = '/foo.txt'",
); );
}); });
} }

View File

@ -372,7 +372,7 @@ void main() {
final FlutterProject projectUnderTest = setupProjectUnderTest(); final FlutterProject projectUnderTest = setupProjectUnderTest();
fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile')) fileSystem.file(fileSystem.path.join('project', 'ios', 'Podfile'))
..createSync() ..createSync()
..writeAsStringSync('plugin_pods = parse_KV_file(\'../.flutter-plugins\')'); ..writeAsStringSync("plugin_pods = parse_KV_file('../.flutter-plugins')");
await expectLater(cocoaPodsUnderTest.processPods( await expectLater(cocoaPodsUnderTest.processPods(
xcodeProject: projectUnderTest.ios, xcodeProject: projectUnderTest.ios,
@ -396,7 +396,7 @@ void main() {
projectUnderTest.macos.podfile projectUnderTest.macos.podfile
..createSync() ..createSync()
..writeAsStringSync('plugin_pods = parse_KV_file(\'../.flutter-plugins\')'); ..writeAsStringSync("plugin_pods = parse_KV_file('../.flutter-plugins')");
projectUnderTest.macos.podfileLock projectUnderTest.macos.podfileLock
..createSync() ..createSync()
..writeAsStringSync('Existing lock file.'); ..writeAsStringSync('Existing lock file.');

View File

@ -915,7 +915,7 @@ flutter:
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
}); });
testUsingContext('pluginClass: none doesn\'t trigger registrant entry on macOS', () async { testUsingContext("pluginClass: none doesn't trigger registrant entry on macOS", () async {
flutterProject.isModule = true; flutterProject.isModule = true;
// Create a plugin without a pluginClass. // Create a plugin without a pluginClass.
final Directory pluginDirectory = createFakePlugin(fs); final Directory pluginDirectory = createFakePlugin(fs);
@ -997,7 +997,7 @@ flutter:
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
}); });
testUsingContext('pluginClass: none doesn\'t trigger registrant entry on Linux', () async { testUsingContext("pluginClass: none doesn't trigger registrant entry on Linux", () async {
// Create a plugin without a pluginClass. // Create a plugin without a pluginClass.
final Directory pluginDirectory = createFakePlugin(fs); final Directory pluginDirectory = createFakePlugin(fs);
pluginDirectory.childFile('pubspec.yaml').writeAsStringSync(''' pluginDirectory.childFile('pubspec.yaml').writeAsStringSync('''
@ -1100,7 +1100,7 @@ flutter:
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
}); });
testUsingContext('pluginClass: none doesn\'t trigger registrant entry on Windows', () async { testUsingContext("pluginClass: none doesn't trigger registrant entry on Windows", () async {
// Create a plugin without a pluginClass. // Create a plugin without a pluginClass.
final Directory pluginDirectory = createFakePlugin(fs); final Directory pluginDirectory = createFakePlugin(fs);
pluginDirectory.childFile('pubspec.yaml').writeAsStringSync(''' pluginDirectory.childFile('pubspec.yaml').writeAsStringSync('''

View File

@ -39,7 +39,7 @@ void main() {
templateDir.childFile('$imageName.img.tmpl').createSync(recursive: true); templateDir.childFile('$imageName.img.tmpl').createSync(recursive: true);
final File sourceImage = imageSourceDir.childFile(imageName); final File sourceImage = imageSourceDir.childFile(imageName);
sourceImage.createSync(recursive: true); sourceImage.createSync(recursive: true);
sourceImage.writeAsStringSync('Ceci n\'est pas une pipe'); sourceImage.writeAsStringSync("Ceci n'est pas une pipe");
final Template template = Template( final Template template = Template(
templateDir, templateDir,

View File

@ -441,7 +441,7 @@ void main() {
command: args, command: args,
stderr: 'Inconsistency detected by ld.so: ../elf/dl-tls.c: 493: ' stderr: 'Inconsistency detected by ld.so: ../elf/dl-tls.c: 493: '
'_dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen ' '_dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen '
'<= GL(dl_tls_generation)\' failed!', "<= GL(dl_tls_generation)' failed!",
)); ));
} }

View File

@ -52,7 +52,7 @@ void main() {
await expressionCompiler.compileExpressionToJs( await expressionCompiler.compileExpressionToJs(
null, null, 1, 1, null, null, null, 'a'); null, null, 1, 1, null, null, null, 'a');
expectResult(result, true, 'InternalError: frontend server failed to compile \'a\''); expectResult(result, true, "InternalError: frontend server failed to compile 'a'");
}); });
} }

View File

@ -93,7 +93,7 @@ void main() {
'#l10n 38 (Hello for 123)\n' '#l10n 38 (Hello for 123)\n'
'#l10n 39 (Hello for price USD123.00)\n' '#l10n 39 (Hello for price USD123.00)\n'
'#l10n 40 (Hello for price BTC0.50 (with optional param))\n' '#l10n 40 (Hello for price BTC0.50 (with optional param))\n'
'#l10n 41 (Hello for price BTC\'0.50 (with special character))\n' "#l10n 41 (Hello for price BTC'0.50 (with special character))\n"
'#l10n 42 (Hello for price BTC"0.50 (with special character))\n' '#l10n 42 (Hello for price BTC"0.50 (with special character))\n'
'#l10n 43 (Hello for price BTC"\'0.50 (with special character))\n' '#l10n 43 (Hello for price BTC"\'0.50 (with special character))\n'
'#l10n 44 (Hello for Decimal Pattern 1,200,000)\n' '#l10n 44 (Hello for Decimal Pattern 1,200,000)\n'
@ -114,8 +114,8 @@ void main() {
'#l10n 59 ([Hello] -World- #123#)\n' '#l10n 59 ([Hello] -World- #123#)\n'
'#l10n 60 (\$!)\n' '#l10n 60 (\$!)\n'
'#l10n 61 (One \$)\n' '#l10n 61 (One \$)\n'
'#l10n 62 (Flutter\'s amazing!)\n' "#l10n 62 (Flutter's amazing!)\n"
'#l10n 63 (Flutter\'s amazing, times 2!)\n' "#l10n 63 (Flutter's amazing, times 2!)\n"
'#l10n 64 (Flutter is "amazing"!)\n' '#l10n 64 (Flutter is "amazing"!)\n'
'#l10n 65 (Flutter is "amazing", times 2!)\n' '#l10n 65 (Flutter is "amazing", times 2!)\n'
'#l10n 66 (--- es ---)\n' '#l10n 66 (--- es ---)\n'
@ -143,8 +143,8 @@ void main() {
'#l10n 88 (ES - [Hola] -Mundo- #123#)\n' '#l10n 88 (ES - [Hola] -Mundo- #123#)\n'
'#l10n 89 (ES - \$!)\n' '#l10n 89 (ES - \$!)\n'
'#l10n 90 (ES - One \$)\n' '#l10n 90 (ES - One \$)\n'
'#l10n 91 (ES - Flutter\'s amazing!)\n' "#l10n 91 (ES - Flutter's amazing!)\n"
'#l10n 92 (ES - Flutter\'s amazing, times 2!)\n' "#l10n 92 (ES - Flutter's amazing, times 2!)\n"
'#l10n 93 (ES - Flutter is "amazing"!)\n' '#l10n 93 (ES - Flutter is "amazing"!)\n'
'#l10n 94 (ES - Flutter is "amazing", times 2!)\n' '#l10n 94 (ES - Flutter is "amazing", times 2!)\n'
'#l10n 95 (--- es_419 ---)\n' '#l10n 95 (--- es_419 ---)\n'

View File

@ -103,7 +103,7 @@ Future<void> pollForServiceExtensionValue<T>({
} }
} }
fail( fail(
'Did not find expected value for service extension \'$extension\'. All call' "Did not find expected value for service extension '$extension'. All call"
' attempts responded with \'$continuePollingValue\'.', " attempts responded with '$continuePollingValue'.",
); );
} }

View File

@ -55,6 +55,6 @@ void main() {
}); });
expect(result.exitCode, 1); expect(result.exitCode, 1);
expect(result.stderr, contains('ERROR: Requested build with Flutter local engine at \'release_foo_bar\'')); expect(result.stderr, contains("ERROR: Requested build with Flutter local engine at 'release_foo_bar'"));
}); });
} }

View File

@ -191,7 +191,7 @@ Future<void> checkStaticScope(FlutterTestDriver flutter) async {
Future<void> evaluateErrorExpressions(FlutterTestDriver flutter) async { Future<void> evaluateErrorExpressions(FlutterTestDriver flutter) async {
final ObjRef res = await flutter.evaluateInFrame('typo'); final ObjRef res = await flutter.evaluateInFrame('typo');
expectError(res, 'CompilationError: Getter not found: \'typo\'.\ntypo\n^^^^'); expectError(res, "CompilationError: Getter not found: 'typo'.\ntypo\n^^^^");
} }
Future<void> evaluateTrivialExpressions(FlutterTestDriver flutter) async { Future<void> evaluateTrivialExpressions(FlutterTestDriver flutter) async {

View File

@ -16,7 +16,7 @@ void main() {
} }
final RegExp globalImport = RegExp(r"import.*(?:globals|globals_null_migrated)\.dart' as globals;"); final RegExp globalImport = RegExp(r"import.*(?:globals|globals_null_migrated)\.dart' as globals;");
final RegExp globalNullUnsafeImport = RegExp('import.*globals.dart\' as globals;'); final RegExp globalNullUnsafeImport = RegExp("import.*globals.dart' as globals;");
void countGlobalImports(Directory directory) { void countGlobalImports(Directory directory) {
int count = 0; int count = 0;