I'm currently creating an simple application with flutter(Dart). And when i want to create the AppBar widget, i cant give it names with '$'. Because, same like Kotlin..Dart is using '$' for summoning an identifier.

Any solution?

var _appbar = AppBar(
  title: Text("How I Made $100"), //$ is the error
);


Solution 1: rmtmckenzie

The dollar sign is a special character, so if you want it to be ignored you have to escape it with a \.

For example:

void main() {
  print("This string contains a dollar \$ign");
}

See this gist.