Back

How to Use Localization Api to get currency and show them in dropdown

  • 0
  • Flutter
new user
28 Apr, 2023, 22:06

here is how i am getting list of currency but not able to show them inside dropdown Future getCurrency()async{ final res = await locale.listCurrencies(); print(res.currencies); return res.currencies; }

TL;DR
The user is trying to use the Localization API to display currency symbols in a dropdown. They provided a link to a list of currencies and mentioned that some currency symbols are incorrect. They are using the `getCurrency()` function to fetch the list of currencies, but are unable to display them in the dropdown. No specific solution is mentioned in the thread.
Binyamin
28 Apr, 2023, 22:31

You're not getting a list?

new user
28 Apr, 2023, 22:32

getting list like [instance of Currency, instance of Currency] but not able to show them in droupdown

Binyamin
28 Apr, 2023, 22:35

Then you need to create a dropdown then iterate over the items, like so

https://api.flutter.dev/flutter/material/DropdownButton-class.html

new user
28 Apr, 2023, 22:36

yes i am using map to get all element Future getCurrency()async{ final res = await locale.listCurrencies(); print(res.currencies.map((e) => e.symbol)); return res.currencies.map((e) => e); }

Binyamin
28 Apr, 2023, 22:38

You'll need to use your widget state to add it to drop-down

new user
29 Apr, 2023, 18:31

now, its working, but why some Currency symbols are not correct.

new user
29 Apr, 2023, 18:34

here is the list of all currencies,[$, €, £, $, د.إ.‏, ؋, Lek, դր., $, $, ман., KM, ৳, лв., د.ب.‏, FBu, $, Bs, R$, P, BYR, $, FrCD, CHF, $, CN¥, $, ₡, CV$, Kč, Fdj, kr, RD$, د.ج.‏, kr, ج.م.‏, Nfk, Br, GEL, GH₵, FG, Q, $, L, kn, Ft, Rp, ₪, ₹, د.ع.‏, ﷼, kr, $, د.أ.‏, ¥, Ksh, ៛, FC, ₩, د.ك.‏, тңг., SL Re, Lt, Ls, د.ل.‏, د.م.‏, MDL, MGA, MKD, K, MOP$, MURs, $, RM, MTn, N$, ₦, C$, kr, नेरू, $, ر.ع.‏, B/., S/., ₱, ₨, zł, ₲, ر.ق.‏, RON, дин., руб., FR, ر.س.‏, SDG, kr, $, Ssh, ل.س.‏, ฿, د.ت.‏, T$, TL, $, NT$, TSh, ₴, USh, $, UZS, Bs.F., ₫, FCFA, CFA, ر.ي.‏, R, ZK]

Drake
29 Apr, 2023, 20:58

If anything is wrong, you can create an issue. This is where it all is: https://github.com/appwrite/appwrite/blob/master/app/config/locale/currencies.php

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more