prefer_adjacent_string_concatenation
Details about the 'prefer_adjacent_string_concatenation' diagnostic produced by the Dart analyzer.
String literals shouldn't be concatenated by the '+' operator.
Description
#
The analyzer produces this diagnostic when the + operator is used to
concatenate two string literals.
Example
#
The following code produces this diagnostic because two string literals
are being concatenated by using the + operator:
dart
var s = 'a' + 'b';
Common fixes
#Remove the operator:
dart
var s = 'a' 'b';
Was this page's content helpful?
除非另有说明,文档之所提及适用于 Dart 3.10.3 版本报告页面问题.