enable lint prefer_interpolation_to_compose_strings (#83407)
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]}'; } } }