enable lint prefer_interpolation_to_compose_strings (#83407)
diff --git a/packages/flutter/lib/src/cupertino/localizations.dart b/packages/flutter/lib/src/cupertino/localizations.dart index 4717f8f..9f8b81c 100644 --- a/packages/flutter/lib/src/cupertino/localizations.dart +++ b/packages/flutter/lib/src/cupertino/localizations.dart
@@ -344,7 +344,7 @@ String datePickerHour(int hour) => hour.toString(); @override - String datePickerHourSemanticsLabel(int hour) => hour.toString() + " o'clock"; + String datePickerHourSemanticsLabel(int hour) => "$hour o'clock"; @override String datePickerMinute(int minute) => minute.toString().padLeft(2, '0'); @@ -353,7 +353,7 @@ String datePickerMinuteSemanticsLabel(int minute) { if (minute == 1) return '1 minute'; - return minute.toString() + ' minutes'; + return '$minute minutes'; } @override
diff --git a/packages/flutter/lib/src/foundation/stack_frame.dart b/packages/flutter/lib/src/foundation/stack_frame.dart index a52e6f5..f9f630e 100644 --- a/packages/flutter/lib/src/foundation/stack_frame.dart +++ b/packages/flutter/lib/src/foundation/stack_frame.dart
@@ -121,7 +121,7 @@ packageScheme = 'package'; final Uri packageUri = Uri.parse(match.group(1)!); package = packageUri.pathSegments[0]; - packagePath = packageUri.path.replaceFirst(packageUri.pathSegments[0] + '/', ''); + packagePath = packageUri.path.replaceFirst('${packageUri.pathSegments[0]}/', ''); } return StackFrame( @@ -232,7 +232,7 @@ String packagePath = packageUri.path; if (packageUri.scheme == 'dart' || packageUri.scheme == 'package') { package = packageUri.pathSegments[0]; - packagePath = packageUri.path.replaceFirst(packageUri.pathSegments[0] + '/', ''); + packagePath = packageUri.path.replaceFirst('${packageUri.pathSegments[0]}/', ''); } return StackFrame(
diff --git a/packages/flutter/lib/src/gestures/recognizer.dart b/packages/flutter/lib/src/gestures/recognizer.dart index f38ca93..b890b89 100644 --- a/packages/flutter/lib/src/gestures/recognizer.dart +++ b/packages/flutter/lib/src/gestures/recognizer.dart
@@ -185,7 +185,7 @@ final String? report = debugReport != null ? debugReport() : null; // The 19 in the line below is the width of the prefix used by // _debugLogDiagnostic in arena.dart. - final String prefix = debugPrintGestureArenaDiagnostics ? ' ' * 19 + '❙ ' : ''; + final String prefix = debugPrintGestureArenaDiagnostics ? '${' ' * 19}❙ ' : ''; debugPrint('$prefix$this calling $name callback.${ report?.isNotEmpty == true ? " $report" : "" }'); } return true;
diff --git a/packages/flutter/lib/src/material/tab_controller.dart b/packages/flutter/lib/src/material/tab_controller.dart index 1f210b0..05c3a01 100644 --- a/packages/flutter/lib/src/material/tab_controller.dart +++ b/packages/flutter/lib/src/material/tab_controller.dart
@@ -122,7 +122,7 @@ /// children: tabs.map((Tab tab){ /// return Center( /// child: Text( -/// tab.text! + ' Tab', +/// '${tab.text!} Tab', /// style: Theme.of(context).textTheme.headline5, /// ), /// );
diff --git a/packages/flutter/lib/src/painting/alignment.dart b/packages/flutter/lib/src/painting/alignment.dart index 6e7bf58..c1562fa 100644 --- a/packages/flutter/lib/src/painting/alignment.dart +++ b/packages/flutter/lib/src/painting/alignment.dart
@@ -123,7 +123,7 @@ return Alignment._stringify(_x, _y); if (_x == 0.0) return AlignmentDirectional._stringify(_start, _y); - return Alignment._stringify(_x, _y) + ' + ' + AlignmentDirectional._stringify(_start, 0.0); + return '${Alignment._stringify(_x, _y)} + ${AlignmentDirectional._stringify(_start, 0.0)}'; } @override
diff --git a/packages/flutter/lib/src/services/binding.dart b/packages/flutter/lib/src/services/binding.dart index d0e6bca..1247c3e 100644 --- a/packages/flutter/lib/src/services/binding.dart +++ b/packages/flutter/lib/src/services/binding.dart
@@ -153,7 +153,7 @@ // This is run in another isolate created by _addLicenses above. static List<LicenseEntry> _parseLicenses(String rawLicenses) { - final String _licenseSeparator = '\n' + ('-' * 80) + '\n'; + final String _licenseSeparator = '\n${'-' * 80}\n'; final List<LicenseEntry> result = <LicenseEntry>[]; final List<String> licenses = rawLicenses.split(_licenseSeparator); for (final String license in licenses) {
diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index a522082..bc3d294 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart
@@ -4479,7 +4479,7 @@ static Widget _defaultErrorWidgetBuilder(FlutterErrorDetails details) { String message = ''; assert(() { - message = _stringify(details.exception) + '\nSee also: https://flutter.dev/docs/testing/errors'; + message = '${_stringify(details.exception)}\nSee also: https://flutter.dev/docs/testing/errors'; return true; }()); final Object exception = details.exception;
diff --git a/packages/flutter/test/foundation/print_test.dart b/packages/flutter/test/foundation/print_test.dart index 724ebc8..08691b7 100644 --- a/packages/flutter/test/foundation/print_test.dart +++ b/packages/flutter/test/foundation/print_test.dart
@@ -43,7 +43,7 @@ test('debugPrint throttling', () { FakeAsync().run((FakeAsync async) { List<String> log = captureOutput(() { - debugPrintThrottled('A' * (22 * 1024) + '\nB'); + debugPrintThrottled('${'A' * (22 * 1024)}\nB'); }); expect(log.length, 1); async.elapse(const Duration(seconds: 2));
diff --git a/packages/flutter/test/material/dropdown_form_field_test.dart b/packages/flutter/test/material/dropdown_form_field_test.dart index 43c84d3..f204887 100644 --- a/packages/flutter/test/material/dropdown_form_field_test.dart +++ b/packages/flutter/test/material/dropdown_form_field_test.dart
@@ -70,7 +70,7 @@ return DropdownMenuItem<String>( key: ValueKey<String>(item), value: item, - child: Text(item, key: ValueKey<String>(item + 'Text')), + child: Text(item, key: ValueKey<String>('${item}Text')), ); }).toList(), alignment: buttonAlignment, @@ -292,7 +292,7 @@ return DropdownMenuItem<String>( key: ValueKey<String>(item), value: item, - child: Text(item, key: ValueKey<String>(item + 'Text')), + child: Text(item, key: ValueKey<String>('${item}Text')), ); }).toList(), ),
diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index 2f0668a..b4f6257 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart
@@ -61,7 +61,7 @@ return DropdownMenuItem<String>( key: ValueKey<String>(item), value: item, - child: Text(item, key: ValueKey<String>(item + 'Text')), + child: Text(item, key: ValueKey<String>('${item}Text')), ); }).toList(); @@ -230,7 +230,7 @@ // The RenderParagraphs should be aligned, i.e. they should have the same // size and location. void checkSelectedItemTextGeometry(WidgetTester tester, String value) { - final List<RenderBox> boxes = tester.renderObjectList<RenderBox>(find.byKey(ValueKey<String>(value + 'Text'))).toList(); + final List<RenderBox> boxes = tester.renderObjectList<RenderBox>(find.byKey(ValueKey<String>('${value}Text'))).toList(); expect(boxes.length, equals(2)); final RenderBox box0 = boxes[0]; final RenderBox box1 = boxes[1]; @@ -2470,7 +2470,7 @@ return DropdownMenuItem<String>( key: ValueKey<String>(item), value: item, - child: Text(item, key: ValueKey<String>(item + 'Text')), + child: Text(item, key: ValueKey<String>('${item}Text')), ); }).toList(), ); @@ -2566,7 +2566,7 @@ return DropdownMenuItem<String>( key: ValueKey<String>(item), value: item, - child: Text(item, key: ValueKey<String>(item + 'Text')), + child: Text(item, key: ValueKey<String>('${item}Text')), ); }).toList(), ); @@ -2818,7 +2818,7 @@ return DropdownMenuItem<String>( key: ValueKey<String>(item), value: item, - child: Text(item, key: ValueKey<String>(item + 'Text')), + child: Text(item, key: ValueKey<String>('${item}Text')), ); }).toList(), );
diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index 3400170..479fcbf 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart
@@ -158,8 +158,8 @@ 'Second line goes until\n' 'Third line of stuff'; const String kMoreThanFourLines = - kThreeLines + - "\nFourth line won't display and ends at"; + '$kThreeLines\n' + "Fourth line won't display and ends at"; // Gap between caret and edge of input, defined in editable.dart. const int kCaretGap = 1; @@ -992,7 +992,7 @@ // Enter a string with the same number of characters as testValueTwoLines, // but where the overflowing part is all spaces. Assert that it only renders // on one line. - const String testValueSpaces = testValueOneLine + ' '; + const String testValueSpaces = '$testValueOneLine '; expect(testValueSpaces.length, testValueTwoLines.length); await tester.enterText(find.byType(TextField), testValueSpaces); await skipPastScrollingAnimation(tester); @@ -1002,7 +1002,7 @@ expect(inputBox.size.height, oneLineInputSize.height); // Swapping the final space for a letter causes it to wrap to 2 lines. - const String testValueSpacesOverflow = testValueOneLine + ' a'; + const String testValueSpacesOverflow = '$testValueOneLine a'; expect(testValueSpacesOverflow.length, testValueTwoLines.length); await tester.enterText(find.byType(TextField), testValueSpacesOverflow); await skipPastScrollingAnimation(tester); @@ -3873,8 +3873,8 @@ )); const String surrogatePair = '😆'; - await tester.enterText(find.byType(TextField), surrogatePair + '0123456789101112'); - expect(textController.text, surrogatePair + '012345678'); + await tester.enterText(find.byType(TextField), '${surrogatePair}0123456789101112'); + expect(textController.text, '${surrogatePair}012345678'); }); testWidgets('maxLength limits input with grapheme clusters.', (WidgetTester tester) async { @@ -3888,8 +3888,8 @@ )); const String graphemeCluster = '👨👩👦'; - await tester.enterText(find.byType(TextField), graphemeCluster + '0123456789101112'); - expect(textController.text, graphemeCluster + '012345678'); + await tester.enterText(find.byType(TextField), '${graphemeCluster}0123456789101112'); + expect(textController.text, '${graphemeCluster}012345678'); }); testWidgets('maxLength limits input in the center of a maxed-out field.', (WidgetTester tester) async { @@ -3909,7 +3909,7 @@ expect(textController.text, testValue); // Entering more characters at the end does nothing. - await tester.enterText(find.byType(TextField), testValue + '9999999'); + await tester.enterText(find.byType(TextField), '${testValue}9999999'); expect(textController.text, testValue); // Entering text in the middle of the field also does nothing. @@ -3943,7 +3943,7 @@ // Entering more characters at the end does nothing. await tester.showKeyboard(find.byType(TextField)); tester.testTextInput.updateEditingValue(const TextEditingValue( - text: testValue + '9999999', + text: '${testValue}9999999', selection: TextSelection.collapsed(offset: 10 + 7), composing: TextRange.empty, )); @@ -4175,8 +4175,8 @@ )); const String surrogatePair = '😆'; - await tester.enterText(find.byType(TextField), surrogatePair + '0123456789101112'); - expect(textController.text, surrogatePair + '012345678'); + await tester.enterText(find.byType(TextField), '${surrogatePair}0123456789101112'); + expect(textController.text, '${surrogatePair}012345678'); }); testWidgets('maxLength limits input with grapheme clusters.', (WidgetTester tester) async { @@ -4190,8 +4190,8 @@ )); const String graphemeCluster = '👨👩👦'; - await tester.enterText(find.byType(TextField), graphemeCluster + '0123456789101112'); - expect(textController.text, graphemeCluster + '012345678'); + await tester.enterText(find.byType(TextField), '${graphemeCluster}0123456789101112'); + expect(textController.text, '${graphemeCluster}012345678'); }); testWidgets('setting maxLength shows counter', (WidgetTester tester) async {
diff --git a/packages/flutter/test/services/platform_channel_test.dart b/packages/flutter/test/services/platform_channel_test.dart index 6adc07b..c70e6d8 100644 --- a/packages/flutter/test/services/platform_channel_test.dart +++ b/packages/flutter/test/services/platform_channel_test.dart
@@ -14,14 +14,14 @@ test('can send string message and get reply', () async { TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.setMockMessageHandler( 'ch', - (ByteData? message) async => string.encodeMessage(string.decodeMessage(message)! + ' world'), + (ByteData? message) async => string.encodeMessage('${string.decodeMessage(message)!} world'), ); final String? reply = await channel.send('hello'); expect(reply, equals('hello world')); }); test('can receive string message and send reply', () async { - channel.setMessageHandler((String? message) async => message! + ' world'); + channel.setMessageHandler((String? message) async => '${message!} world'); String? reply; await TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.handlePlatformMessage( 'ch', @@ -279,8 +279,8 @@ final Map<dynamic, dynamic> methodCall = jsonMessage.decodeMessage(message) as Map<dynamic, dynamic>; if (methodCall['method'] == 'listen') { final String argument = methodCall['args'] as String; - emitEvent(jsonMethod.encodeSuccessEnvelope(argument + '1')); - emitEvent(jsonMethod.encodeSuccessEnvelope(argument + '2')); + emitEvent(jsonMethod.encodeSuccessEnvelope('${argument}1')); + emitEvent(jsonMethod.encodeSuccessEnvelope('${argument}2')); emitEvent(null); return jsonMethod.encodeSuccessEnvelope(null); } else if (methodCall['method'] == 'cancel') {
diff --git a/packages/flutter/test/widgets/form_test.dart b/packages/flutter/test/widgets/form_test.dart index 846c62c..eb47fa9 100644 --- a/packages/flutter/test/widgets/form_test.dart +++ b/packages/flutter/test/widgets/form_test.dart
@@ -86,7 +86,7 @@ testWidgets('Validator sets the error text only when validate is called', (WidgetTester tester) async { final GlobalKey<FormState> formKey = GlobalKey<FormState>(); - String? errorText(String? value) => (value ?? '') + '/error'; + String? errorText(String? value) => '${value ?? ''}/error'; Widget builder(AutovalidateMode autovalidateMode) { return MaterialApp( @@ -274,7 +274,7 @@ await tester.pump(); // Check for a new Text widget with our error text. - expect(find.text(testValue + '/error'), findsOneWidget); + expect(find.text('$testValue/error'), findsOneWidget); return; }
diff --git a/packages/flutter/test/widgets/selectable_text_test.dart b/packages/flutter/test/widgets/selectable_text_test.dart index d05f943..82e9f13 100644 --- a/packages/flutter/test/widgets/selectable_text_test.dart +++ b/packages/flutter/test/widgets/selectable_text_test.dart
@@ -131,8 +131,8 @@ 'Second line goes until\n' 'Third line of stuff'; const String kMoreThanFourLines = - kThreeLines + - "\nFourth line won't display and ends at"; + '$kThreeLines\n' + "Fourth line won't display and ends at"; // Returns the first RenderEditable. RenderEditable findRenderEditable(WidgetTester tester) {
diff --git a/packages/flutter/test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart b/packages/flutter/test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart index 6b155ae..0336aaf 100644 --- a/packages/flutter/test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart +++ b/packages/flutter/test/widgets/semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test.dart
@@ -58,7 +58,7 @@ .split('\n') .map<String>((String line) => line.trim()) .join('\n') - .trim() + ','; + .trim(); File? findThisTestFile(Directory directory) { for (final FileSystemEntity entity in directory.listSync()) { @@ -86,7 +86,7 @@ .join('\n') .trim(); semantics.dispose(); - expect(code, expectedCode); + expect('$code,', expectedCode); }); testWidgets('generated code is correct', (WidgetTester tester) async {
diff --git a/packages/flutter/test/widgets/widget_inspector_test.dart b/packages/flutter/test/widgets/widget_inspector_test.dart index 2c53152..c1ac599 100644 --- a/packages/flutter/test/widgets/widget_inspector_test.dart +++ b/packages/flutter/test/widgets/widget_inspector_test.dart
@@ -1009,8 +1009,7 @@ .pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - pubRootTest = '/' + - segments.take(segments.length - 2).join('/'); + pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; service.setPubRootDirectories(<String>[pubRootTest]); } final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); @@ -1072,8 +1071,7 @@ .pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - pubRootTest = '/' + - segments.take(segments.length - 2).join('/'); + pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; service.setPubRootDirectories(<String>[pubRootTest]); } final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); @@ -1231,7 +1229,7 @@ final List<String> segments = Uri.parse(fileA).pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - final String pubRootTest = '/' + segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; service.setPubRootDirectories(<String>[pubRootTest]); service.setSelection(elementA, 'my-group'); @@ -1270,7 +1268,7 @@ expect(pathSegmentsFramework.join('/'), endsWith('/flutter/lib/src/widgets/text.dart')); // Strip off /src/widgets/text.dart. - final String pubRootFramework = '/' + pathSegmentsFramework.take(pathSegmentsFramework.length - 3).join('/'); + final String pubRootFramework = '/${pathSegmentsFramework.take(pathSegmentsFramework.length - 3).join('/')}'; service.setPubRootDirectories(<String>[pubRootFramework]); expect(json.decode(service.getSelectedWidget(null, 'my-group')), contains('createdByLocalProject')); service.setSelection(elementA, 'my-group'); @@ -1621,7 +1619,7 @@ final List<String> segments = Uri.parse(testFile).pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - final String pubRootTest = '/' + segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; await service.testExtension('setPubRootDirectories', <String, String>{'arg0': pubRootTest}); rootJson = (await service.testExtension('getRootWidgetSummaryTree', <String, String>{'objectGroup': group}))! as Map<String, Object?>; @@ -1704,7 +1702,7 @@ final List<String> segments = Uri.parse(testFile).pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - final String pubRootTest = '/' + segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; await service.testExtension('setPubRootDirectories', <String, String>{'arg0': pubRootTest}); summarySelection = (await service.testExtension('getSelectedSummaryWidget', <String, String>{'objectGroup': group}))! as Map<String, Object?>; @@ -1805,7 +1803,7 @@ final List<String> segments = Uri.parse(fileA).pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - final String pubRootTest = '/' + segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; await service.testExtension('setPubRootDirectories', <String, String>{'arg0': pubRootTest}); service.setSelection(elementA, 'my-group'); @@ -1845,7 +1843,7 @@ expect(pathSegmentsFramework.join('/'), endsWith('/flutter/lib/src/widgets/text.dart')); // Strip off /src/widgets/text.dart. - final String pubRootFramework = '/' + pathSegmentsFramework.take(pathSegmentsFramework.length - 3).join('/'); + final String pubRootFramework = '/${pathSegmentsFramework.take(pathSegmentsFramework.length - 3).join('/')}'; await service.testExtension('setPubRootDirectories', <String, String>{'arg0': pubRootFramework}); expect(await service.testExtension('getSelectedWidget', <String, String>{'objectGroup': 'my-group'}), contains('createdByLocalProject')); service.setSelection(elementA, 'my-group'); @@ -1886,7 +1884,7 @@ final List<String> segments = Uri.parse(fileA).pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - final String pubRootTest = '/' + segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; await service.testExtension('setPubRootDirectories', <String, String>{'arg0': pubRootTest, 'isolateId': '34'}); service.setSelection(elementA, 'my-group'); @@ -1929,8 +1927,7 @@ final List<String> segments = Uri.parse(file).pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - final String pubRootTest = - '/' + segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; await service.testExtension('setPubRootDirectories', <String, String>{'arg0': pubRootTest}); final List<Map<Object, Object?>> rebuildEvents = @@ -2125,8 +2122,7 @@ final List<String> segments = Uri.parse(file).pathSegments; // Strip a couple subdirectories away to generate a plausible pub root // directory. - final String pubRootTest = - '/' + segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; await service.testExtension('setPubRootDirectories', <String, String>{'arg0': pubRootTest}); final List<Map<Object, Object?>> repaintEvents = @@ -2861,7 +2857,7 @@ expect(file, endsWith('widget_inspector_test.dart')); final List<String> segments = Uri.parse(file).pathSegments; // Strip a couple subdirectories away to generate a plausible pub rootdirectory. - final String pubRootTest = '/' + segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; service.setPubRootDirectories(<String>[pubRootTest]); final String summary = service.getRootWidgetSummaryTree('foo1'); @@ -3034,8 +3030,7 @@ final List<String> segments = Uri .parse(file) .pathSegments; - final String pubRootTest = '/' + - segments.take(segments.length - 2).join('/'); + final String pubRootTest = '/${segments.take(segments.length - 2).join('/')}'; // Strip a couple subdirectories away to generate a plausible pub root // directory.
diff --git a/packages/flutter_goldens/lib/flutter_goldens.dart b/packages/flutter_goldens/lib/flutter_goldens.dart index 407edec..9737551 100644 --- a/packages/flutter_goldens/lib/flutter_goldens.dart +++ b/packages/flutter_goldens/lib/flutter_goldens.dart
@@ -168,7 +168,7 @@ /// test. Uri _addPrefix(Uri golden) { final String prefix = basedir.pathSegments[basedir.pathSegments.length - 2]; - return Uri.parse(prefix + '.' + golden.toString()); + return Uri.parse('$prefix.$golden'); } }
diff --git a/packages/flutter_goldens_client/lib/skia_client.dart b/packages/flutter_goldens_client/lib/skia_client.dart index 6af65e9..235b64a 100644 --- a/packages/flutter_goldens_client/lib/skia_client.dart +++ b/packages/flutter_goldens_client/lib/skia_client.dart
@@ -368,7 +368,7 @@ }; if (platform.environment[_kTestBrowserKey] != null) { keys['Browser'] = platform.environment[_kTestBrowserKey]; - keys['Platform'] = keys['Platform'] + '-browser'; + keys['Platform'] = '${keys['Platform']}-browser'; } return json.encode(keys); }
diff --git a/packages/flutter_localizations/lib/src/utils/date_localizations.dart b/packages/flutter_localizations/lib/src/utils/date_localizations.dart index ee2de56..aa5ce52 100644 --- a/packages/flutter_localizations/lib/src/utils/date_localizations.dart +++ b/packages/flutter_localizations/lib/src/utils/date_localizations.dart
@@ -35,7 +35,7 @@ } else if (codes.length == 3) { countryCode = codes[1].length < codes[2].length ? codes[1] : codes[2]; } - locale = codes[0] + (countryCode != null ? '_' + countryCode : ''); + locale = codes[0] + (countryCode != null ? '_$countryCode' : ''); if (initializedLocales.contains(locale)) return; initializedLocales.add(locale);
diff --git a/packages/flutter_test/lib/src/_goldens_io.dart b/packages/flutter_test/lib/src/_goldens_io.dart index 0908a43..68ad87e 100644 --- a/packages/flutter_test/lib/src/_goldens_io.dart +++ b/packages/flutter_test/lib/src/_goldens_io.dart
@@ -146,7 +146,7 @@ final Map<String, Image> diffs = result.diffs!.cast<String, Image>(); for (final MapEntry<String, Image> entry in diffs.entries) { final File output = getFailureFile( - key.isEmpty ? entry.key : entry.key + '_' + key, + key.isEmpty ? entry.key : '${entry.key}_$key', golden, basedir, ); @@ -161,10 +161,7 @@ /// Returns the appropriate file for a given diff from a [ComparisonResult]. File getFailureFile(String failure, Uri golden, Uri basedir) { final String fileName = golden.pathSegments.last; - final String testName = fileName.split(path.extension(fileName))[0] - + '_' - + failure - + '.png'; + final String testName = '${fileName.split(path.extension(fileName))[0]}_$failure.png'; return File(path.join( path.fromUri(basedir), path.fromUri(Uri.parse('failures/$testName')),
diff --git a/packages/flutter_test/lib/src/goldens.dart b/packages/flutter_test/lib/src/goldens.dart index 0143a71..c2f6663 100644 --- a/packages/flutter_test/lib/src/goldens.dart +++ b/packages/flutter_test/lib/src/goldens.dart
@@ -85,11 +85,7 @@ return key; final String keyString = key.toString(); final String extension = path.extension(keyString); - return Uri.parse( - keyString - .split(extension) - .join() + '.' + version.toString() + extension - ); + return Uri.parse('${keyString.split(extension).join()}.$version$extension'); } /// Returns a [ComparisonResult] to describe the pixel differential of the @@ -196,11 +192,7 @@ return key; final String keyString = key.toString(); final String extension = path.extension(keyString); - return Uri.parse( - keyString - .split(extension) - .join() + '.' + version.toString() + extension - ); + return Uri.parse('${keyString.split(extension).join()}.$version$extension'); } }
diff --git a/packages/flutter_test/lib/src/matchers.dart b/packages/flutter_test/lib/src/matchers.dart index 0234dde..43b9eee 100644 --- a/packages/flutter_test/lib/src/matchers.dart +++ b/packages/flutter_test/lib/src/matchers.dart
@@ -1926,7 +1926,7 @@ @override Description describe(Description description) { - return description.add('Does not ' + guideline.description); + return description.add('Does not ${guideline.description}'); } @override
diff --git a/packages/flutter_test/test/controller_test.dart b/packages/flutter_test/test/controller_test.dart index 96b4569..25f33e6 100644 --- a/packages/flutter_test/test/controller_test.dart +++ b/packages/flutter_test/test/controller_test.dart
@@ -383,8 +383,8 @@ testResult.expectedOffsets[valueIndex], offsetMoreOrLessEquals(dragOffsets[valueIndex]), reason: - 'There is a difference in the expected and actual value of the ' + - (valueIndex == 2 ? 'first' : valueIndex == 3 ? 'second' : 'third') + + 'There is a difference in the expected and actual value of the ' + '${valueIndex == 2 ? 'first' : valueIndex == 3 ? 'second' : 'third'}' ' split offset for the drag with:\n' 'Touch slop: ${testResult.slop}\n' 'Delta: ${testResult.dragDistance}\n'
diff --git a/packages/flutter_tools/lib/src/android/gradle.dart b/packages/flutter_tools/lib/src/android/gradle.dart index 2704e57..43b7a04 100644 --- a/packages/flutter_tools/lib/src/android/gradle.dart +++ b/packages/flutter_tools/lib/src/android/gradle.dart
@@ -991,7 +991,7 @@ // the directory name is `foo_barRelease`. fileCandidates.add( getBundleDirectory(project) - .childDirectory('${buildInfo.lowerCasedFlavor}${camelCase('_' + buildInfo.modeName)}') + .childDirectory('${buildInfo.lowerCasedFlavor}${camelCase('_${buildInfo.modeName}')}') .childFile('app.aab')); // The Android Gradle plugin 3.5.0 adds the flavor name to file name. @@ -999,7 +999,7 @@ // the file name name is `app-foo_bar-release.aab`. fileCandidates.add( getBundleDirectory(project) - .childDirectory('${buildInfo.lowerCasedFlavor}${camelCase('_' + buildInfo.modeName)}') + .childDirectory('${buildInfo.lowerCasedFlavor}${camelCase('_${buildInfo.modeName}')}') .childFile('app-${buildInfo.lowerCasedFlavor}-${buildInfo.modeName}.aab')); } for (final File bundleFile in fileCandidates) {
diff --git a/packages/flutter_tools/lib/src/android/gradle_errors.dart b/packages/flutter_tools/lib/src/android/gradle_errors.dart index ab4a5c6..2075c39 100644 --- a/packages/flutter_tools/lib/src/android/gradle_errors.dart +++ b/packages/flutter_tools/lib/src/android/gradle_errors.dart
@@ -379,16 +379,18 @@ final Match minSdkVersionMatch = _minSdkVersionPattern.firstMatch(line); assert(minSdkVersionMatch.groupCount == 3); + final String bold = globals.logger.terminal.bolden( + 'Fix this issue by adding the following to the file ${gradleFile.path}:\n' + 'android {\n' + ' defaultConfig {\n' + ' minSdkVersion ${minSdkVersionMatch.group(2)}\n' + ' }\n' + '}\n' + ); globals.printStatus( - '\nThe plugin ${minSdkVersionMatch.group(3)} requires a higher Android SDK version.\n'+ - globals.logger.terminal.bolden( - 'Fix this issue by adding the following to the file ${gradleFile.path}:\n' - 'android {\n' - ' defaultConfig {\n' - ' minSdkVersion ${minSdkVersionMatch.group(2)}\n' - ' }\n' - '}\n\n' - )+ + '\n' + 'The plugin ${minSdkVersionMatch.group(3)} requires a higher Android SDK version.\n' + '$bold\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.' ); @@ -414,17 +416,18 @@ .childDirectory('android') .childDirectory('app') .childFile('build.gradle'); - + final String bold = globals.logger.terminal.bolden( + 'Fix this issue by adding the following to the file ${gradleFile.path}:\n' + 'android {\n' + ' lintOptions {\n' + ' checkReleaseBuilds false\n' + ' }\n' + '}' + ); globals.printStatus( - '\nThis issue appears to be https://github.com/flutter/flutter/issues/58247.\n'+ - globals.logger.terminal.bolden( - 'Fix this issue by adding the following to the file ${gradleFile.path}:\n' - 'android {\n' - ' lintOptions {\n' - ' checkReleaseBuilds false\n' - ' }\n' - '}' - ) + '\n' + 'This issue appears to be https://github.com/flutter/flutter/issues/58247.\n' + '$bold' ); return GradleBuildStatus.exit; }, @@ -446,13 +449,14 @@ final File gradleFile = project.directory .childDirectory('android') .childFile('build.gradle'); - + final String bold = globals.logger.terminal.bolden( + 'To regenerate the lockfiles run: `./gradlew :generateLockfiles` in ${gradleFile.path}\n' + 'To remove dependency locking, remove the `dependencyLocking` from ${gradleFile.path}\n' + ); globals.printStatus( - '\nYou need to update the lockfile, or disable Gradle dependency locking.\n'+ - globals.logger.terminal.bolden( - 'To regenerate the lockfiles run: `./gradlew :generateLockfiles` in ${gradleFile.path}\n' - 'To remove dependency locking, remove the `dependencyLocking` from ${gradleFile.path}\n' - ) + '\n' + 'You need to update the lockfile, or disable Gradle dependency locking.\n' + '$bold' ); return GradleBuildStatus.exit; },
diff --git a/packages/flutter_tools/lib/src/base/analyze_size.dart b/packages/flutter_tools/lib/src/base/analyze_size.dart index 335f5f3..c1a8a83 100644 --- a/packages/flutter_tools/lib/src/base/analyze_size.dart +++ b/packages/flutter_tools/lib/src/base/analyze_size.dart
@@ -331,7 +331,7 @@ } for (; i < localSegments.length; i += 1) { _logger.printStatus( - localSegments[i] + '/', + '${localSegments[i]}/', indent: (level + i) * 2, emphasis: true, );
diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index b67eb79..938cf5d 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart
@@ -67,7 +67,7 @@ // iOS has a separate gen_snapshot for armv7 and arm64 in the same, // directory. So we need to select the right one. if (snapshotType.platform == TargetPlatform.ios) { - snapshotterPath += '_' + getNameForDarwinArch(darwinArch!); + snapshotterPath += '_${getNameForDarwinArch(darwinArch!)}'; } return _processUtils.stream(
diff --git a/packages/flutter_tools/lib/src/base/fingerprint.dart b/packages/flutter_tools/lib/src/base/fingerprint.dart index 08119e9..ad8a8da 100644 --- a/packages/flutter_tools/lib/src/base/fingerprint.dart +++ b/packages/flutter_tools/lib/src/base/fingerprint.dart
@@ -86,7 +86,7 @@ final Iterable<File> files = inputPaths.map<File>(fileSystem.file); final Iterable<File> missingInputs = files.where((File file) => !file.existsSync()); if (missingInputs.isNotEmpty) { - throw Exception('Missing input files:\n' + missingInputs.join('\n')); + throw Exception('Missing input files:\n${missingInputs.join('\n')}'); } return Fingerprint._( checksums: <String, String>{
diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart index 85a519b..c0151c6 100644 --- a/packages/flutter_tools/lib/src/base/logger.dart +++ b/packages/flutter_tools/lib/src/base/logger.dart
@@ -422,7 +422,7 @@ @override void clear() { _status?.pause(); - writeToStdOut(terminal.clearScreen() + '\n'); + writeToStdOut('${terminal.clearScreen()}\n'); _status?.resume(); } }
diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart index b69ded1..81b16fa 100644 --- a/packages/flutter_tools/lib/src/base/utils.dart +++ b/packages/flutter_tools/lib/src/base/utils.dart
@@ -42,7 +42,7 @@ } /// Return the plural of the given word (`cat(s)`). -String pluralize(String word, int count) => count == 1 ? word : word + 's'; +String pluralize(String word, int count) => count == 1 ? word : '${word}s'; /// Return the name of an enum item. String getEnumName(dynamic enumItem) { @@ -52,7 +52,8 @@ } String toPrettyJson(Object jsonable) { - return const JsonEncoder.withIndent(' ').convert(jsonable) + '\n'; + final String value = const JsonEncoder.withIndent(' ').convert(jsonable); + return '$value\n'; } final NumberFormat kSecondsFormat = NumberFormat('0.0');
diff --git a/packages/flutter_tools/lib/src/build_info.dart b/packages/flutter_tools/lib/src/build_info.dart index df2fcf4..ebd7e9a 100644 --- a/packages/flutter_tools/lib/src/build_info.dart +++ b/packages/flutter_tools/lib/src/build_info.dart
@@ -798,7 +798,7 @@ final String arch = (targetPlatform == null) ? _getCurrentHostPlatformArchName() : getNameForTargetPlatformArch(targetPlatform); - final String subDirs = 'linux/' + arch; + final String subDirs = 'linux/$arch'; return globals.fs.path.join(getBuildDirectory(), subDirs); }
diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index 0262df6..0a0e9f4 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart
@@ -766,7 +766,7 @@ final Directory pkgDir = cache.getCacheDir('pkg'); for (final String pkgName in getPackageDirs()) { - await artifactUpdater.downloadZipArchive('Downloading package $pkgName...', Uri.parse(url + pkgName + '.zip'), pkgDir); + await artifactUpdater.downloadZipArchive('Downloading package $pkgName...', Uri.parse('$url$pkgName.zip'), pkgDir); } for (final List<String> toolsDir in getBinaryDirs()) { @@ -802,7 +802,7 @@ bool exists = false; for (final String pkgName in getPackageDirs()) { - exists = await cache.doesRemoteExist('Checking package $pkgName is available...', Uri.parse(url + pkgName + '.zip')); + exists = await cache.doesRemoteExist('Checking package $pkgName is available...', Uri.parse('$url$pkgName.zip')); if (!exists) { return false; }
diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart index e30c10f..14a7025 100644 --- a/packages/flutter_tools/lib/src/commands/create.dart +++ b/packages/flutter_tools/lib/src/commands/create.dart
@@ -421,7 +421,7 @@ final String projectName = templateContext['projectName'] as String; final String organization = templateContext['organization'] as String; final String androidPluginIdentifier = templateContext['androidIdentifier'] as String; - final String exampleProjectName = projectName + '_example'; + final String exampleProjectName = '${projectName}_example'; templateContext['projectName'] = exampleProjectName; templateContext['androidIdentifier'] = CreateBase.createAndroidIdentifier(organization, exampleProjectName); templateContext['iosIdentifier'] = CreateBase.createUTIIdentifier(organization, exampleProjectName);
diff --git a/packages/flutter_tools/lib/src/commands/create_base.dart b/packages/flutter_tools/lib/src/commands/create_base.dart index 70b8daa..0b8a59c 100644 --- a/packages/flutter_tools/lib/src/commands/create_base.dart +++ b/packages/flutter_tools/lib/src/commands/create_base.dart
@@ -332,7 +332,7 @@ final String pluginDartClass = _createPluginClassName(projectName); final String pluginClass = pluginDartClass.endsWith('Plugin') ? pluginDartClass - : pluginDartClass + 'Plugin'; + : '${pluginDartClass}Plugin'; final String pluginClassSnakeCase = snakeCase(pluginClass); final String pluginClassCapitalSnakeCase = pluginClassSnakeCase.toUpperCase(); @@ -465,7 +465,7 @@ final RegExp segmentPatternRegex = RegExp(r'^[a-zA-Z][\w]*$'); final List<String> prefixedSegments = segments.map((String segment) { if (!segmentPatternRegex.hasMatch(segment)) { - return 'u' + segment; + return 'u$segment'; } return segment; }).toList();
diff --git a/packages/flutter_tools/lib/src/commands/emulators.dart b/packages/flutter_tools/lib/src/commands/emulators.dart index 1f9ea1d..eb8b35c 100644 --- a/packages/flutter_tools/lib/src/commands/emulators.dart +++ b/packages/flutter_tools/lib/src/commands/emulators.dart
@@ -39,9 +39,7 @@ if (globals.doctor.workflows.every((Workflow w) => !w.canListEmulators)) { throwToolExit( 'Unable to find any emulator sources. Please ensure you have some\n' - 'Android AVD images ' + - (globals.platform.isMacOS ? 'or an iOS Simulator ' : '') + - 'available.', + 'Android AVD images ${globals.platform.isMacOS ? 'or an iOS Simulator ' : ''}available.', exitCode: 1); }
diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index d9ade7e..09eea05 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart
@@ -1116,7 +1116,7 @@ final String trailingComment = line.substring(hashIndex, line.length); assert(line.endsWith(trailingComment)); isTransitive = trailingComment == kTransitiveMagicString; - suffix = ' ' + trailingComment; + suffix = ' $trailingComment'; stripped = line.substring(colonIndex + 1, hashIndex).trimRight(); } else { stripped = line.substring(colonIndex + 1, line.length).trimRight();
diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 983d3ce..e8a69fb 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart
@@ -938,7 +938,7 @@ final String filePath = fileUri.toFilePath(windows: windows); for (final String fileSystemRoot in fileSystemRoots) { if (filePath.startsWith(fileSystemRoot)) { - return scheme + '://' + filePath.substring(fileSystemRoot.length); + return '$scheme://${filePath.substring(fileSystemRoot.length)}'; } } return fileUri.toString();
diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 8784d9e..047faeb 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart
@@ -640,7 +640,7 @@ } /// Converts a platform-specific file path to a platform-independent URL path. - String _asUriPath(String filePath) => _fileSystem.path.toUri(filePath).path + '/'; + String _asUriPath(String filePath) => '${_fileSystem.path.toUri(filePath).path}/'; } /// An implementation of a devFS writer which copies physical files for devices
diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index 44247c0..6affb37 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart
@@ -650,7 +650,7 @@ // Join columns into lines of text for (final List<String> row in table) { - yield indices.map<String>((int i) => row[i].padRight(widths[i])).join(' • ') + ' • ${row.last}'; + yield indices.map<String>((int i) => row[i].padRight(widths[i])).followedBy(<String>[row.last]).join(' • '); } }
diff --git a/packages/flutter_tools/lib/src/doctor_validator.dart b/packages/flutter_tools/lib/src/doctor_validator.dart index 20f8a43..d5488c0 100644 --- a/packages/flutter_tools/lib/src/doctor_validator.dart +++ b/packages/flutter_tools/lib/src/doctor_validator.dart
@@ -127,7 +127,7 @@ } break; default: - throw 'Unrecognized validation type: ' + result.type.toString(); + throw 'Unrecognized validation type: ${result.type}'; } mergedMessages.addAll(result.messages); }
diff --git a/packages/flutter_tools/lib/src/emulator.dart b/packages/flutter_tools/lib/src/emulator.dart index 327a5f1..557c86b 100644 --- a/packages/flutter_tools/lib/src/emulator.dart +++ b/packages/flutter_tools/lib/src/emulator.dart
@@ -301,9 +301,9 @@ return table .map<String>((List<String> row) { return indices - .map<String>((int i) => row[i].padRight(widths[i])) - .join(' • ') + - ' • ${row.last}'; + .map<String>((int i) => row[i].padRight(widths[i])) + .followedBy(<String>[row.last]) + .join(' • '); }) .map<String>((String line) => line.replaceAll(whiteSpaceAndDots, '')) .toList();
diff --git a/packages/flutter_tools/lib/src/flutter_plugins.dart b/packages/flutter_tools/lib/src/flutter_plugins.dart index 9e4f42f..e805b3c 100644 --- a/packages/flutter_tools/lib/src/flutter_plugins.dart +++ b/packages/flutter_tools/lib/src/flutter_plugins.dart
@@ -951,8 +951,7 @@ ' start ms-settings:developers\n' 'to open settings.' : 'You must build from a terminal run as administrator.'; - throwToolExit('Building with plugins requires symlink support.\n\n' + - instructions); + throwToolExit('Building with plugins requires symlink support.\n\n$instructions'); } }
diff --git a/packages/flutter_tools/lib/src/intellij/intellij_validator.dart b/packages/flutter_tools/lib/src/intellij/intellij_validator.dart index de751e1..d2fc4cf 100644 --- a/packages/flutter_tools/lib/src/intellij/intellij_validator.dart +++ b/packages/flutter_tools/lib/src/intellij/intellij_validator.dart
@@ -229,9 +229,9 @@ } if (installPath != null && fileSystem.isDirectorySync(installPath)) { String pluginsPath; - if (fileSystem.isDirectorySync(installPath + '.plugins')) { + if (fileSystem.isDirectorySync('$installPath.plugins')) { // IntelliJ 2020.3 - pluginsPath = installPath + '.plugins'; + pluginsPath = '$installPath.plugins'; addValidator(title, version, installPath, pluginsPath); } else if (platform.environment.containsKey('APPDATA')) { final String pluginsPathInAppData = fileSystem.path.join( @@ -340,7 +340,7 @@ name); if (installPath.contains(fileSystem.path.join('JetBrains','Toolbox','apps'))) { // via JetBrains ToolBox app - final String pluginsPathInInstallDir = installPath + '.plugins'; + final String pluginsPathInInstallDir = '$installPath.plugins'; if (fileSystem.isDirectorySync(pluginsPathInUserHomeDir)) { // after 2020.2.x final String pluginsPath = pluginsPathInUserHomeDir; @@ -517,7 +517,7 @@ .getValueFromFile(plistFile, 'JetBrainsToolboxApp'); if (altLocation != null) { - _pluginsPath = altLocation + '.plugins'; + _pluginsPath = '$altLocation.plugins'; return _pluginsPath!; }
diff --git a/packages/flutter_tools/lib/src/ios/xcodeproj.dart b/packages/flutter_tools/lib/src/ios/xcodeproj.dart index 481fbd7..78b2cc0 100644 --- a/packages/flutter_tools/lib/src/ios/xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/xcodeproj.dart
@@ -373,7 +373,7 @@ if (buildInfo.flavor == null) { return baseConfiguration; } - return baseConfiguration + '-$scheme'; + return '$baseConfiguration-$scheme'; } /// Checks whether the [buildConfigurations] contains the specified string, without
diff --git a/packages/flutter_tools/lib/src/isolated/devfs_web.dart b/packages/flutter_tools/lib/src/isolated/devfs_web.dart index cfffb87..6cac27f 100644 --- a/packages/flutter_tools/lib/src/isolated/devfs_web.dart +++ b/packages/flutter_tools/lib/src/isolated/devfs_web.dart
@@ -841,7 +841,7 @@ final CompilerOutput compilerOutput = await generator.recompile( Uri( scheme: 'org-dartlang-app', - path: '/' + mainUri.pathSegments.last, + path: '/${mainUri.pathSegments.last}', ), invalidatedFiles, outputPath: dillOutputPath,
diff --git a/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart b/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart index 46777c3..3c2ebaf 100644 --- a/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart +++ b/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart
@@ -440,7 +440,7 @@ flutterDevices.first.generator.addFileSystemRoot(_fileSystem.directory('test').absolute.path); importedEntrypoint = Uri( scheme: 'org-dartlang-app', - path: '/' + mainUri.pathSegments.last, + path: '/${mainUri.pathSegments.last}', ); } final LanguageVersion languageVersion = determineLanguageVersion(
diff --git a/packages/flutter_tools/lib/src/license_collector.dart b/packages/flutter_tools/lib/src/license_collector.dart index b2926ab..368aab7 100644 --- a/packages/flutter_tools/lib/src/license_collector.dart +++ b/packages/flutter_tools/lib/src/license_collector.dart
@@ -31,7 +31,7 @@ final FileSystem _fileSystem; /// The expected separator for multiple licenses. - static final String licenseSeparator = '\n' + ('-' * 80) + '\n'; + static final String licenseSeparator = '\n${'-' * 80}\n'; /// Obtain licenses from the `packageMap` into a single result. /// @@ -86,7 +86,7 @@ .map<String>((String license) { final List<String> packageNames = packageLicenses[license]!.toList() ..sort(); - return packageNames.join('\n') + '\n\n' + license; + return '${packageNames.join('\n')}\n\n$license'; }).toList(); combinedLicensesList.sort();
diff --git a/packages/flutter_tools/lib/src/linux/build_linux.dart b/packages/flutter_tools/lib/src/linux/build_linux.dart index ce45b0f..7ba9264 100644 --- a/packages/flutter_tools/lib/src/linux/build_linux.dart +++ b/packages/flutter_tools/lib/src/linux/build_linux.dart
@@ -131,7 +131,7 @@ '-G', 'Ninja', '-DCMAKE_BUILD_TYPE=$buildFlag', - '-DFLUTTER_TARGET_PLATFORM=' + getNameForTargetPlatform(targetPlatform), + '-DFLUTTER_TARGET_PLATFORM=${getNameForTargetPlatform(targetPlatform)}', // Support cross-building for arm64 targets on x64 hosts. // (Cross-building for x64 on arm64 hosts isn't supported now.) if (needCrossBuild)
diff --git a/packages/flutter_tools/lib/src/localizations/localizations_utils.dart b/packages/flutter_tools/lib/src/localizations/localizations_utils.dart index dd221a0..04fcca4 100644 --- a/packages/flutter_tools/lib/src/localizations/localizations_utils.dart +++ b/packages/flutter_tools/lib/src/localizations/localizations_utils.dart
@@ -93,10 +93,10 @@ // Update the base string to reflect assumed scriptCodes. originalString = languageCode; if (scriptCode != null) { - originalString += '_' + scriptCode; + originalString += '_$scriptCode'; } if (countryCode != null) { - originalString += '_' + countryCode; + originalString += '_$countryCode'; } }
diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart index fc07526..38ba052 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart
@@ -942,7 +942,7 @@ if (experiments.isNotEmpty) { for (final String expFlag in experiments) { - final String flag = '--enable-experiment=' + expFlag; + final String flag = '--enable-experiment=$expFlag'; extraFrontEndOptions.add(flag); extraGenSnapshotOptions.add(flag); }
diff --git a/packages/flutter_tools/lib/src/runner/local_engine.dart b/packages/flutter_tools/lib/src/runner/local_engine.dart index 3567da4..e6537a6 100644 --- a/packages/flutter_tools/lib/src/runner/local_engine.dart +++ b/packages/flutter_tools/lib/src/runner/local_engine.dart
@@ -163,7 +163,7 @@ for (final String suffix in suffixes) { tmpBasename = tmpBasename.replaceFirst(RegExp('$suffix\$'), ''); } - return 'host_' + tmpBasename; + return 'host_$tmpBasename'; } EngineBuildPaths _findEngineBuildPath(String localEngine, String enginePath) {
diff --git a/packages/flutter_tools/lib/src/test/flutter_web_platform.dart b/packages/flutter_tools/lib/src/test/flutter_web_platform.dart index 03a0762..c168d7c 100644 --- a/packages/flutter_tools/lib/src/test/flutter_web_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_web_platform.dart
@@ -221,26 +221,26 @@ Future<shelf.Response> _handleTestRequest(shelf.Request request) async { if (request.url.path.endsWith('.dart.browser_test.dart.js')) { final String leadingPath = request.url.path.split('.browser_test.dart.js')[0]; - final String generatedFile = _fileSystem.path.split(leadingPath).join('_') + '.bootstrap.js'; - return shelf.Response.ok(generateTestBootstrapFileContents('/' + generatedFile, 'require.js', 'dart_stack_trace_mapper.js'), headers: <String, String>{ + final String generatedFile = '${_fileSystem.path.split(leadingPath).join('_')}.bootstrap.js'; + return shelf.Response.ok(generateTestBootstrapFileContents('/$generatedFile', 'require.js', 'dart_stack_trace_mapper.js'), headers: <String, String>{ HttpHeaders.contentTypeHeader: 'text/javascript', }); } if (request.url.path.endsWith('.dart.bootstrap.js')) { final String leadingPath = request.url.path.split('.dart.bootstrap.js')[0]; - final String generatedFile = _fileSystem.path.split(leadingPath).join('_') + '.dart.test.dart.js'; + final String generatedFile = '${_fileSystem.path.split(leadingPath).join('_')}.dart.test.dart.js'; return shelf.Response.ok(generateMainModule( nullAssertions: nullAssertions, nativeNullAssertions: true, - bootstrapModule: _fileSystem.path.basename(leadingPath) + '.dart.bootstrap', - entrypoint: '/' + generatedFile + bootstrapModule: '${_fileSystem.path.basename(leadingPath)}.dart.bootstrap', + entrypoint: '/$generatedFile' ), headers: <String, String>{ HttpHeaders.contentTypeHeader: 'text/javascript', }); } if (request.url.path.endsWith('.dart.js')) { final String path = request.url.path.split('.dart.js')[0]; - return shelf.Response.ok(webMemoryFS.files[path + '.dart.lib.js'], headers: <String, String>{ + return shelf.Response.ok(webMemoryFS.files['$path.dart.lib.js'], headers: <String, String>{ HttpHeaders.contentTypeHeader: 'text/javascript', }); } @@ -369,7 +369,7 @@ shelf.Response _wrapperHandler(shelf.Request request) { final String path = _fileSystem.path.fromUri(request.url); if (path.endsWith('.html')) { - final String test = _fileSystem.path.withoutExtension(path) + '.dart'; + final String test = '${_fileSystem.path.withoutExtension(path)}.dart'; final String scriptBase = htmlEscape.convert(_fileSystem.path.basename(test)); final String link = '<link rel="x-dart-test" href="$scriptBase">'; return shelf.Response.ok(''' @@ -410,8 +410,8 @@ throw StateError('Load called on a closed FlutterWebPlatform'); } - final Uri suiteUrl = url.resolveUri(_fileSystem.path.toUri(_fileSystem.path.withoutExtension( - _fileSystem.path.relative(path, from: _fileSystem.path.join(_root, 'test'))) + '.html')); + final String pathFromTest = _fileSystem.path.relative(path, from: _fileSystem.path.join(_root, 'test')); + final Uri suiteUrl = url.resolveUri(_fileSystem.path.toUri('${_fileSystem.path.withoutExtension(pathFromTest)}.html')); final String relativePath = _fileSystem.path.relative(_fileSystem.path.normalize(path), from: _fileSystem.currentDirectory.path); final RunnerSuite suite = await _browserManager.load(relativePath, suiteUrl, suiteConfig, message, onDone: () async { await _browserManager.close();
diff --git a/packages/flutter_tools/lib/src/vscode/vscode.dart b/packages/flutter_tools/lib/src/vscode/vscode.dart index f4a2753..1a48053 100644 --- a/packages/flutter_tools/lib/src/vscode/vscode.dart +++ b/packages/flutter_tools/lib/src/vscode/vscode.dart
@@ -82,7 +82,7 @@ Version? _extensionVersion; final List<ValidationMessage> _validationMessages = <ValidationMessage>[]; - String get productName => 'VS Code' + (edition != null ? ', $edition' : ''); + String get productName => 'VS Code${edition != null ? ', $edition' : ''}'; Iterable<ValidationMessage> get validationMessages => _validationMessages;
diff --git a/packages/flutter_tools/lib/src/web/web_device.dart b/packages/flutter_tools/lib/src/web/web_device.dart index 9b118ab..7c214bb 100644 --- a/packages/flutter_tools/lib/src/web/web_device.dart +++ b/packages/flutter_tools/lib/src/web/web_device.dart
@@ -217,7 +217,7 @@ if (result.exitCode == 0) { final List<String> parts = (result.stdout as String).split(RegExp(r'\s+')); if (parts.length > 2) { - version = 'Google Chrome ' + parts[parts.length - 2]; + version = 'Google Chrome ${parts[parts.length - 2]}'; } } } @@ -278,7 +278,7 @@ if (result.exitCode == 0) { final List<String> parts = (result.stdout as String).split(RegExp(r'\s+')); if (parts.length > 2) { - return 'Microsoft Edge ' + parts[parts.length - 2]; + return 'Microsoft Edge ${parts[parts.length - 2]}'; } } }
diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index 19f6cca..cb8a429 100755 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart
@@ -660,7 +660,7 @@ expectExists('android/gradle.properties'); - final String actualContents = await globals.fs.file(projectDir.path + '/android/gradle.properties').readAsString(); + final String actualContents = await globals.fs.file('${projectDir.path}/android/gradle.properties').readAsString(); expect(actualContents.contains('useAndroidX'), true); }); @@ -694,7 +694,7 @@ expectExists('android/gradle.properties'); - final String actualContents = await globals.fs.file(projectDir.path + '/android/gradle.properties').readAsString(); + final String actualContents = await globals.fs.file('${projectDir.path}/android/gradle.properties').readAsString(); expect(actualContents.contains('useAndroidX'), true); }); @@ -708,13 +708,13 @@ await runner.run(<String>['create', '--no-pub', '--platforms', 'android', projectDir.path]); final String androidManifest = await globals.fs.file( - projectDir.path + '/android/app/src/main/AndroidManifest.xml' + '${projectDir.path}/android/app/src/main/AndroidManifest.xml' ).readAsString(); expect(androidManifest.contains('android:name="flutterEmbedding"'), true); expect(androidManifest.contains('android:value="2"'), true); final String mainActivity = await globals.fs.file( - projectDir.path + '/android/app/src/main/kotlin/com/example/flutter_project/MainActivity.kt' + '${projectDir.path}/android/app/src/main/kotlin/com/example/flutter_project/MainActivity.kt' ).readAsString(); // Import for the new embedding class. expect(mainActivity.contains('import io.flutter.embedding.android.FlutterActivity'), true); @@ -1090,7 +1090,7 @@ expectExists('lib/main.dart'); expectExists('test/widget_test.dart'); - final String actualContents = await globals.fs.file(projectDir.path + '/test/widget_test.dart').readAsString(); + final String actualContents = await globals.fs.file('${projectDir.path}/test/widget_test.dart').readAsString(); expect(actualContents.contains('flutter_test.dart'), true); @@ -2254,7 +2254,7 @@ expect(globals.fs.isFileSync('${projectDir.path}/android/app/build.gradle'), true); - final String buildContent = await globals.fs.file(projectDir.path + '/android/app/build.gradle').readAsString(); + final String buildContent = await globals.fs.file('${projectDir.path}/android/app/build.gradle').readAsString(); expect(buildContent.contains('compileSdkVersion 30'), true); expect(buildContent.contains('targetSdkVersion 30'), true); @@ -2587,7 +2587,7 @@ final File snapshotFile = globals.fs.file(flutterToolsSnapshotPath); if (snapshotFile.existsSync()) { - snapshotFile.renameSync(flutterToolsSnapshotPath + '.bak'); + snapshotFile.renameSync('$flutterToolsSnapshotPath.bak'); } final List<String> snapshotArgs = <String>[ @@ -2615,7 +2615,7 @@ 'flutter_tools.snapshot', )); - final File snapshotBackup = globals.fs.file(flutterToolsSnapshotPath + '.bak'); + final File snapshotBackup = globals.fs.file('$flutterToolsSnapshotPath.bak'); if (!snapshotBackup.existsSync()) { // No backup to restore. return;
diff --git a/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart b/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart index d58d928..b5098cf 100644 --- a/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart +++ b/packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart
@@ -162,7 +162,7 @@ completer: Completer<void>.sync(), // Example stack trace from an incorrectly named application:name in the AndroidManfiest.xml stdout: - kDummyLine + + '$kDummyLine' '05-11 12:54:46.665 E/AndroidRuntime(11787): FATAL EXCEPTION: main\n' '05-11 12:54:46.665 E/AndroidRuntime(11787): Process: com.example.foobar, PID: 11787\n' '05-11 12:54:46.665 java.lang.RuntimeException: Unable to instantiate application '
diff --git a/packages/flutter_tools/test/general.shard/base/build_test.dart b/packages/flutter_tools/test/general.shard/base/build_test.dart index 2a77f85..243dc8f 100644 --- a/packages/flutter_tools/test/general.shard/base/build_test.dart +++ b/packages/flutter_tools/test/general.shard/base/build_test.dart
@@ -114,7 +114,7 @@ processManager.addCommand( FakeCommand( command: <String>[ - artifacts.getArtifactPath(Artifact.genSnapshot, platform: TargetPlatform.ios, mode: BuildMode.release) + '_armv7', + '${artifacts.getArtifactPath(Artifact.genSnapshot, platform: TargetPlatform.ios, mode: BuildMode.release)}_armv7', '--additional_arg' ], ), @@ -129,10 +129,15 @@ }); testWithoutContext('iOS arm64', () async { + final String genSnapshotPath = artifacts.getArtifactPath( + Artifact.genSnapshot, + platform: TargetPlatform.ios, + mode: BuildMode.release, + ); processManager.addCommand( FakeCommand( command: <String>[ - artifacts.getArtifactPath(Artifact.genSnapshot, platform: TargetPlatform.ios, mode: BuildMode.release) + '_arm64', + '${genSnapshotPath}_arm64', '--additional_arg', ], ), @@ -238,11 +243,14 @@ testWithoutContext('builds iOS with bitcode', () async { final String outputPath = fileSystem.path.join('build', 'foo'); final String assembly = fileSystem.path.join(outputPath, 'snapshot_assembly.S'); + final String genSnapshotPath = artifacts.getArtifactPath( + Artifact.genSnapshot, + platform: TargetPlatform.ios, + mode: BuildMode.profile, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ - artifacts.getArtifactPath(Artifact.genSnapshot, - platform: TargetPlatform.ios, mode: BuildMode.profile) + - '_armv7', + '${genSnapshotPath}_armv7', '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', @@ -295,11 +303,14 @@ final String outputPath = fileSystem.path.join('build', 'foo'); final String assembly = fileSystem.path.join(outputPath, 'snapshot_assembly.S'); final String debugPath = fileSystem.path.join('foo', 'app.ios-armv7.symbols'); + final String genSnapshotPath = artifacts.getArtifactPath( + Artifact.genSnapshot, + platform: TargetPlatform.ios, + mode: BuildMode.profile, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ - artifacts.getArtifactPath(Artifact.genSnapshot, - platform: TargetPlatform.ios, mode: BuildMode.profile) + - '_armv7', + '${genSnapshotPath}_armv7', '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', @@ -352,11 +363,14 @@ testWithoutContext('builds iOS armv7 snapshot with obfuscate', () async { final String outputPath = fileSystem.path.join('build', 'foo'); final String assembly = fileSystem.path.join(outputPath, 'snapshot_assembly.S'); + final String genSnapshotPath = artifacts.getArtifactPath( + Artifact.genSnapshot, + platform: TargetPlatform.ios, + mode: BuildMode.profile, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ - artifacts.getArtifactPath(Artifact.genSnapshot, - platform: TargetPlatform.ios, mode: BuildMode.profile) + - '_armv7', + '${genSnapshotPath}_armv7', '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', @@ -408,11 +422,14 @@ testWithoutContext('builds iOS armv7 snapshot', () async { final String outputPath = fileSystem.path.join('build', 'foo'); + final String genSnapshotPath = artifacts.getArtifactPath( + Artifact.genSnapshot, + platform: TargetPlatform.ios, + mode: BuildMode.release, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ - artifacts.getArtifactPath(Artifact.genSnapshot, - platform: TargetPlatform.ios, mode: BuildMode.release) + - '_armv7', + '${genSnapshotPath}_armv7', '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=${fileSystem.path.join(outputPath, 'snapshot_assembly.S')}', @@ -462,11 +479,14 @@ testWithoutContext('builds iOS arm64 snapshot', () async { final String outputPath = fileSystem.path.join('build', 'foo'); + final String genSnapshotPath = artifacts.getArtifactPath( + Artifact.genSnapshot, + platform: TargetPlatform.ios, + mode: BuildMode.release, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ - artifacts.getArtifactPath(Artifact.genSnapshot, - platform: TargetPlatform.ios, mode: BuildMode.release) + - '_arm64', + '${genSnapshotPath}_arm64', '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=${fileSystem.path.join(outputPath, 'snapshot_assembly.S')}',
diff --git a/packages/flutter_tools/test/general.shard/base/terminal_test.dart b/packages/flutter_tools/test/general.shard/base/terminal_test.dart index 883631d..7ba6d4a 100644 --- a/packages/flutter_tools/test/general.shard/base/terminal_test.dart +++ b/packages/flutter_tools/test/general.shard/base/terminal_test.dart
@@ -19,7 +19,7 @@ ); bufferLogger.printStatus('0123456789' * 8); - expect(bufferLogger.statusText, equals(('0123456789' * 4 + '\n') * 2)); + expect(bufferLogger.statusText, equals(('${'0123456789' * 4}\n') * 2)); }); testWithoutContext('can turn off wrapping', () async {
diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart index 90dde14..5623149 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart
@@ -78,17 +78,18 @@ ..createSync(recursive: true) ..writeAsStringSync('{"configVersion": 2, "packages":[]}'); final String build = androidEnvironment.buildDir.path; + final String flutterPatchedSdkPath = artifacts.getArtifactPath( + Artifact.flutterPatchedSdkPath, + platform: TargetPlatform.android_arm, + mode: BuildMode.profile, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ artifacts.getHostArtifact(HostArtifact.engineDartBinary).path, '--disable-dart-dev', artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk), '--sdk-root', - artifacts.getArtifactPath( - Artifact.flutterPatchedSdkPath, - platform: TargetPlatform.android_arm, - mode: BuildMode.profile, - ) + '/', + '$flutterPatchedSdkPath/', '--target=flutter', '--no-print-incremental-dependencies', ...buildModeOptions(BuildMode.profile, <String>[]), @@ -113,17 +114,18 @@ ..createSync(recursive: true) ..writeAsStringSync('{"configVersion": 2, "packages":[]}'); final String build = androidEnvironment.buildDir.path; + final String flutterPatchedSdkPath = artifacts.getArtifactPath( + Artifact.flutterPatchedSdkPath, + platform: TargetPlatform.android_arm, + mode: BuildMode.profile, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ artifacts.getHostArtifact(HostArtifact.engineDartBinary).path, '--disable-dart-dev', artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk), '--sdk-root', - artifacts.getArtifactPath( - Artifact.flutterPatchedSdkPath, - platform: TargetPlatform.android_arm, - mode: BuildMode.profile, - ) + '/', + '$flutterPatchedSdkPath/', '--target=flutter', '--no-print-incremental-dependencies', ...buildModeOptions(BuildMode.profile, <String>[]), @@ -149,17 +151,18 @@ ..createSync(recursive: true) ..writeAsStringSync('{"configVersion": 2, "packages":[]}'); final String build = androidEnvironment.buildDir.path; + final String flutterPatchedSdkPath = artifacts.getArtifactPath( + Artifact.flutterPatchedSdkPath, + platform: TargetPlatform.android_arm, + mode: BuildMode.profile, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ artifacts.getHostArtifact(HostArtifact.engineDartBinary).path, '--disable-dart-dev', artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk), '--sdk-root', - artifacts.getArtifactPath( - Artifact.flutterPatchedSdkPath, - platform: TargetPlatform.android_arm, - mode: BuildMode.profile, - ) + '/', + '$flutterPatchedSdkPath/', '--target=flutter', '--no-print-incremental-dependencies', ...buildModeOptions(BuildMode.profile, <String>[]), @@ -186,17 +189,18 @@ ..createSync(recursive: true) ..writeAsStringSync('{"configVersion": 2, "packages":[]}'); final String build = androidEnvironment.buildDir.path; + final String flutterPatchedSdkPath = artifacts.getArtifactPath( + Artifact.flutterPatchedSdkPath, + platform: TargetPlatform.android_arm, + mode: BuildMode.profile, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ artifacts.getHostArtifact(HostArtifact.engineDartBinary).path, '--disable-dart-dev', artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk), '--sdk-root', - artifacts.getArtifactPath( - Artifact.flutterPatchedSdkPath, - platform: TargetPlatform.android_arm, - mode: BuildMode.profile, - ) + '/', + '$flutterPatchedSdkPath/', '--target=flutter', '--no-print-incremental-dependencies', ...buildModeOptions(BuildMode.profile, <String>[]), @@ -225,17 +229,18 @@ ..createSync(recursive: true) ..writeAsStringSync('{"configVersion": 2, "packages":[]}'); final String build = androidEnvironment.buildDir.path; + final String flutterPatchedSdkPath = artifacts.getArtifactPath( + Artifact.flutterPatchedSdkPath, + platform: TargetPlatform.android_arm, + mode: BuildMode.debug, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ artifacts.getHostArtifact(HostArtifact.engineDartBinary).path, '--disable-dart-dev', artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk), '--sdk-root', - artifacts.getArtifactPath( - Artifact.flutterPatchedSdkPath, - platform: TargetPlatform.android_arm, - mode: BuildMode.debug, - ) + '/', + '$flutterPatchedSdkPath/', '--target=flutter', '--no-print-incremental-dependencies', ...buildModeOptions(BuildMode.debug, <String>[]), @@ -262,17 +267,18 @@ ..createSync(recursive: true) ..writeAsStringSync('{"configVersion": 2, "packages":[]}'); final String build = androidEnvironment.buildDir.path; + final String flutterPatchedSdkPath = artifacts.getArtifactPath( + Artifact.flutterPatchedSdkPath, + platform: TargetPlatform.darwin, + mode: BuildMode.debug, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ artifacts.getHostArtifact(HostArtifact.engineDartBinary).path, '--disable-dart-dev', artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk), '--sdk-root', - artifacts.getArtifactPath( - Artifact.flutterPatchedSdkPath, - platform: TargetPlatform.darwin, - mode: BuildMode.debug, - ) + '/', + '$flutterPatchedSdkPath/', '--target=flutter', '--no-print-incremental-dependencies', ...buildModeOptions(BuildMode.debug, <String>[]), @@ -311,17 +317,18 @@ logger: logger, ); final String build = testEnvironment.buildDir.path; + final String flutterPatchedSdkPath = artifacts.getArtifactPath( + Artifact.flutterPatchedSdkPath, + platform: TargetPlatform.android_arm, + mode: BuildMode.debug, + ); processManager.addCommands(<FakeCommand>[ FakeCommand(command: <String>[ artifacts.getHostArtifact(HostArtifact.engineDartBinary).path, '--disable-dart-dev', artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk), '--sdk-root', - artifacts.getArtifactPath( - Artifact.flutterPatchedSdkPath, - platform: TargetPlatform.android_arm, - mode: BuildMode.debug, - ) + '/', + '$flutterPatchedSdkPath/', '--target=flutter', '--no-print-incremental-dependencies', ...buildModeOptions(BuildMode.debug, <String>[]),
diff --git a/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart b/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart index c30602a..3cf6171 100644 --- a/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart +++ b/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart
@@ -68,8 +68,8 @@ final Directory installedDirectory = fileSystem.directory(installPath); installedDirectory.createSync(recursive: true); // Create plugin JAR file for Flutter and Dart plugin. - createIntellijFlutterPluginJar(pluginPath + '/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); - createIntellijDartPluginJar(pluginPath + '/Dart/lib/Dart.jar', fileSystem); + createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); + createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem); final Iterable<DoctorValidator> installed = IntelliJValidatorOnLinux.installed( fileSystem: fileSystem, @@ -95,8 +95,8 @@ final Directory installedDirectory = fileSystem.directory(installPath); installedDirectory.createSync(recursive: true); // Create plugin JAR file for Flutter and Dart plugin. - createIntellijFlutterPluginJar(pluginPath + '/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); - createIntellijDartPluginJar(pluginPath + '/Dart/lib/Dart.jar', fileSystem); + createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); + createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem); final Iterable<DoctorValidator> installed = IntelliJValidatorOnLinux.installed( fileSystem: fileSystem, @@ -122,8 +122,8 @@ final Directory installedDirectory = fileSystem.directory(installPath); installedDirectory.createSync(recursive: true); // Create plugin JAR file for Flutter and Dart plugin. - createIntellijFlutterPluginJar(pluginPath + '/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); - createIntellijDartPluginJar(pluginPath + '/Dart/lib/Dart.jar', fileSystem); + createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); + createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem); final Iterable<DoctorValidator> installed = IntelliJValidatorOnLinux.installed( fileSystem: fileSystem, @@ -149,8 +149,8 @@ final Directory installedDirectory = fileSystem.directory(installPath); installedDirectory.createSync(recursive: true); // Create plugin JAR file for Flutter and Dart plugin. - createIntellijFlutterPluginJar(pluginPath + '/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); - createIntellijDartPluginJar(pluginPath + '/Dart/lib/Dart.jar', fileSystem); + createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); + createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem); final Iterable<DoctorValidator> installed = IntelliJValidatorOnLinux.installed( fileSystem: fileSystem, @@ -175,8 +175,8 @@ .writeAsStringSync(installPath, flush: true); final Directory installedDirectory = fileSystem.directory(installPath); installedDirectory.createSync(recursive: true); - createIntellijFlutterPluginJar(pluginPath + '/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); - createIntellijDartPluginJar(pluginPath + '/Dart/lib/Dart.jar', fileSystem); + createIntellijFlutterPluginJar('$pluginPath/flutter-intellij/lib/flutter-intellij.jar', fileSystem, version: '50.0'); + createIntellijDartPluginJar('$pluginPath/Dart/lib/Dart.jar', fileSystem); final Iterable<DoctorValidator> installed = IntelliJValidatorOnWindows.installed( fileSystem: fileSystem,
diff --git a/packages/flutter_tools/test/general.shard/resident_runner_test.dart b/packages/flutter_tools/test/general.shard/resident_runner_test.dart index 08c3aed..4ba422c 100644 --- a/packages/flutter_tools/test/general.shard/resident_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_runner_test.dart
@@ -2101,7 +2101,7 @@ .uri.toString()); expect(residentCompiler.targetModel, TargetModel.dartdevc); expect(residentCompiler.sdkRoot, - globals.artifacts.getHostArtifact(HostArtifact.flutterWebSdk).path + '/'); + '${globals.artifacts.getHostArtifact(HostArtifact.flutterWebSdk).path}/'); expect(residentCompiler.platformDill, 'file:///HostArtifact.webPlatformKernelDill'); }, overrides: <Type, Generator>{ Artifacts: () => Artifacts.test(), @@ -2132,7 +2132,7 @@ .uri.toString()); expect(residentCompiler.targetModel, TargetModel.dartdevc); expect(residentCompiler.sdkRoot, - globals.artifacts.getHostArtifact(HostArtifact.flutterWebSdk).path + '/'); + '${globals.artifacts.getHostArtifact(HostArtifact.flutterWebSdk).path}/'); expect(residentCompiler.platformDill, 'file:///HostArtifact.webPlatformSoundKernelDill'); }, overrides: <Type, Generator>{ Artifacts: () => Artifacts.test(),
diff --git a/packages/flutter_tools/test/general.shard/terminal_handler_test.dart b/packages/flutter_tools/test/general.shard/terminal_handler_test.dart index 614d71d..0f1ed32 100644 --- a/packages/flutter_tools/test/general.shard/terminal_handler_test.dart +++ b/packages/flutter_tools/test/general.shard/terminal_handler_test.dart
@@ -950,7 +950,7 @@ expect(terminalHandler.logger.statusText, equals('')); terminalHandler.logger.printStatus(message); - expect(terminalHandler.logger.statusText, equals(message + '\n')); // printStatus makes a newline + expect(terminalHandler.logger.statusText, equals('$message\n')); // printStatus makes a newline await terminalHandler.processTerminalInput('c'); expect(terminalHandler.logger.statusText, equals(''));
diff --git a/packages/flutter_tools/test/general.shard/utils_test.dart b/packages/flutter_tools/test/general.shard/utils_test.dart index a858e99..a80f2b8 100644 --- a/packages/flutter_tools/test/general.shard/utils_test.dart +++ b/packages/flutter_tools/test/general.shard/utils_test.dart
@@ -75,17 +75,17 @@ const int _lineLength = 40; const String _longLine = 'This is a long line that needs to be wrapped.'; final String _longLineWithNewlines = 'This is a long line with newlines that\n' - 'needs to be wrapped.\n\n' + - '0123456789' * 5; + 'needs to be wrapped.\n\n' + '${'0123456789' * 5}'; final String _longAnsiLineWithNewlines = '${AnsiTerminal.red}This${AnsiTerminal.resetAll} is a long line with newlines that\n' 'needs to be wrapped.\n\n' - '${AnsiTerminal.green}0123456789${AnsiTerminal.resetAll}' + - '0123456789' * 3 + + '${AnsiTerminal.green}0123456789${AnsiTerminal.resetAll}' + '${'0123456789' * 3}' '${AnsiTerminal.green}0123456789${AnsiTerminal.resetAll}'; const String _onlyAnsiSequences = '${AnsiTerminal.red}${AnsiTerminal.resetAll}'; final String _indentedLongLineWithNewlines = ' This is an indented long line with newlines that\n' - 'needs to be wrapped.\n\tAnd preserves tabs.\n \n ' + - '0123456789' * 5; + 'needs to be wrapped.\n\tAnd preserves tabs.\n \n ' + '${'0123456789' * 5}'; const String _shortLine = 'Short line.'; const String _indentedLongLine = ' This is an indented long line that needs to be ' 'wrapped and indentation preserved.'; @@ -135,7 +135,7 @@ }); testWithoutContext('refuses to wrap to a column smaller than 10 characters', () { - expect(wrapText('$_longLine ' + '0123456789' * 4, columnWidth: 1, shouldWrap: true), equals(''' + expect(wrapText('$_longLine ${'0123456789' * 4}', columnWidth: 1, shouldWrap: true), equals(''' This is a long line that needs @@ -252,7 +252,7 @@ testWithoutContext('', () { expect(wrapText( - ' ' * 7 + 'abc def ghi', columnWidth: 20, hangingIndent: 5, indent: 3, shouldWrap: true), + '${' ' * 7}abc def ghi', columnWidth: 20, hangingIndent: 5, indent: 3, shouldWrap: true), equals( ' abc def\n' ' ghi'
diff --git a/packages/flutter_tools/test/general.shard/web/golden_comparator_process_test.dart b/packages/flutter_tools/test/general.shard/web/golden_comparator_process_test.dart index e11e46e..cab59d1 100644 --- a/packages/flutter_tools/test/general.shard/web/golden_comparator_process_test.dart +++ b/packages/flutter_tools/test/general.shard/web/golden_comparator_process_test.dart
@@ -39,7 +39,7 @@ 'message': 'some message', }; - final FakeProcess mockProcess = createFakeProcess(jsonEncode(expectedResponse) + '\n'); + final FakeProcess mockProcess = createFakeProcess('${jsonEncode(expectedResponse)}\n'); final MemoryIOSink ioSink = mockProcess.stdin as MemoryIOSink; final TestGoldenComparatorProcess process = TestGoldenComparatorProcess(mockProcess, logger: BufferLogger.test()); @@ -62,7 +62,7 @@ 'message': 'some other message', }; - final FakeProcess mockProcess = createFakeProcess(jsonEncode(expectedResponse1) + '\n' + jsonEncode(expectedResponse2) + '\n'); + final FakeProcess mockProcess = createFakeProcess('${jsonEncode(expectedResponse1)}\n${jsonEncode(expectedResponse2)}\n'); final MemoryIOSink ioSink = mockProcess.stdin as MemoryIOSink; final TestGoldenComparatorProcess process = TestGoldenComparatorProcess(mockProcess, logger: BufferLogger.test());
diff --git a/packages/flutter_tools/test/general.shard/web/golden_comparator_test.dart b/packages/flutter_tools/test/general.shard/web/golden_comparator_test.dart index 78b8de0..e459d5b 100644 --- a/packages/flutter_tools/test/general.shard/web/golden_comparator_test.dart +++ b/packages/flutter_tools/test/general.shard/web/golden_comparator_test.dart
@@ -45,7 +45,7 @@ '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output' - ], stdout: jsonEncode(expectedResponse) + '\n', + ], stdout: '${jsonEncode(expectedResponse)}\n', )); final TestGoldenComparator comparator = TestGoldenComparator( @@ -73,7 +73,7 @@ '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output' - ], stdout: jsonEncode(expectedResponse) + '\n', + ], stdout: '${jsonEncode(expectedResponse)}\n', )); final TestGoldenComparator comparator = TestGoldenComparator( @@ -105,7 +105,7 @@ '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output' - ], stdout: jsonEncode(expectedResponse1) + '\n' + jsonEncode(expectedResponse2) + '\n', + ], stdout: '${jsonEncode(expectedResponse1)}\n${jsonEncode(expectedResponse2)}\n', )); final TestGoldenComparator comparator = TestGoldenComparator( @@ -140,7 +140,7 @@ '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output' - ], stdout: jsonEncode(expectedResponse1) + '\n', + ], stdout: '${jsonEncode(expectedResponse1)}\n', )); processManager.addCommand(FakeCommand( command: const <String>[ @@ -149,7 +149,7 @@ '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output' - ], stdout: jsonEncode(expectedResponse2) + '\n', + ], stdout: '${jsonEncode(expectedResponse2)}\n', )); final TestGoldenComparator comparator = TestGoldenComparator( @@ -182,7 +182,7 @@ '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output' - ], stdout: jsonEncode(expectedResponse) + '\n', + ], stdout: '${jsonEncode(expectedResponse)}\n', stdin: stdin, ));
diff --git a/packages/flutter_tools/test/integration.shard/generated_plugin_registrant_test.dart b/packages/flutter_tools/test/integration.shard/generated_plugin_registrant_test.dart index d640136..df491ea 100644 --- a/packages/flutter_tools/test/integration.shard/generated_plugin_registrant_test.dart +++ b/packages/flutter_tools/test/integration.shard/generated_plugin_registrant_test.dart
@@ -126,7 +126,7 @@ final File snapshotFile = globals.fs.file(flutterToolsSnapshotPath); if (snapshotFile.existsSync()) { - snapshotFile.renameSync(flutterToolsSnapshotPath + '.bak'); + snapshotFile.renameSync('$flutterToolsSnapshotPath.bak'); } final List<String> snapshotArgs = <String>[ @@ -157,7 +157,7 @@ ); final File snapshotBackup = - globals.fs.file(flutterToolsSnapshotPath + '.bak'); + globals.fs.file('$flutterToolsSnapshotPath.bak'); if (!snapshotBackup.existsSync()) { // No backup to restore. return;
diff --git a/packages/flutter_tools/test/integration.shard/overall_experience_test.dart b/packages/flutter_tools/test/integration.shard/overall_experience_test.dart index 02fc9b1..447eeab 100644 --- a/packages/flutter_tools/test/integration.shard/overall_experience_test.dart +++ b/packages/flutter_tools/test/integration.shard/overall_experience_test.dart
@@ -113,7 +113,7 @@ @override String toString() { - return _originalPatterns.map(describe).join(', ') + ' (matched ${_originalPatterns.length - patterns.length} so far)'; + return '${_originalPatterns.map(describe).join(', ')} (matched ${_originalPatterns.length - patterns.length} so far)'; } }
diff --git a/packages/flutter_tools/test/integration.shard/test_driver.dart b/packages/flutter_tools/test/integration.shard/test_driver.dart index 44414c3..8b91933 100644 --- a/packages/flutter_tools/test/integration.shard/test_driver.dart +++ b/packages/flutter_tools/test/integration.shard/test_driver.dart
@@ -68,11 +68,11 @@ String lastTime = ''; void _debugPrint(String message, { String topic = '' }) { const int maxLength = 2500; - final String truncatedMessage = message.length > maxLength ? message.substring(0, maxLength) + '...' : message; + final String truncatedMessage = message.length > maxLength ? '${message.substring(0, maxLength)}...' : message; final String line = '${topic.padRight(10)} $truncatedMessage'; _allMessages.add(line); final int timeInSeconds = DateTime.now().difference(startTime).inSeconds; - String time = timeInSeconds.toString().padLeft(5) + 's '; + String time = '${timeInSeconds.toString().padLeft(5)}s '; if (time == lastTime) { time = ' ' * time.length; } else {
diff --git a/packages/flutter_tools/test/integration.shard/test_test.dart b/packages/flutter_tools/test/integration.shard/test_test.dart index d7575e2..0251128 100644 --- a/packages/flutter_tools/test/integration.shard/test_test.dart +++ b/packages/flutter_tools/test/integration.shard/test_test.dart
@@ -194,7 +194,7 @@ }); testWithoutContext('flutter test should run all tests inside of a directory with no trailing slash', () async { - final ProcessResult result = await _runFlutterTest(null, automatedTestsDirectory, flutterTestDirectory + '/child_directory', + final ProcessResult result = await _runFlutterTest(null, automatedTestsDirectory, '$flutterTestDirectory/child_directory', extraArguments: const <String>['--verbose']); final String stdout = result.stdout as String; if ((!stdout.contains('+2: All tests passed')) ||
diff --git a/packages/flutter_tools/test/src/fake_http_client.dart b/packages/flutter_tools/test/src/fake_http_client.dart index e9b39c9..707f607 100644 --- a/packages/flutter_tools/test/src/fake_http_client.dart +++ b/packages/flutter_tools/test/src/fake_http_client.dart
@@ -410,7 +410,7 @@ @override void writeln([Object? object = '']) { - _body.addAll(utf8.encode(object.toString() + '\n')); + _body.addAll(utf8.encode('$object\n')); } }
diff --git a/packages/flutter_tools/test/src/pubspec_schema.dart b/packages/flutter_tools/test/src/pubspec_schema.dart index e91a179..1b80a87 100644 --- a/packages/flutter_tools/test/src/pubspec_schema.dart +++ b/packages/flutter_tools/test/src/pubspec_schema.dart
@@ -18,7 +18,7 @@ String? webFileName, }) { final FlutterManifest manifest = - FlutterManifest.createFromPath(projectDir + '/pubspec.yaml', fileSystem: globals.fs, logger: globals.logger)!; + FlutterManifest.createFromPath('$projectDir/pubspec.yaml', fileSystem: globals.fs, logger: globals.logger)!; final YamlMap platformsMap = YamlMap.wrap(manifest.supportedPlatforms!); for (final String platform in expectedPlatforms) { expect(platformsMap[platform], isNotNull);