dart-idiomatic-usage
Installation
SKILL.md
Writing Idiomatic Dart Collections and Strings
Contents
- String Composition
- Collection Initialization
- Collection Operations
- Type Casting in Collections
- Workflow: Refactoring Legacy Collections
String Composition
Follow these practices to compose strings efficiently and readably.
- Use adjacent strings for concatenation: Do not use the
+operator to concatenate string literals. Place them next to each other to form a single string. - Prefer string interpolation: Use
$variableor${expression}to compose strings and values instead of concatenation (+). - Omit unnecessary curly braces: Use
$identifierinstead of${identifier}when interpolating a simple identifier that is not immediately followed by alphanumeric text.