prefer_interpolation_to_compose_strings

Group: style

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.30)

View the Project on GitHub dart-lang/linter

PREFER using interpolation to compose strings and values.

Using interpolation when composing strings and values is usually easier to write and read than concatenation.

BAD:

'Hello, ' + name + '! You are ' + (year - birth) + ' years old.';

GOOD:

'Hello, $name! You are ${year - birth} years old.';