remove unnecessary String.toString() (#81859)
This commit is contained in:
parent
e74c15cac4
commit
9bca38c5e5
@ -66,7 +66,7 @@ import 'stock_strings_es.dart';
|
||||
/// be consistent with the languages listed in the StockStrings.supportedLocales
|
||||
/// property.
|
||||
abstract class StockStrings {
|
||||
StockStrings(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
|
||||
StockStrings(String locale) : localeName = intl.Intl.canonicalizedLocale(locale);
|
||||
|
||||
final String localeName;
|
||||
|
||||
|
@ -282,7 +282,7 @@ class _SlidersState extends State<_Sliders> {
|
||||
),
|
||||
),
|
||||
Slider.adaptive(
|
||||
label: _continuousValue.toStringAsFixed(6).toString(),
|
||||
label: _continuousValue.toStringAsFixed(6),
|
||||
value: _continuousValue,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
|
@ -727,7 +727,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
|
||||
int? lastNonWhitespace;
|
||||
for (final String currentString in string.characters) {
|
||||
if (!includeWhitespace &&
|
||||
!_isWhitespace(currentString.characters.first.toString().codeUnitAt(0))) {
|
||||
!_isWhitespace(currentString.characters.first.codeUnitAt(0))) {
|
||||
lastNonWhitespace = count;
|
||||
}
|
||||
if (count + currentString.length >= index) {
|
||||
|
@ -376,7 +376,7 @@ class SkiaGoldClient {
|
||||
/// Removes the file extension from the [fileName] to represent the test name
|
||||
/// properly.
|
||||
String cleanTestName(String fileName) {
|
||||
return fileName.split(path.extension(fileName.toString()))[0];
|
||||
return fileName.split(path.extension(fileName))[0];
|
||||
}
|
||||
|
||||
/// Returns a boolean value to prevent the client from re-authorizing itself
|
||||
|
@ -64,7 +64,7 @@ class DefaultWebGoldenComparator extends WebGoldenComparator {
|
||||
method: 'POST',
|
||||
sendData: json.encode(<String, Object>{
|
||||
'testUri': testUri.toString(),
|
||||
'key': key.toString(),
|
||||
'key': key,
|
||||
'width': width.round(),
|
||||
'height': height.round(),
|
||||
}),
|
||||
|
@ -235,7 +235,7 @@ void updateLocalProperties({
|
||||
buildInfo.buildNumber ?? project.manifest.buildNumber,
|
||||
globals.logger,
|
||||
);
|
||||
changeIfNecessary('flutter.versionCode', buildNumber?.toString());
|
||||
changeIfNecessary('flutter.versionCode', buildNumber);
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
|
@ -662,7 +662,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
|
||||
toMultiRootPath(fileUri, fileSystemScheme, fileSystemRoots, _platform.isWindows);
|
||||
}
|
||||
_server.stdin.writeln(message);
|
||||
_logger.printTrace(message.toString());
|
||||
_logger.printTrace(message);
|
||||
}
|
||||
_server.stdin.writeln(inputKey);
|
||||
_logger.printTrace('<- $inputKey');
|
||||
|
@ -86,7 +86,7 @@ class ProjectBaseConfigurationMigration extends ProjectMigrator {
|
||||
newProjectContents = newProjectContents.replaceAll(releaseBaseConfigurationOriginal, releaseBaseConfigurationReplacement);
|
||||
if (originalProjectContents != newProjectContents) {
|
||||
logger.printStatus('Project base configurations detected, removing.');
|
||||
_xcodeProjectInfoFile.writeAsStringSync(newProjectContents.toString());
|
||||
_xcodeProjectInfoFile.writeAsStringSync(newProjectContents);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ class SimControl {
|
||||
return <String, Map<String, dynamic>>{};
|
||||
}
|
||||
try {
|
||||
final Object decodeResult = json.decode(results.stdout?.toString())[section.name];
|
||||
final Object decodeResult = json.decode(results.stdout)[section.name];
|
||||
if (decodeResult is Map<String, dynamic>) {
|
||||
return decodeResult;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ class CmakeCustomCommandMigration extends ProjectMigrator {
|
||||
}
|
||||
if (originalProjectContents != newProjectContents) {
|
||||
logger.printStatus('add_custom_command() missing VERBATIM or FLUTTER_TARGET_PLATFORM, updating.');
|
||||
_cmakeFile.writeAsStringSync(newProjectContents.toString());
|
||||
_cmakeFile.writeAsStringSync(newProjectContents);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user