diff --git a/dev/bots/unpublish_package.dart b/dev/bots/unpublish_package.dart index 5385ec2b22..581cd8f66c 100644 --- a/dev/bots/unpublish_package.dart +++ b/dev/bots/unpublish_package.dart @@ -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'); } diff --git a/dev/customer_testing/run_tests.dart b/dev/customer_testing/run_tests.dart index 4a662ba830..62133a4fd9 100644 --- a/dev/customer_testing/run_tests.dart +++ b/dev/customer_testing/run_tests.dart @@ -272,7 +272,7 @@ Future shell(String command, Directory directory, { bool verbose = false, print('>> $command'); Process process; if (Platform.isWindows) { - process = await Process.start('CMD.EXE', ['/S', '/C', command], workingDirectory: directory.path); + process = await Process.start('CMD.EXE', ['/S', '/C', '$command'], workingDirectory: directory.path); } else { final List segments = command.trim().split(_spaces); process = await Process.start(segments.first, segments.skip(1).toList(), workingDirectory: directory.path); diff --git a/dev/devicelab/bin/tasks/named_isolates_test.dart b/dev/devicelab/bin/tasks/named_isolates_test.dart index af0bf60446..acfa1cd9ad 100644 --- a/dev/devicelab/bin/tasks/named_isolates_test.dart +++ b/dev/devicelab/bin/tasks/named_isolates_test.dart @@ -51,7 +51,7 @@ void main() { print('Extracted observatory port: $observatoryUri'); final Process attachProcess = await _run(device: device, command: ['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)) { diff --git a/dev/integration_tests/release_smoke_test/lib/main.dart b/dev/integration_tests/release_smoke_test/lib/main.dart index d45b0470f4..c2106a00c9 100644 --- a/dev/integration_tests/release_smoke_test/lib/main.dart +++ b/dev/integration_tests/release_smoke_test/lib/main.dart @@ -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 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 computed = await compute(_utf8Encode, 'test', debugLabel: null); + print(computed); runApp( const Center( child: text, ), ); } + +List _utf8Encode(String data) { + return utf8.encode(data); +} diff --git a/dev/manual_tests/lib/density.dart b/dev/manual_tests/lib/density.dart index b49d4d42a9..6c94ffc74c 100644 --- a/dev/manual_tests/lib/density.dart +++ b/dev/manual_tests/lib/density.dart @@ -246,7 +246,7 @@ class _OptionsState extends State { ), ), 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 { 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 { ), ), 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 { 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 { ), ), Text( - widget.model.density.vertical.toStringAsFixed(3), + '${widget.model.density.vertical.toStringAsFixed(3)}', style: TextStyle(color: Colors.grey[50]), ), ], diff --git a/dev/tools/gen_keycodes/lib/code_gen.dart b/dev/tools/gen_keycodes/lib/code_gen.dart index 7d80476130..c7f006a18f 100644 --- a/dev/tools/gen_keycodes/lib/code_gen.dart +++ b/dev/tools/gen_keycodes/lib/code_gen.dart @@ -25,7 +25,7 @@ class CodeGenerator { currentLine += ' $word'; } else { result.writeln('$prefix$currentLine'); - currentLine = word; + currentLine = '$word'; } } if (currentLine.isNotEmpty) { diff --git a/dev/tools/localization/localizations_utils.dart b/dev/tools/localization/localizations_utils.dart index 4c0ae2c305..9813d4334e 100644 --- a/dev/tools/localization/localizations_utils.dart +++ b/dev/tools/localization/localizations_utils.dart @@ -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) { diff --git a/examples/catalog/bin/sample_page.dart b/examples/catalog/bin/sample_page.dart index 6e1ae655a3..852e7180af 100644 --- a/examples/catalog/bin/sample_page.dart +++ b/examples/catalog/bin/sample_page.dart @@ -202,7 +202,7 @@ void generate(String commit) { outputFile('${className}_index.md'), inputFile('bin', 'class_index.md.template').readAsStringSync(), { - 'class': className, + 'class': '$className', 'entries': entries.join('\n'), 'link': '${className}_index', }, diff --git a/examples/flutter_gallery/lib/demo/material/data_table_demo.dart b/examples/flutter_gallery/lib/demo/material/data_table_demo.dart index 507c181131..da59408583 100644 --- a/examples/flutter_gallery/lib/demo/material/data_table_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/data_table_demo.dart @@ -113,11 +113,11 @@ class DessertDataSource extends DataTableSource { } }, cells: [ - DataCell(Text(dessert.name)), + DataCell(Text('${dessert.name}')), DataCell(Text('${dessert.calories}')), - DataCell(Text(dessert.fat.toStringAsFixed(1))), + DataCell(Text('${dessert.fat.toStringAsFixed(1)}')), DataCell(Text('${dessert.carbs}')), - DataCell(Text(dessert.protein.toStringAsFixed(1))), + DataCell(Text('${dessert.protein.toStringAsFixed(1)}')), DataCell(Text('${dessert.sodium}')), DataCell(Text('${dessert.calcium}%')), DataCell(Text('${dessert.iron}%')), diff --git a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart index a3a6eeb54e..775a688215 100644 --- a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart @@ -83,7 +83,7 @@ class DateTimeItem extends StatelessWidget { }, child: Row( children: [ - Text(time.format(context)), + Text('${time.format(context)}'), const Icon(Icons.arrow_drop_down, color: Colors.black54), ], ), diff --git a/examples/flutter_gallery/lib/demo/material/tabs_demo.dart b/examples/flutter_gallery/lib/demo/material/tabs_demo.dart index 9cef2c057e..d1ec37526e 100644 --- a/examples/flutter_gallery/lib/demo/material/tabs_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/tabs_demo.dart @@ -113,7 +113,7 @@ class _CardDataItem extends StatelessWidget { alignment: page.id == 'H' ? Alignment.centerLeft : Alignment.centerRight, - child: CircleAvatar(child: Text(page.id)), + child: CircleAvatar(child: Text('${page.id}')), ), SizedBox( width: 144.0, diff --git a/examples/flutter_gallery/lib/gallery/options.dart b/examples/flutter_gallery/lib/gallery/options.dart index 0bb47657a3..a3b57c082b 100644 --- a/examples/flutter_gallery/lib/gallery/options.dart +++ b/examples/flutter_gallery/lib/gallery/options.dart @@ -231,7 +231,7 @@ class _ThemeModeItem extends StatelessWidget { children: [ const Text('Theme'), Text( - modeLabels[options.themeMode], + '${modeLabels[options.themeMode]}', style: Theme.of(context).primaryTextTheme.bodyText2, ), ], @@ -278,7 +278,7 @@ class _TextScaleFactorItem extends StatelessWidget { children: [ const Text('Text size'), Text( - options.textScaleFactor.label, + '${options.textScaleFactor.label}', style: Theme.of(context).primaryTextTheme.bodyText2, ), ], @@ -324,7 +324,7 @@ class _VisualDensityItem extends StatelessWidget { children: [ const Text('Visual density'), Text( - options.visualDensity.label, + '${options.visualDensity.label}', style: Theme.of(context).primaryTextTheme.bodyText2, ), ], @@ -431,7 +431,7 @@ class _PlatformItem extends StatelessWidget { children: [ const Text('Platform mechanics'), Text( - _platformLabel(options.platform), + '${_platformLabel(options.platform)}', style: Theme.of(context).primaryTextTheme.bodyText2, ), ], diff --git a/examples/stocks/lib/stock_symbol_viewer.dart b/examples/stocks/lib/stock_symbol_viewer.dart index 88a2f8efb0..e375ace165 100644 --- a/examples/stocks/lib/stock_symbol_viewer.dart +++ b/examples/stocks/lib/stock_symbol_viewer.dart @@ -29,7 +29,7 @@ class _StockSymbolView extends StatelessWidget { Row( children: [ Text( - stock.symbol, + '${stock.symbol}', key: ValueKey('${stock.symbol}_symbol_name'), style: Theme.of(context).textTheme.headline3, ), @@ -43,7 +43,7 @@ class _StockSymbolView extends StatelessWidget { height: 8.0 ), Text('Market Cap', style: headings), - Text(stock.marketCap), + Text('${stock.marketCap}'), Container( height: 8.0 ), diff --git a/packages/flutter/lib/src/animation/animation.dart b/packages/flutter/lib/src/animation/animation.dart index b1cfaa370e..9f6785528b 100644 --- a/packages/flutter/lib/src/animation/animation.dart +++ b/packages/flutter/lib/src/animation/animation.dart @@ -207,6 +207,6 @@ abstract class Animation extends Listenable implements ValueListenable { break; } assert(icon != null); - return icon; + return '$icon'; } } diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index 707ee10de3..6d52f1e49f 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -46,7 +46,7 @@ abstract class ParametricCurve { } @override - String toString() => objectRuntimeType(this, 'ParametricCurve'); + String toString() => '${objectRuntimeType(this, 'ParametricCurve')}'; } /// An parametric animation easing curve, i.e. a mapping of the unit interval to diff --git a/packages/flutter/lib/src/foundation/_isolates_io.dart b/packages/flutter/lib/src/foundation/_isolates_io.dart index 37e3265cb7..6c652645cf 100644 --- a/packages/flutter/lib/src/foundation/_isolates_io.dart +++ b/packages/flutter/lib/src/foundation/_isolates_io.dart @@ -80,7 +80,7 @@ class _IsolateConfiguration { Future _spawn(_IsolateConfiguration> configuration) async { R result; await Timeline.timeSync( - configuration.debugLabel, + '${configuration.debugLabel}', () async { final FutureOr applicationResult = await configuration.apply(); result = await applicationResult; diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index 34a9c54bb7..9154267469 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.dart @@ -381,7 +381,7 @@ class FlutterErrorDetails extends Diagnosticable { debugFillProperties(builder); summary = builder.properties.firstWhere((DiagnosticsNode node) => node.level == DiagnosticLevel.summary, orElse: () => null); } - return summary ?? ErrorSummary(formatException()); + return summary ?? ErrorSummary('${formatException()}'); } @override @@ -415,7 +415,7 @@ class FlutterErrorDetails extends Diagnosticable { String message = exceptionAsString(); if (message.startsWith(prefix)) message = message.substring(prefix.length); - properties.add(ErrorSummary(message)); + properties.add(ErrorSummary('$message')); } } diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart index 56355581d1..118e1d071f 100644 --- a/packages/flutter/lib/src/foundation/diagnostics.dart +++ b/packages/flutter/lib/src/foundation/diagnostics.dart @@ -1277,7 +1277,7 @@ class TextTreeRenderer { // with cases where a single line properties output may not have single // linebreak. final String propertyRender = render(property, - prefixLineOne: propertyStyle.prefixLineOne, + prefixLineOne: '${propertyStyle.prefixLineOne}', prefixOtherLines: '${propertyStyle.childLinkSpace}${propertyStyle.prefixOtherLines}', parentConfiguration: config, ); @@ -1306,7 +1306,7 @@ class TextTreeRenderer { if (!config.lineBreakProperties) builder.write(config.lineBreak); - final String prefixChildren = config.bodyIndent; + final String prefixChildren = '${config.bodyIndent}'; final String prefixChildrenRaw = '$prefixOtherLines$prefixChildren'; if (children.isEmpty && config.addBlankLineIfNoChildren && diff --git a/packages/flutter/lib/src/gestures/mouse_tracking.dart b/packages/flutter/lib/src/gestures/mouse_tracking.dart index 0094ce8217..871e3ad1fb 100644 --- a/packages/flutter/lib/src/gestures/mouse_tracking.dart +++ b/packages/flutter/lib/src/gestures/mouse_tracking.dart @@ -174,7 +174,7 @@ class _MouseState { @override String toString() { String describeEvent(PointerEvent event) { - return event == null ? 'null' : describeIdentity(event); + return event == null ? 'null' : '${describeIdentity(event)}'; } final String describeLatestEvent = 'latestEvent: ${describeEvent(latestEvent)}'; final String describeAnnotations = 'annotations: [list of ${annotations.length}]'; diff --git a/packages/flutter/lib/src/material/floating_action_button_location.dart b/packages/flutter/lib/src/material/floating_action_button_location.dart index fd1ec08503..533eaf2aa3 100644 --- a/packages/flutter/lib/src/material/floating_action_button_location.dart +++ b/packages/flutter/lib/src/material/floating_action_button_location.dart @@ -122,7 +122,7 @@ abstract class FloatingActionButtonLocation { Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry); @override - String toString() => objectRuntimeType(this, 'FloatingActionButtonLocation'); + String toString() => '${objectRuntimeType(this, 'FloatingActionButtonLocation')}'; } double _leftOffset(ScaffoldPrelayoutGeometry scaffoldGeometry, { double offset = 0.0 }) { @@ -407,7 +407,7 @@ abstract class FloatingActionButtonAnimator { double getAnimationRestart(double previousValue) => 0.0; @override - String toString() => objectRuntimeType(this, 'FloatingActionButtonAnimator'); + String toString() => '${objectRuntimeType(this, 'FloatingActionButtonAnimator')}'; } class _ScalingFabMotionAnimator extends FloatingActionButtonAnimator { diff --git a/packages/flutter/lib/src/painting/decoration.dart b/packages/flutter/lib/src/painting/decoration.dart index a629ce7b39..03e665a311 100644 --- a/packages/flutter/lib/src/painting/decoration.dart +++ b/packages/flutter/lib/src/painting/decoration.dart @@ -26,7 +26,7 @@ abstract class Decoration extends Diagnosticable { const Decoration(); @override - String toStringShort() => objectRuntimeType(this, 'Decoration'); + String toStringShort() => '${objectRuntimeType(this, 'Decoration')}'; /// In checked mode, throws an exception if the object is not in a /// valid configuration. Otherwise, returns true. diff --git a/packages/flutter/lib/src/painting/strut_style.dart b/packages/flutter/lib/src/painting/strut_style.dart index 2cd5b3e8f3..66f71860bd 100644 --- a/packages/flutter/lib/src/painting/strut_style.dart +++ b/packages/flutter/lib/src/painting/strut_style.dart @@ -571,7 +571,7 @@ class StrutStyle extends Diagnosticable { } @override - String toStringShort() => objectRuntimeType(this, 'StrutStyle'); + String toStringShort() => '${objectRuntimeType(this, 'StrutStyle')}'; /// Adds all properties prefixing property names with the optional `prefix`. @override diff --git a/packages/flutter/lib/src/painting/text_span.dart b/packages/flutter/lib/src/painting/text_span.dart index 2387294203..a174b4c8cd 100644 --- a/packages/flutter/lib/src/painting/text_span.dart +++ b/packages/flutter/lib/src/painting/text_span.dart @@ -440,7 +440,7 @@ class TextSpan extends InlineSpan { ); @override - String toStringShort() => objectRuntimeType(this, 'TextSpan'); + String toStringShort() => '${objectRuntimeType(this, 'TextSpan')}'; @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index f84063f2b0..be50003f0c 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -1195,7 +1195,7 @@ class TextStyle extends Diagnosticable { } @override - String toStringShort() => objectRuntimeType(this, 'TextStyle'); + String toStringShort() => '${objectRuntimeType(this, 'TextStyle')}'; /// Adds all properties prefixing property names with the optional `prefix`. @override diff --git a/packages/flutter/lib/src/physics/simulation.dart b/packages/flutter/lib/src/physics/simulation.dart index fc6732185e..9a9f665291 100644 --- a/packages/flutter/lib/src/physics/simulation.dart +++ b/packages/flutter/lib/src/physics/simulation.dart @@ -54,5 +54,5 @@ abstract class Simulation { Tolerance tolerance; @override - String toString() => objectRuntimeType(this, 'Simulation'); + String toString() => '${objectRuntimeType(this, 'Simulation')}'; } diff --git a/packages/flutter/lib/src/rendering/custom_layout.dart b/packages/flutter/lib/src/rendering/custom_layout.dart index 71dd11277d..af8ee03478 100644 --- a/packages/flutter/lib/src/rendering/custom_layout.dart +++ b/packages/flutter/lib/src/rendering/custom_layout.dart @@ -294,7 +294,7 @@ abstract class MultiChildLayoutDelegate { /// /// By default, returns the [runtimeType] of the class. @override - String toString() => objectRuntimeType(this, 'MultiChildLayoutDelegate'); + String toString() => '${objectRuntimeType(this, 'MultiChildLayoutDelegate')}'; } /// Defers the layout of multiple children to a delegate. diff --git a/packages/flutter/lib/src/rendering/flow.dart b/packages/flutter/lib/src/rendering/flow.dart index 15b1447931..dcc9d53090 100644 --- a/packages/flutter/lib/src/rendering/flow.dart +++ b/packages/flutter/lib/src/rendering/flow.dart @@ -132,7 +132,7 @@ abstract class FlowDelegate { /// /// By default, returns the [runtimeType] of the class. @override - String toString() => objectRuntimeType(this, 'FlowDelegate'); + String toString() => '${objectRuntimeType(this, 'FlowDelegate')}'; } /// Parent data for use with [RenderFlow]. diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index 855306442e..afa7b563aa 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -1138,7 +1138,7 @@ abstract class CustomClipper { bool shouldReclip(covariant CustomClipper oldClipper); @override - String toString() => objectRuntimeType(this, 'CustomClipper'); + String toString() => '${objectRuntimeType(this, 'CustomClipper')}'; } /// A [CustomClipper] that clips to the outer path of a [ShapeBorder]. diff --git a/packages/flutter/lib/src/rendering/sliver.dart b/packages/flutter/lib/src/rendering/sliver.dart index bd3be14ced..d56720c96b 100644 --- a/packages/flutter/lib/src/rendering/sliver.dart +++ b/packages/flutter/lib/src/rendering/sliver.dart @@ -759,7 +759,7 @@ class SliverGeometry extends Diagnosticable { } @override - String toStringShort() => objectRuntimeType(this, 'SliverGeometry'); + String toStringShort() => '${objectRuntimeType(this, 'SliverGeometry')}'; @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { diff --git a/packages/flutter/lib/src/rendering/table.dart b/packages/flutter/lib/src/rendering/table.dart index f627f952e0..b7ca6c4057 100644 --- a/packages/flutter/lib/src/rendering/table.dart +++ b/packages/flutter/lib/src/rendering/table.dart @@ -76,7 +76,7 @@ abstract class TableColumnWidth { double flex(Iterable cells) => null; @override - String toString() => objectRuntimeType(this, 'TableColumnWidth'); + String toString() => '${objectRuntimeType(this, 'TableColumnWidth')}'; } /// Sizes the column according to the intrinsic dimensions of all the diff --git a/packages/flutter/lib/src/semantics/semantics.dart b/packages/flutter/lib/src/semantics/semantics.dart index 148a473aa8..495b4ae250 100644 --- a/packages/flutter/lib/src/semantics/semantics.dart +++ b/packages/flutter/lib/src/semantics/semantics.dart @@ -376,7 +376,7 @@ class SemanticsData extends Diagnosticable { bool hasAction(SemanticsAction action) => (actions & action.index) != 0; @override - String toStringShort() => objectRuntimeType(this, 'SemanticsData'); + String toStringShort() => '${objectRuntimeType(this, 'SemanticsData')}'; @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { @@ -1150,7 +1150,7 @@ class SemanticsProperties extends DiagnosticableTree { } @override - String toStringShort() => objectRuntimeType(this, 'SemanticsProperties'); // the hashCode isn't important since we're immutable + String toStringShort() => '${objectRuntimeType(this, 'SemanticsProperties')}'; // the hashCode isn't important since we're immutable } /// In tests use this function to reset the counter used to generate diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 56981dafcf..4ea531b311 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -2099,9 +2099,9 @@ class SizedBox extends SingleChildRenderObjectWidget { } else if (width == 0.0 && height == 0.0) { type = '${objectRuntimeType(this, 'SizedBox')}.shrink'; } else { - type = objectRuntimeType(this, 'SizedBox'); + type = '${objectRuntimeType(this, 'SizedBox')}'; } - return key == null ? type : '$type-$key'; + return key == null ? '$type' : '$type-$key'; } @override diff --git a/packages/flutter/lib/src/widgets/debug.dart b/packages/flutter/lib/src/widgets/debug.dart index e61374721e..79a8746fe9 100644 --- a/packages/flutter/lib/src/widgets/debug.dart +++ b/packages/flutter/lib/src/widgets/debug.dart @@ -315,7 +315,7 @@ bool debugAssertAllWidgetVarsUnset(String reason) { debugPrintGlobalKeyedWidgetLifecycle || debugProfileBuildsEnabled || debugHighlightDeprecatedWidgets) { - throw FlutterError.fromParts([ErrorSummary(reason)]); + throw FlutterError.fromParts([ErrorSummary('$reason')]); } return true; }()); diff --git a/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart b/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart index 753496495d..71d3b29d11 100644 --- a/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart +++ b/packages/flutter/lib/src/widgets/draggable_scrollable_sheet.dart @@ -476,7 +476,7 @@ class _DraggableScrollableSheetScrollPosition ); final AnimationController ballisticController = AnimationController.unbounded( - debugLabel: objectRuntimeType(this, '_DraggableScrollableSheetPosition'), + debugLabel: '${objectRuntimeType(this, '_DraggableScrollableSheetPosition')}', vsync: context.vsync, ); double lastDelta = 0; diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 3b6ef7de97..f63eb78a43 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -442,8 +442,7 @@ abstract class Widget extends DiagnosticableTree { /// A short, textual description of this widget. @override String toStringShort() { - final String type = objectRuntimeType(this, 'Widget'); - return key == null ? type : '$type-$key'; + return key == null ? '${objectRuntimeType(this, 'Widget')}' : '${objectRuntimeType(this, 'Widget')}-$key'; } @override @@ -3897,7 +3896,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { /// A short, textual description of this element. @override String toStringShort() { - return widget != null ? widget.toStringShort() : '[${objectRuntimeType(this, 'Element')}]'; + return widget != null ? '${widget.toStringShort()}' : '[${objectRuntimeType(this, 'Element')}]'; } @override diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index a6ba5360d5..efd31e1da2 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -360,7 +360,7 @@ abstract class ImplicitlyAnimatedWidgetState super.initState(); _controller = AnimationController( duration: widget.duration, - debugLabel: kDebugMode ? widget.toStringShort() : null, + debugLabel: kDebugMode ? '${widget.toStringShort()}' : null, vsync: this, ); _controller.addStatusListener((AnimationStatus status) { diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index c959b525a2..e0e5073991 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -354,7 +354,7 @@ abstract class TransitionRoute extends OverlayRoute { } /// A short description of this route useful for debugging. - String get debugLabel => objectRuntimeType(this, 'TransitionRoute'); + String get debugLabel => '${objectRuntimeType(this, 'TransitionRoute')}'; @override String toString() => '${objectRuntimeType(this, 'TransitionRoute')}(animation: $_controller)'; diff --git a/packages/flutter/lib/src/widgets/scroll_activity.dart b/packages/flutter/lib/src/widgets/scroll_activity.dart index 0ce728c430..3487ecf4dc 100644 --- a/packages/flutter/lib/src/widgets/scroll_activity.dart +++ b/packages/flutter/lib/src/widgets/scroll_activity.dart @@ -507,7 +507,7 @@ class BallisticScrollActivity extends ScrollActivity { TickerProvider vsync, ) : super(delegate) { _controller = AnimationController.unbounded( - debugLabel: kDebugMode ? objectRuntimeType(this, 'BallisticScrollActivity') : null, + debugLabel: kDebugMode ? '${objectRuntimeType(this, 'BallisticScrollActivity')}' : null, vsync: vsync, ) ..addListener(_tick) @@ -604,7 +604,7 @@ class DrivenScrollActivity extends ScrollActivity { _completer = Completer(); _controller = AnimationController.unbounded( value: from, - debugLabel: objectRuntimeType(this, 'DrivenScrollActivity'), + debugLabel: '${objectRuntimeType(this, 'DrivenScrollActivity')}', vsync: vsync, ) ..addListener(_tick) diff --git a/packages/flutter/lib/src/widgets/scroll_configuration.dart b/packages/flutter/lib/src/widgets/scroll_configuration.dart index f295b18a59..a3e0d3ea2d 100644 --- a/packages/flutter/lib/src/widgets/scroll_configuration.dart +++ b/packages/flutter/lib/src/widgets/scroll_configuration.dart @@ -77,7 +77,7 @@ class ScrollBehavior { bool shouldNotify(covariant ScrollBehavior oldDelegate) => false; @override - String toString() => objectRuntimeType(this, 'ScrollBehavior'); + String toString() => '${objectRuntimeType(this, 'ScrollBehavior')}'; } /// Controls how [Scrollable] widgets behave in a subtree. diff --git a/packages/flutter/lib/src/widgets/shortcuts.dart b/packages/flutter/lib/src/widgets/shortcuts.dart index 720b6e6d1d..44caef6279 100644 --- a/packages/flutter/lib/src/widgets/shortcuts.dart +++ b/packages/flutter/lib/src/widgets/shortcuts.dart @@ -156,7 +156,7 @@ class LogicalKeySet extends KeySet with DiagnosticableMixin return a.debugName.compareTo(b.debugName); } ); - return sortedKeys.map((LogicalKeyboardKey key) => key.debugName).join(' + '); + return sortedKeys.map((LogicalKeyboardKey key) => '${key.debugName}').join(' + '); } @override diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index 7c71c25679..e474a40665 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -378,7 +378,7 @@ void main() { data: sliderTheme, child: Slider( value: sliderValue, - label: value, + label: '$value', divisions: 3, onChanged: (double d) { }, ), diff --git a/packages/flutter/test/widgets/semantics_tester.dart b/packages/flutter/test/widgets/semantics_tester.dart index fd66cf7aea..dc3d2e71ee 100644 --- a/packages/flutter/test/widgets/semantics_tester.dart +++ b/packages/flutter/test/widgets/semantics_tester.dart @@ -259,7 +259,7 @@ class TestSemantics { DebugSemanticsDumpOrder childOrder = DebugSemanticsDumpOrder.inverseHitTest, }) { bool fail(String message) { - matchState[TestSemantics] = message; + matchState[TestSemantics] = '$message'; return false; } diff --git a/packages/flutter_localizations/test/material/date_picker_test.dart b/packages/flutter_localizations/test/material/date_picker_test.dart index 3b54198e0d..3563f17455 100644 --- a/packages/flutter_localizations/test/material/date_picker_test.dart +++ b/packages/flutter_localizations/test/material/date_picker_test.dart @@ -46,7 +46,7 @@ void main() { const Locale('ar', 'AR'): { 'textDirection': TextDirection.rtl, 'expectedDaysOfWeek': ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - 'expectedDaysOfMonth': List.generate(30, (int i) => arabicNumbers.format(i + 1)), + 'expectedDaysOfMonth': List.generate(30, (int i) => '${arabicNumbers.format(i + 1)}'), 'expectedMonthYearHeader': 'سبتمبر ٢٠١٧', }, }; diff --git a/packages/flutter_test/lib/src/test_async_utils.dart b/packages/flutter_test/lib/src/test_async_utils.dart index 219497df62..cd99756cb9 100644 --- a/packages/flutter_test/lib/src/test_async_utils.dart +++ b/packages/flutter_test/lib/src/test_async_utils.dart @@ -344,14 +344,14 @@ class TestAsyncUtils { // a 'dart:' API, like from the Future/microtask mechanism, because dart: URLs in the // stack trace don't have a column number and so don't match the regexp above. information.add(ErrorSummary('(Unable to parse the stack frame of the method that called the method that called $_className.$method(). The stack may be incomplete or bogus.)')); - information.add(ErrorDescription(stack[index])); + information.add(ErrorDescription('${stack[index]}')); } } else { information.add(ErrorSummary('(Unable to find the stack frame of the method that called the method that called $_className.$method(). The stack may be incomplete or bogus.)')); } } else { information.add(ErrorSummary('(Unable to parse the stack frame of the method that called $_className.$method(). The stack may be incomplete or bogus.)')); - information.add(ErrorDescription(stack[index])); + information.add(ErrorDescription('${stack[index]}')); } } else { information.add(ErrorSummary('(Unable to find the method that called $_className.$method(). The stack may be incomplete or bogus.)')); diff --git a/packages/flutter_tools/lib/src/android/android_studio.dart b/packages/flutter_tools/lib/src/android/android_studio.dart index 65cb3e9e3c..f7ebfb4287 100644 --- a/packages/flutter_tools/lib/src/android/android_studio.dart +++ b/packages/flutter_tools/lib/src/android/android_studio.dart @@ -68,7 +68,7 @@ class AndroidStudio implements Comparable { } final String presetPluginsPath = pathsSelectorValue == null ? null - : globals.fs.path.join(homeDirPath, 'Library', 'Application Support', pathsSelectorValue); + : globals.fs.path.join(homeDirPath, 'Library', 'Application Support', '$pathsSelectorValue'); return AndroidStudio(studioPath, version: version, presetPluginsPath: presetPluginsPath); } diff --git a/packages/flutter_tools/lib/src/build_runner/web_fs.dart b/packages/flutter_tools/lib/src/build_runner/web_fs.dart index 443cab3673..977f545ea5 100644 --- a/packages/flutter_tools/lib/src/build_runner/web_fs.dart +++ b/packages/flutter_tools/lib/src/build_runner/web_fs.dart @@ -455,7 +455,7 @@ class DebugAssetServer extends AssetServer { flutterProject.dartTool.path, 'build', 'flutter_web', - flutterProject.manifest.appName, + '${flutterProject.manifest.appName}', 'lib', '${targetBaseName}_web_entrypoint.dart.js.tar.gz', )); diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index ef963235cc..7151899387 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart @@ -580,7 +580,7 @@ abstract class CachedArtifact extends ArtifactSet { /// Download an archive from the given [url] and unzip it to [location]. Future _downloadArchive(String message, Uri url, Directory location, bool verifier(File f), void extractor(File f, Directory d)) { - return _withDownloadFile(flattenNameSubdirs(url), (File tempFile) async { + return _withDownloadFile('${flattenNameSubdirs(url)}', (File tempFile) async { if (!verifier(tempFile)) { final Status status = globals.logger.startProgress(message, timeout: timeoutConfiguration.slowOperation); try { diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index 30d01e4b25..9b3a170529 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -382,7 +382,7 @@ class UpdatePackagesCommand extends FlutterCommand { for (_DependencyLink path in paths) { final StringBuffer buf = StringBuffer(); while (path != null) { - buf.write(path.to); + buf.write('${path.to}'); path = path.from; if (path != null) { buf.write(' <- '); diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index c00182118a..cbd4dd4689 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -605,9 +605,8 @@ class DefaultResidentCompiler implements ResidentCompiler { _server.stdin.writeln('recompile $mainUri$inputKey'); globals.printTrace('<- recompile $mainUri$inputKey'); for (final Uri fileUri in request.invalidatedFiles) { - final String message = _mapFileUri(fileUri.toString(), packageUriMapper); - _server.stdin.writeln(message); - globals.printTrace(message); + _server.stdin.writeln(_mapFileUri(fileUri.toString(), packageUriMapper)); + globals.printTrace('${_mapFileUri(fileUri.toString(), packageUriMapper)}'); } _server.stdin.writeln(inputKey); globals.printTrace('<- $inputKey'); diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index b1805b961e..debd75a5b5 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -468,7 +468,7 @@ abstract class Device { table.add([ device.name, device.id, - getNameForTargetPlatform(targetPlatform), + '${getNameForTargetPlatform(targetPlatform)}', '${await device.sdkNameAndVersion}$supportIndicator', ]); } diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index e92c05e25d..c9b4341289 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -50,7 +50,7 @@ class IOSDeploy { '--justlaunch', if (launchArguments.isNotEmpty) ...[ '--args', - launchArguments.join(' '), + '${launchArguments.join(" ")}', ], ]; diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index 1fd62bbc81..977a1e50e2 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -473,7 +473,7 @@ Future buildXcodeProject({ initialBuildStatus = null; globals.printStatus( 'Xcode build done.'.padRight(kDefaultStatusPadding + 1) - + getElapsedAsSeconds(sw.elapsed).padLeft(5), + + '${getElapsedAsSeconds(sw.elapsed).padLeft(5)}', ); flutterUsage.sendTiming('build', 'xcode-ios', Duration(milliseconds: sw.elapsedMilliseconds)); diff --git a/packages/flutter_tools/lib/src/macos/build_macos.dart b/packages/flutter_tools/lib/src/macos/build_macos.dart index 0e560ee744..a18fd1b2a8 100644 --- a/packages/flutter_tools/lib/src/macos/build_macos.dart +++ b/packages/flutter_tools/lib/src/macos/build_macos.dart @@ -79,7 +79,7 @@ Future buildMacOS({ 'xcrun', 'xcodebuild', '-workspace', flutterProject.macos.xcodeWorkspace.path, - '-configuration', configuration, + '-configuration', '$configuration', '-scheme', 'Runner', '-derivedDataPath', flutterBuildDir.absolute.path, 'OBJROOT=${globals.fs.path.join(flutterBuildDir.absolute.path, 'Build', 'Intermediates.noindex')}', diff --git a/packages/flutter_tools/lib/src/reporting/events.dart b/packages/flutter_tools/lib/src/reporting/events.dart index 3bf813905f..626629c4b6 100644 --- a/packages/flutter_tools/lib/src/reporting/events.dart +++ b/packages/flutter_tools/lib/src/reporting/events.dart @@ -139,9 +139,9 @@ class BuildEvent extends UsageEvent { // category 'build', // parameter - FlutterCommand.current == null - ? 'unspecified' - : FlutterCommand.current.name, + FlutterCommand.current == null ? + 'unspecified' : + '${FlutterCommand.current.name}', label: label, ); diff --git a/packages/flutter_tools/lib/src/test/test_compiler.dart b/packages/flutter_tools/lib/src/test/test_compiler.dart index a876544c02..30e90970c9 100644 --- a/packages/flutter_tools/lib/src/test/test_compiler.dart +++ b/packages/flutter_tools/lib/src/test/test_compiler.dart @@ -186,6 +186,6 @@ class TestCompiler { _suppressOutput = true; return; } - globals.printError(message); + globals.printError('$message'); } } diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart index f7d7912f65..9daa2c56d1 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart @@ -115,7 +115,7 @@ void main() { }); await const DebugUnpackMacOS().build(environment); - expect(globals.fs.directory(_kOutputPrefix).existsSync(), true); + expect(globals.fs.directory('$_kOutputPrefix').existsSync(), true); for (final File file in inputs) { expect(globals.fs.file(file.path.replaceFirst(_kInputPrefix, _kOutputPrefix)).existsSync(), true); } diff --git a/packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart b/packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart index bb6104f2d4..a5a6460f7a 100644 --- a/packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/runner/flutter_command_runner_test.dart @@ -107,7 +107,7 @@ void main() { await runner.run(['dummy', '--local-engine=ios_debug']); // Verify that this also works if the sky_engine path is a symlink to the engine root. - fs.link('/symlink').createSync(_kArbitraryEngineRoot); + fs.link('/symlink').createSync('$_kArbitraryEngineRoot'); fs.file(_kDotPackages).writeAsStringSync('sky_engine:file:///symlink/src/out/ios_debug/gen/dart-pkg/sky_engine/lib/'); await runner.run(['dummy', '--local-engine=ios_debug']); }, overrides: {