Revert string interp (#49602)

This commit is contained in:
Dan Field
2020-01-28 07:56:51 -08:00
committed by GitHub
parent bc5ea0a05a
commit fabeb2a16f
57 changed files with 88 additions and 80 deletions

View File

@@ -391,7 +391,7 @@ void _printBanner(String message) {
final String banner = '*** $message ***';
print('\n');
print('*' * banner.length);
print(banner);
print('$banner');
print('*' * banner.length);
print('\n');
}

View File

@@ -272,7 +272,7 @@ Future<bool> shell(String command, Directory directory, { bool verbose = false,
print('>> $command');
Process process;
if (Platform.isWindows) {
process = await Process.start('CMD.EXE', <String>['/S', '/C', command], workingDirectory: directory.path);
process = await Process.start('CMD.EXE', <String>['/S', '/C', '$command'], workingDirectory: directory.path);
} else {
final List<String> segments = command.trim().split(_spaces);
process = await Process.start(segments.first, segments.skip(1).toList(), workingDirectory: directory.path);

View File

@@ -51,7 +51,7 @@ void main() {
print('Extracted observatory port: $observatoryUri');
final Process attachProcess =
await _run(device: device, command: <String>['attach', '--debug-uri',
observatoryUri, '--isolate-filter', _kSecondIsolateName], stdoutListener: (String line) {
observatoryUri, '--isolate-filter', '$_kSecondIsolateName'], stdoutListener: (String line) {
if (line.contains(_kFirstIsolateName)) {
firstNameFound.complete();
} else if (line.contains(_kSecondIsolateName)) {

View File

@@ -2,18 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert' show utf8;
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
void main() {
Future<void> main() async {
const Text text = Text('Hello, world!', textDirection: TextDirection.ltr);
// These calls must not result in an error. They behave differently in
// release mode compared to debug or profile.
// The test will grep logcat for any errors emitted by Flutter.
print(text.toDiagnosticsNode());
print(text.toStringDeep());
// regression test for https://github.com/flutter/flutter/issues/49601
final List<int> computed = await compute(_utf8Encode, 'test', debugLabel: null);
print(computed);
runApp(
const Center(
child: text,
),
);
}
List<int> _utf8Encode(String data) {
return utf8.encode(data);
}

View File

@@ -246,7 +246,7 @@ class _OptionsState extends State<Options> {
),
),
Text(
widget.model.size.toStringAsFixed(3),
'${widget.model.size.toStringAsFixed(3)}',
style: TextStyle(color: Colors.grey[50]),
),
],
@@ -261,7 +261,7 @@ class _OptionsState extends State<Options> {
child: SliderTheme(
data: controlTheme,
child: Slider(
label: widget.model.density.horizontal.toStringAsFixed(1),
label: '${widget.model.density.horizontal.toStringAsFixed(1)}',
min: VisualDensity.minimumDensity,
max: VisualDensity.maximumDensity,
onChanged: (double value) {
@@ -272,7 +272,7 @@ class _OptionsState extends State<Options> {
),
),
Text(
widget.model.density.horizontal.toStringAsFixed(3),
'${widget.model.density.horizontal.toStringAsFixed(3)}',
style: TextStyle(color: Colors.grey[50]),
),
],
@@ -287,7 +287,7 @@ class _OptionsState extends State<Options> {
child: SliderTheme(
data: controlTheme,
child: Slider(
label: widget.model.density.vertical.toStringAsFixed(1),
label: '${widget.model.density.vertical.toStringAsFixed(1)}',
min: VisualDensity.minimumDensity,
max: VisualDensity.maximumDensity,
onChanged: (double value) {
@@ -298,7 +298,7 @@ class _OptionsState extends State<Options> {
),
),
Text(
widget.model.density.vertical.toStringAsFixed(3),
'${widget.model.density.vertical.toStringAsFixed(3)}',
style: TextStyle(color: Colors.grey[50]),
),
],

View File

@@ -25,7 +25,7 @@ class CodeGenerator {
currentLine += ' $word';
} else {
result.writeln('$prefix$currentLine');
currentLine = word;
currentLine = '$word';
}
}
if (currentLine.isNotEmpty) {

View File

@@ -339,7 +339,7 @@ String describeLocale(String tag) {
assert(subtags.isNotEmpty);
assert(_languages.containsKey(subtags[0]));
final String language = _languages[subtags[0]];
String output = language;
String output = '$language';
String region;
String script;
if (subtags.length == 2) {