Skip to content

Commit fabeb2a

Browse files
authored
Revert string interp (#49602)
1 parent bc5ea0a commit fabeb2a

File tree

57 files changed

+88
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+88
-80
lines changed

dev/bots/unpublish_package.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ void _printBanner(String message) {
391391
final String banner = '*** $message ***';
392392
print('\n');
393393
print('*' * banner.length);
394-
print(banner);
394+
print('$banner');
395395
print('*' * banner.length);
396396
print('\n');
397397
}

dev/customer_testing/run_tests.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ Future<bool> shell(String command, Directory directory, { bool verbose = false,
272272
print('>> $command');
273273
Process process;
274274
if (Platform.isWindows) {
275-
process = await Process.start('CMD.EXE', <String>['/S', '/C', command], workingDirectory: directory.path);
275+
process = await Process.start('CMD.EXE', <String>['/S', '/C', '$command'], workingDirectory: directory.path);
276276
} else {
277277
final List<String> segments = command.trim().split(_spaces);
278278
process = await Process.start(segments.first, segments.skip(1).toList(), workingDirectory: directory.path);

dev/devicelab/bin/tasks/named_isolates_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void main() {
5151
print('Extracted observatory port: $observatoryUri');
5252
final Process attachProcess =
5353
await _run(device: device, command: <String>['attach', '--debug-uri',
54-
observatoryUri, '--isolate-filter', _kSecondIsolateName], stdoutListener: (String line) {
54+
observatoryUri, '--isolate-filter', '$_kSecondIsolateName'], stdoutListener: (String line) {
5555
if (line.contains(_kFirstIsolateName)) {
5656
firstNameFound.complete();
5757
} else if (line.contains(_kSecondIsolateName)) {

dev/integration_tests/release_smoke_test/lib/main.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,28 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import 'dart:convert' show utf8;
6+
7+
import 'package:flutter/foundation.dart';
58
import 'package:flutter/widgets.dart';
69

7-
void main() {
10+
Future<void> main() async {
811
const Text text = Text('Hello, world!', textDirection: TextDirection.ltr);
912
// These calls must not result in an error. They behave differently in
1013
// release mode compared to debug or profile.
1114
// The test will grep logcat for any errors emitted by Flutter.
1215
print(text.toDiagnosticsNode());
1316
print(text.toStringDeep());
17+
// regression test for https://github.com/flutter/flutter/issues/49601
18+
final List<int> computed = await compute(_utf8Encode, 'test', debugLabel: null);
19+
print(computed);
1420
runApp(
1521
const Center(
1622
child: text,
1723
),
1824
);
1925
}
26+
27+
List<int> _utf8Encode(String data) {
28+
return utf8.encode(data);
29+
}

dev/manual_tests/lib/density.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class _OptionsState extends State<Options> {
246246
),
247247
),
248248
Text(
249-
widget.model.size.toStringAsFixed(3),
249+
'${widget.model.size.toStringAsFixed(3)}',
250250
style: TextStyle(color: Colors.grey[50]),
251251
),
252252
],
@@ -261,7 +261,7 @@ class _OptionsState extends State<Options> {
261261
child: SliderTheme(
262262
data: controlTheme,
263263
child: Slider(
264-
label: widget.model.density.horizontal.toStringAsFixed(1),
264+
label: '${widget.model.density.horizontal.toStringAsFixed(1)}',
265265
min: VisualDensity.minimumDensity,
266266
max: VisualDensity.maximumDensity,
267267
onChanged: (double value) {
@@ -272,7 +272,7 @@ class _OptionsState extends State<Options> {
272272
),
273273
),
274274
Text(
275-
widget.model.density.horizontal.toStringAsFixed(3),
275+
'${widget.model.density.horizontal.toStringAsFixed(3)}',
276276
style: TextStyle(color: Colors.grey[50]),
277277
),
278278
],
@@ -287,7 +287,7 @@ class _OptionsState extends State<Options> {
287287
child: SliderTheme(
288288
data: controlTheme,
289289
child: Slider(
290-
label: widget.model.density.vertical.toStringAsFixed(1),
290+
label: '${widget.model.density.vertical.toStringAsFixed(1)}',
291291
min: VisualDensity.minimumDensity,
292292
max: VisualDensity.maximumDensity,
293293
onChanged: (double value) {
@@ -298,7 +298,7 @@ class _OptionsState extends State<Options> {
298298
),
299299
),
300300
Text(
301-
widget.model.density.vertical.toStringAsFixed(3),
301+
'${widget.model.density.vertical.toStringAsFixed(3)}',
302302
style: TextStyle(color: Colors.grey[50]),
303303
),
304304
],

dev/tools/gen_keycodes/lib/code_gen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CodeGenerator {
2525
currentLine += ' $word';
2626
} else {
2727
result.writeln('$prefix$currentLine');
28-
currentLine = word;
28+
currentLine = '$word';
2929
}
3030
}
3131
if (currentLine.isNotEmpty) {

dev/tools/localization/localizations_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ String describeLocale(String tag) {
339339
assert(subtags.isNotEmpty);
340340
assert(_languages.containsKey(subtags[0]));
341341
final String language = _languages[subtags[0]];
342-
String output = language;
342+
String output = '$language';
343343
String region;
344344
String script;
345345
if (subtags.length == 2) {

examples/catalog/bin/sample_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void generate(String commit) {
202202
outputFile('${className}_index.md'),
203203
inputFile('bin', 'class_index.md.template').readAsStringSync(),
204204
<String, String>{
205-
'class': className,
205+
'class': '$className',
206206
'entries': entries.join('\n'),
207207
'link': '${className}_index',
208208
},

examples/flutter_gallery/lib/demo/material/data_table_demo.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ class DessertDataSource extends DataTableSource {
113113
}
114114
},
115115
cells: <DataCell>[
116-
DataCell(Text(dessert.name)),
116+
DataCell(Text('${dessert.name}')),
117117
DataCell(Text('${dessert.calories}')),
118-
DataCell(Text(dessert.fat.toStringAsFixed(1))),
118+
DataCell(Text('${dessert.fat.toStringAsFixed(1)}')),
119119
DataCell(Text('${dessert.carbs}')),
120-
DataCell(Text(dessert.protein.toStringAsFixed(1))),
120+
DataCell(Text('${dessert.protein.toStringAsFixed(1)}')),
121121
DataCell(Text('${dessert.sodium}')),
122122
DataCell(Text('${dessert.calcium}%')),
123123
DataCell(Text('${dessert.iron}%')),

examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class DateTimeItem extends StatelessWidget {
8383
},
8484
child: Row(
8585
children: <Widget>[
86-
Text(time.format(context)),
86+
Text('${time.format(context)}'),
8787
const Icon(Icons.arrow_drop_down, color: Colors.black54),
8888
],
8989
),

0 commit comments

Comments
 (0)