I am trying to write a $ sign in a Text
Text("Refer and Win 10 000 $")
I get an error
What is the correct way to write this?
As @Davy M mentioned, you have to escape the $
because it's used as a control character for embedding variables in a string.
See the Dart docs: https://www.dartlang.org/guides/language/language-tour#strings
You can use Runes
class which does not need any plugin
Example
You want to show Dollar sign and you know its unicode value ie U+0024
Now to show it in text you can use Runes
class and convert it to show Dollar sign ($)
Just need to use the unicode value after U+
ie 0024
and then append it with \u
Usage
Text(new String.fromCharCodes(new Runes('\u0024'))),
List of special characters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With