prefer_ adjacent_ string_ concatenation
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:
var s = 'a' + 'b';
Common fixes
#Remove the operator:
var s = 'a' 'b';
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Page last updated on 2025-9-1. View source or report an issue.