Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Dart string


May 23, 2021 Dart Code style guide


Table of contents


String

You should avoid using braces when you don't need to.

If you just insert a simple identifier and there is no other text at the end of that {} can delete it.

// good
'Hi, $name!'
"Wear your wildest $decade's outfit."
'Wear your wildest ${decade}s outfit.'
// bad
'Hi, ${name}!'
"Wear your wildest ${decade}'s outfit."