Reputation: 4101
How we can use a variable started with $
in a string interpolation?
What is a string interpolation equivalent of the following string concatenation?
final String $foo = 'Foo';
print('my variable is '+ $foo);
Note: it is useful when we have a variable started with _
and want to make it public, i.e a JSON field named _
, can be converted to $_
in dart
Upvotes: 3
Views: 643