6

So, I was making this Budget Manager app as I was learning flutter, I want to add a Indian rupee symbol. I had checked the official docs and found a lib called Unicode.dart, however the explanation is not clear. I also searched how to input a rupee symbol in android but that is also not working because the solution is Java or Kotlin specific rather than dart or flutter.

https://pub.dev/packages/unicode#-readme-tab- --Unicode library for flutter

Set Indian Rupee symbol on text view --the android specific

Liam
  • 1,712
  • 1
  • 17
  • 30
Tarster
  • 105
  • 1
  • 1
  • 9

4 Answers4

22

How about this?

Text('\u{20B9}'),
Yuu Woods
  • 1,303
  • 6
  • 17
5

You can combine string interpolation and unicode character

Text('\u{20B9}${your amount}'),

This is to get Indian currency symbol rupee in your flutter app.

Vishwa63
  • 51
  • 1
  • 1
1

for euro symbol i found solution on the official website https://api.flutter.dev/flutter/material/Icons/euro_symbol-constant.html

I used this code step 1 : create constant file

mport 'package:flutter/material.dart';
const IconData euro_symbol = IconData(0xe23c, fontFamily: 'MaterialIcons');

step 2: Use this icon with your prefered textview enter image description here

Raj Jani
  • 19
  • 5
  • 1
    Worked for me: For Rupee final IconData rupeeSymbol = const IconData(0x20B9, fontFamily: 'MaterialIcons'); Use: Icon(rupeeSymbol) – Deepak swain Nov 21 '21 at 12:33
0

So I looked at the dart on tutorialspoint.com and found out the solution.

main() { 
   Runes input = new Runes(' \u{20B9}'); 
   print(new String.fromCharCodes(input)); 
}

The solution is pretty simple you need to create a new Runes and then convert the Runes to String using the String function fromCharCodes(input).

To get any other symbol or Unicode character just replace '20B9' with your Unicode value

Tarster
  • 105
  • 1
  • 1
  • 9