Febin Johnson
Febin Johnson

Reputation: 382

Flutter - Text Widget does not render currency icons

In my application, I have a screen that shows pricing. However, the currency icon does not appear correctly in some places (look at the amount 7000). This problem is more frequent on iOS devices, with a few occurrences on Android devices.

The information is retrieved in the following manner:

Text("₹ 7000.00") // in application the pricing is retrieved from api call.

The currency icon is included in the data I receive from the api request. "₹7000" is an example.

The font used is Gotham Rounded. Is this due to the font's inability to render currency icons? What is the best way to resolve this problem?

enter image description here

Upvotes: 3

Views: 2144

Answers (2)

Bob David
Bob David

Reputation: 51

i know this might be late but to help someone use fontfamily of Roboto or OpenSans

because some currencies or unicode wont show using normal font

Upvotes: 1

Denzel
Denzel

Reputation: 1109

It's better to use Unicode characters for currency symbols because most of the symbols are not yet supported in flutter so your device does not understand the string so it does not render it on mobile.

Unicode characters on the other hand could be easily translated after compilation

You can find unicode characters for different symbols here

So you have something like this instead

Text("\u{20B9}");

Upvotes: 3

Related Questions