remove unnecessary string interpolations (#49352)
diff --git a/dev/bots/unpublish_package.dart b/dev/bots/unpublish_package.dart
index 581cd8f..5385ec2 100644
--- a/dev/bots/unpublish_package.dart
+++ b/dev/bots/unpublish_package.dart
@@ -391,7 +391,7 @@
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 62133a4..4a662ba 100644
--- a/dev/customer_testing/run_tests.dart
+++ b/dev/customer_testing/run_tests.dart
@@ -272,7 +272,7 @@
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);
diff --git a/dev/devicelab/bin/tasks/named_isolates_test.dart b/dev/devicelab/bin/tasks/named_isolates_test.dart
index ff2feb6..cc22801 100644
--- a/dev/devicelab/bin/tasks/named_isolates_test.dart
+++ b/dev/devicelab/bin/tasks/named_isolates_test.dart
@@ -51,7 +51,7 @@
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)) {
diff --git a/dev/manual_tests/lib/density.dart b/dev/manual_tests/lib/density.dart
index 6c94ffc..b49d4d4 100644
--- a/dev/manual_tests/lib/density.dart
+++ b/dev/manual_tests/lib/density.dart
@@ -246,7 +246,7 @@
),
),
Text(
- '${widget.model.size.toStringAsFixed(3)}',
+ widget.model.size.toStringAsFixed(3),
style: TextStyle(color: Colors.grey[50]),
),
],
@@ -261,7 +261,7 @@
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 @@
),
),
Text(
- '${widget.model.density.horizontal.toStringAsFixed(3)}',
+ widget.model.density.horizontal.toStringAsFixed(3),
style: TextStyle(color: Colors.grey[50]),
),
],
@@ -287,7 +287,7 @@
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 @@
),
),
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 c7f006a..7d80476 100644
--- a/dev/tools/gen_keycodes/lib/code_gen.dart
+++ b/dev/tools/gen_keycodes/lib/code_gen.dart
@@ -25,7 +25,7 @@
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 9813d43..4c0ae2c 100644
--- a/dev/tools/localization/localizations_utils.dart
+++ b/dev/tools/localization/localizations_utils.dart
@@ -339,7 +339,7 @@
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 852e718..6e1ae65 100644
--- a/examples/catalog/bin/sample_page.dart
+++ b/examples/catalog/bin/sample_page.dart
@@ -202,7 +202,7 @@
outputFile('${className}_index.md'),
inputFile('bin', 'class_index.md.template').readAsStringSync(),
<String, String>{
- '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 da59408..507c181 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 @@
}
},
cells: <DataCell>[
- 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 cc73276..fc3ac59 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 @@
},
child: Row(
children: <Widget>[
- 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 13cfa8b..d0c005f 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 @@
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 c6dfac6..36e10da 100644
--- a/examples/flutter_gallery/lib/gallery/options.dart
+++ b/examples/flutter_gallery/lib/gallery/options.dart
@@ -231,7 +231,7 @@
children: <Widget>[
const Text('Theme'),
Text(
- '${modeLabels[options.themeMode]}',
+ modeLabels[options.themeMode],
style: Theme.of(context).primaryTextTheme.body1,
),
],
@@ -278,7 +278,7 @@
children: <Widget>[
const Text('Text size'),
Text(
- '${options.textScaleFactor.label}',
+ options.textScaleFactor.label,
style: Theme.of(context).primaryTextTheme.body1,
),
],
@@ -324,7 +324,7 @@
children: <Widget>[
const Text('Visual density'),
Text(
- '${options.visualDensity.label}',
+ options.visualDensity.label,
style: Theme.of(context).primaryTextTheme.body1,
),
],
@@ -431,7 +431,7 @@
children: <Widget>[
const Text('Platform mechanics'),
Text(
- '${_platformLabel(options.platform)}',
+ _platformLabel(options.platform),
style: Theme.of(context).primaryTextTheme.body1,
),
],
diff --git a/examples/stocks/lib/stock_symbol_viewer.dart b/examples/stocks/lib/stock_symbol_viewer.dart
index 5272aae..26d0d86 100644
--- a/examples/stocks/lib/stock_symbol_viewer.dart
+++ b/examples/stocks/lib/stock_symbol_viewer.dart
@@ -29,7 +29,7 @@
Row(
children: <Widget>[
Text(
- '${stock.symbol}',
+ stock.symbol,
key: ValueKey<String>('${stock.symbol}_symbol_name'),
style: Theme.of(context).textTheme.display2,
),
@@ -43,7 +43,7 @@
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 9f67855..b1cfaa3 100644
--- a/packages/flutter/lib/src/animation/animation.dart
+++ b/packages/flutter/lib/src/animation/animation.dart
@@ -207,6 +207,6 @@
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 c5502c2..4e3c474 100644
--- a/packages/flutter/lib/src/animation/curves.dart
+++ b/packages/flutter/lib/src/animation/curves.dart
@@ -46,7 +46,7 @@
}
@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 57f6b4a..f6ca5d4 100644
--- a/packages/flutter/lib/src/foundation/_isolates_io.dart
+++ b/packages/flutter/lib/src/foundation/_isolates_io.dart
@@ -80,7 +80,7 @@
Future<void> _spawn<Q, R>(_IsolateConfiguration<Q, FutureOr<R>> configuration) async {
R result;
await Timeline.timeSync(
- '${configuration.debugLabel}',
+ configuration.debugLabel,
() async { result = await configuration.apply(); },
flow: Flow.step(configuration.flowId),
);
diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart
index 9154267..34a9c54 100644
--- a/packages/flutter/lib/src/foundation/assertions.dart
+++ b/packages/flutter/lib/src/foundation/assertions.dart
@@ -381,7 +381,7 @@
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 @@
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 118e1d0..5635558 100644
--- a/packages/flutter/lib/src/foundation/diagnostics.dart
+++ b/packages/flutter/lib/src/foundation/diagnostics.dart
@@ -1277,7 +1277,7 @@
// 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 @@
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 c8e42c1..5e169ee 100644
--- a/packages/flutter/lib/src/gestures/mouse_tracking.dart
+++ b/packages/flutter/lib/src/gestures/mouse_tracking.dart
@@ -174,7 +174,7 @@
@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 533eaf2..fd1ec08 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 @@
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 @@
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 03e665a..a629ce7 100644
--- a/packages/flutter/lib/src/painting/decoration.dart
+++ b/packages/flutter/lib/src/painting/decoration.dart
@@ -26,7 +26,7 @@
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 a49a043..eba4bbb 100644
--- a/packages/flutter/lib/src/painting/strut_style.dart
+++ b/packages/flutter/lib/src/painting/strut_style.dart
@@ -570,7 +570,7 @@
}
@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 a174b4c..2387294 100644
--- a/packages/flutter/lib/src/painting/text_span.dart
+++ b/packages/flutter/lib/src/painting/text_span.dart
@@ -440,7 +440,7 @@
);
@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 be50003..f84063f 100644
--- a/packages/flutter/lib/src/painting/text_style.dart
+++ b/packages/flutter/lib/src/painting/text_style.dart
@@ -1195,7 +1195,7 @@
}
@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 9a9f665..fc67321 100644
--- a/packages/flutter/lib/src/physics/simulation.dart
+++ b/packages/flutter/lib/src/physics/simulation.dart
@@ -54,5 +54,5 @@
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 af8ee03..71dd112 100644
--- a/packages/flutter/lib/src/rendering/custom_layout.dart
+++ b/packages/flutter/lib/src/rendering/custom_layout.dart
@@ -294,7 +294,7 @@
///
/// 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 dcc9d53..15b1447 100644
--- a/packages/flutter/lib/src/rendering/flow.dart
+++ b/packages/flutter/lib/src/rendering/flow.dart
@@ -132,7 +132,7 @@
///
/// 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 a5d4bf4..af1ea37 100644
--- a/packages/flutter/lib/src/rendering/proxy_box.dart
+++ b/packages/flutter/lib/src/rendering/proxy_box.dart
@@ -1138,7 +1138,7 @@
bool shouldReclip(covariant CustomClipper<T> 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 d56720c..bd3be14 100644
--- a/packages/flutter/lib/src/rendering/sliver.dart
+++ b/packages/flutter/lib/src/rendering/sliver.dart
@@ -759,7 +759,7 @@
}
@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 b7ca6c4..f627f95 100644
--- a/packages/flutter/lib/src/rendering/table.dart
+++ b/packages/flutter/lib/src/rendering/table.dart
@@ -76,7 +76,7 @@
double flex(Iterable<RenderBox> 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 d32541a..609219e 100644
--- a/packages/flutter/lib/src/semantics/semantics.dart
+++ b/packages/flutter/lib/src/semantics/semantics.dart
@@ -376,7 +376,7 @@
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 @@
}
@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 7a22f3a..2ecaf78 100644
--- a/packages/flutter/lib/src/widgets/basic.dart
+++ b/packages/flutter/lib/src/widgets/basic.dart
@@ -2099,9 +2099,9 @@
} 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 79a8746..e613747 100644
--- a/packages/flutter/lib/src/widgets/debug.dart
+++ b/packages/flutter/lib/src/widgets/debug.dart
@@ -315,7 +315,7 @@
debugPrintGlobalKeyedWidgetLifecycle ||
debugProfileBuildsEnabled ||
debugHighlightDeprecatedWidgets) {
- throw FlutterError.fromParts(<DiagnosticsNode>[ErrorSummary('$reason')]);
+ throw FlutterError.fromParts(<DiagnosticsNode>[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 71d3b29..7534964 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 @@
);
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 f63eb78..3b6ef7d 100644
--- a/packages/flutter/lib/src/widgets/framework.dart
+++ b/packages/flutter/lib/src/widgets/framework.dart
@@ -442,7 +442,8 @@
/// A short, textual description of this widget.
@override
String toStringShort() {
- return key == null ? '${objectRuntimeType(this, 'Widget')}' : '${objectRuntimeType(this, 'Widget')}-$key';
+ final String type = objectRuntimeType(this, 'Widget');
+ return key == null ? type : '$type-$key';
}
@override
@@ -3896,7 +3897,7 @@
/// 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 efd31e1..a6ba536 100644
--- a/packages/flutter/lib/src/widgets/implicit_animations.dart
+++ b/packages/flutter/lib/src/widgets/implicit_animations.dart
@@ -360,7 +360,7 @@
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 e0e5073..c959b52 100644
--- a/packages/flutter/lib/src/widgets/routes.dart
+++ b/packages/flutter/lib/src/widgets/routes.dart
@@ -354,7 +354,7 @@
}
/// 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 3487ecf..0ce728c 100644
--- a/packages/flutter/lib/src/widgets/scroll_activity.dart
+++ b/packages/flutter/lib/src/widgets/scroll_activity.dart
@@ -507,7 +507,7 @@
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 @@
_completer = Completer<void>();
_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 a3e0d3e..f295b18 100644
--- a/packages/flutter/lib/src/widgets/scroll_configuration.dart
+++ b/packages/flutter/lib/src/widgets/scroll_configuration.dart
@@ -77,7 +77,7 @@
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 44caef6..720b6e6 100644
--- a/packages/flutter/lib/src/widgets/shortcuts.dart
+++ b/packages/flutter/lib/src/widgets/shortcuts.dart
@@ -156,7 +156,7 @@
return a.debugName.compareTo(b.debugName);
}
);
- return sortedKeys.map<String>((LogicalKeyboardKey key) => '${key.debugName}').join(' + ');
+ return sortedKeys.map<String>((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 d706057..8757873 100644
--- a/packages/flutter/test/material/slider_theme_test.dart
+++ b/packages/flutter/test/material/slider_theme_test.dart
@@ -378,7 +378,7 @@
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 dc3d2e7..fd66cf7 100644
--- a/packages/flutter/test/widgets/semantics_tester.dart
+++ b/packages/flutter/test/widgets/semantics_tester.dart
@@ -259,7 +259,7 @@
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 3563f17..3b54198 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 @@
const Locale('ar', 'AR'): <String, dynamic>{
'textDirection': TextDirection.rtl,
'expectedDaysOfWeek': <String>['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
- 'expectedDaysOfMonth': List<String>.generate(30, (int i) => '${arabicNumbers.format(i + 1)}'),
+ 'expectedDaysOfMonth': List<String>.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 cd99756..219497d 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 @@
// 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 f7ebfb4..65cb3e9 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 @@
}
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 977f545..443cab3 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 @@
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 8c250b3..9c4805a 100644
--- a/packages/flutter_tools/lib/src/cache.dart
+++ b/packages/flutter_tools/lib/src/cache.dart
@@ -555,7 +555,7 @@
/// Download an archive from the given [url] and unzip it to [location].
Future<void> _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 98e7453..7e398cb 100644
--- a/packages/flutter_tools/lib/src/commands/update_packages.dart
+++ b/packages/flutter_tools/lib/src/commands/update_packages.dart
@@ -367,7 +367,7 @@
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 af7ce54..aa2a739 100644
--- a/packages/flutter_tools/lib/src/compile.dart
+++ b/packages/flutter_tools/lib/src/compile.dart
@@ -609,8 +609,9 @@
_server.stdin.writeln('recompile $mainUri$inputKey');
globals.printTrace('<- recompile $mainUri$inputKey');
for (final Uri fileUri in request.invalidatedFiles) {
- _server.stdin.writeln(_mapFileUri(fileUri.toString(), packageUriMapper));
- globals.printTrace('${_mapFileUri(fileUri.toString(), packageUriMapper)}');
+ final String message = _mapFileUri(fileUri.toString(), packageUriMapper);
+ _server.stdin.writeln(message);
+ globals.printTrace(message);
}
_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 debd75a..b1805b9 100644
--- a/packages/flutter_tools/lib/src/device.dart
+++ b/packages/flutter_tools/lib/src/device.dart
@@ -468,7 +468,7 @@
table.add(<String>[
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 c9b4341..e92c05e 100644
--- a/packages/flutter_tools/lib/src/ios/devices.dart
+++ b/packages/flutter_tools/lib/src/ios/devices.dart
@@ -50,7 +50,7 @@
'--justlaunch',
if (launchArguments.isNotEmpty) ...<String>[
'--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 bda9b96..8307d91 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -473,7 +473,7 @@
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 a18fd1b..0e560ee 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 @@
'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 626629c..3bf8139 100644
--- a/packages/flutter_tools/lib/src/reporting/events.dart
+++ b/packages/flutter_tools/lib/src/reporting/events.dart
@@ -139,9 +139,9 @@
// 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 30e9097..a876544 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 @@
_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 e3c8670..a642c55 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
@@ -113,7 +113,7 @@
});
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 5517c43..af132d3 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
@@ -91,7 +91,7 @@
await runner.run(<String>['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(<String>['dummy', '--local-engine=ios_debug']);
}, overrides: <Type, Generator>{