daniel-ioannou / flutter_currency_picker Goto Github PK
View Code? Open in Web Editor NEWA flutter package to select a currency from a list of currencies.
Home Page: https://pub.dev/packages/currency_picker
License: MIT License
A flutter package to select a currency from a list of currencies.
Home Page: https://pub.dev/packages/currency_picker
License: MIT License
Please add support for the Rwanda Franc. I have users in this country.
Many thanks.
XAF is a currency shared by a couple of countries in central Africa (just like EUR is shared by countries in Europe).
My app targets users in those regions.
Could you add support for this currency?
Thanks
I'm experiencing a noticable delay when opening the currency picker widget. I guess because it has to compute more than 200 flags when generating the listview.
Can we just add the emoji data directly to the list?
I think that will boost the performance of the package.
What do you think?
More info: wikipedia
please add currency for cubs , angola , snegal , sudan .
I went over all the currency symbols after I noticed one of them (KZT) didn't seem right, and found that some may be incorrect. As far as I can tell by looking at a number of websites**, these seem to be the right symbols for the following currencies:
AMD ֏
BYN Br
GHS ₵
KZT 〒
MDL L
PYG ₲
RON L
** these 2 seem to be the most complete references I found. I tried to go with the most agreed upon symbols. The second link says those are the ISO codes, but iso.org charges $41 for the PDF with the codes, so I couldn't double check it... it's hard to find consistent answers on the internet.
https://en.wikipedia.org/wiki/Currency_symbol#List_of_currency_symbols_currently_in_use
https://www.foreignexchangelive.com/currency-codes-symbols/
https://github.com/smirzaei/currency-formatter/blob/master/currencies.json
Is there a reason why the decimal seperator for KZT is set to "-"?
Wikipedia says its a comma.
https://www.wikiwand.com/en/Decimal_mark
When are you planning to move it to null safe ?
As the user is able to select a currency and then open the picker again, the picker should be smart enough to mark the selected currency in some way. Maybe a tick ✔️? And maybe the list should be scrolled to show that value when showing the picker.
It would be great if you could add some cryptocurrencies to the list. Here I have the first 19.
I think the flag stuff should be modified to hold images also instead of the current String?
variable type. Also, the icons should be retrieved from assets I think.
Thank you for your nice work.
// Below this comment there are the main cryptocurrencies as listed by
// https://www.coindesk.com/coindesk20/
// All of these are based on the USD attributes.
{
"code": "BTC",
"name": "Bitcoin",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Bitcoins",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "ETH",
"name": "Ethereum",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Ethereums",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "USDT",
"name": "Tether",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Tethers",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "USDC",
"name": "USD Coin",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "USD Coins",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "XRP",
"name": "XRP",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "XRPs",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "SOL",
"name": "Solana",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Solanas",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "ADA",
"name": "Cardano",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Cardanos",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "XLM",
"name": "Stellar",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Stellars",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "DOGE",
"name": "Dogecoin",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Dogecoins",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "DOT",
"name": "Polkadot",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Polkadots",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "AVAX",
"name": "Avalanche",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Avalanches",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "LINK",
"name": "Chainlink",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Chainlinks",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "SHIB",
"name": "Shiba Inu",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Shiba Inus",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "MATIC",
"name": "Polygon",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Polygons",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "ATOM",
"name": "Cosmos",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Cosmos",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "GALA",
"name": "Gala",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Galas",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "MANA",
"name": "Decentraland",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Decentralands",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "LRC",
"name": "Loopring",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Looprings",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "LUNA",
"name": "Luna Classic",
"symbol": "\$",
"decimal_digits": 2,
"number": -1,
"name_plural": "Luna Classics",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
}
Hey, no idea what I'm doing wrong here but the picker shows the currency symbols correctly but when I use any of those symbols in a Text(currency.symbol)
I get a box with a question mark inside. This happens for several selections but reproducible with the Russia Ruble. Using a Pixel 6 Pro, Android 12. Any suggestions?
Croatia Kuna is replaced by the euro (€, EUR) on 1 January 2023.
Can you kindly add support for these countries please
Sierra Leone and Guinea
{
"code": "SLL",
"name": "Sierra Leone Leone",
"symbol": "Le",
"flag": "SLL",
"decimal_digits": 2,
"number": 694,
"name_plural": "Sierra Leone Leones",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true
}
{
"code": "GNF",
"name": "Guinean Franc",
"symbol": "FG",
"flag": "GNF",
"decimal_digits": 2,
"number": 324,
"name_plural": "Guinean Francs",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": true
}
ENV:
MacOs m1 on iPhone 14 simulator
As this project has a lot of information about the currencies, it would be great to use it to retrieve the Currency related to a given Locale.
Hi,
Can you add a property to set the height of bottom sheet or even better to have an adjustable height from few elements until a specific max height (many scrollable elements)
just as for example : https://pub.dev/packages/map_launcher
thks
Currency added in favorite and currencyFilter are showing twice in the popup
sample code to induce error
showCurrencyPicker(
context: context,
currencyFilter: ['eur', 'inr', 'usd'],
favorite: ['eur', 'inr', 'usd'],
);
Please can you expose CurrencyListView so that it can be used also independent of the BottomSheet
Hello Daniel! I wanted to make a PR to add the Seychellois rupees to the list of currencies but I'm not sure about the number
field. And I don't have the flag yet. So I'm opening an issue in case you can add it easily, or as a reminder for me to make the PR :·)
Here's what I have atm:
{
"code": "SCR",
"name": "Seychellois rupee",
"symbol": "₨",
"flag": "BY",
"decimal_digits": 2,
"number": TBD,
"name_plural": "Seychellois rupees",
"thousands_separator": ".",
"decimal_separator": ",",
"space_between_amount_and_symbol": true,
"symbol_on_left": true,
},
Hello add params useRootNavigator for "If you need a modal (showModalBottomSheet) but you have a bottomnavigationbar and the modal needs to be on top of the bottomnavigationbar, use the userootnavigator = true property of showModalBottomSheet."
Permission to Daniel-Ioannou/flutter_currency_picker.git denied so here:
file currency_picker.dart
void showCurrencyPicker({
required BuildContext context,
required ValueChanged<Currency> onSelect,
List<String>? favorite,
List<String>? currencyFilter,
String? searchHint,
bool showSearchField = true,
bool showFlag = true,
bool showCurrencyName = true,
bool showCurrencyCode = true,
bool useRootNavigator = false,
ScrollPhysics? physics,
CurrencyPickerThemeData? theme,
}) {
assert(
showCurrencyName || showCurrencyCode,
'showCurrencyName and showCurrencyCode cannot be both false',
);
currency_list.showCurrencyListBottomSheet(
context: context,
onSelect: onSelect,
showSearchField: showSearchField,
searchHint: searchHint,
showFlag: showFlag,
showCurrencyName: showCurrencyName,
showCurrencyCode: showCurrencyCode,
useRootNavigator: useRootNavigator,
favorite: favorite,
currencyFilter: currencyFilter,
theme: theme,
physics: physics,
);
}
file currency_list_bottom_sheet.dart
void showCurrencyListBottomSheet({
required BuildContext context,
required ValueChanged<Currency> onSelect,
List<String>? favorite,
List<String>? currencyFilter,
String? searchHint,
bool showSearchField = true,
bool showFlag = true,
bool showCurrencyName = true,
bool showCurrencyCode = true,
bool useRootNavigator = false,
ScrollPhysics? physics,
CurrencyPickerThemeData? theme,
}) {
final ShapeBorder shape = theme?.shape ??
const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
);
showModalBottomSheet<dynamic>(
context: context,
isScrollControlled: true,
useRootNavigator: useRootNavigator,
shape: shape,
backgroundColor: theme?.backgroundColor,
builder: (_) => _builder(
context,
onSelect,
favorite,
currencyFilter,
searchHint,
physics,
showSearchField,
showFlag,
showCurrencyName,
showCurrencyCode,
theme,
),
);
}
I am using the currency picker not only for picking the currency but also for all the helpful information about the currencies in currencies.dart.
By removing former currencies from currencies.dart, like the croatian kuna, I cant display former usages properly.
Proposal: Mark former currencies as removed and dont show them in the currency picker but leave them in currencies.dart (as long as the currency code isnt needed).
How can I modify this?
While scrolling through the list , I got the below exception message
Unable to load asset: packages/currency_picker/lib/src/res/no_flag.png
AssetBundleImageKey(bundle: PlatformAssetBundle#b8114(), name: "packages/currency_picker/lib/src/res/no_flag.png", scale: 1.0)
packages/currency_picker/lib/src/res/no_flag.png
Closure: (Uint8List, {int? cacheWidth, int? cacheHeight, bool allowUpscaling}) => Future from Function 'instantiateImage
C
Would be nice to sort the list by usage, not by ABC
https://en.wikipedia.org/wiki/Template:Most_traded_currencies
Would be nice to have a preselect array option, so one or more currencies can be preselected.
I am working on an app that has a currency selector and do some geolocation magic, and preselect the currency based on user geolocationn https://play.google.com/store/apps/details?id=com.cashtic
Also, the capability to multiselect would be great too.
Letting the user select the currency has some impacts not only on the currency name/symbol to show.
There are some currencies that show the symbol before the amount while others after. There're also some currencies that are a space between the symbol and the amount, and not all currencies show the same decimal digits.
I think that gives this information when the user selects a currency will be really helpful.
I've found a JSON file from another library that has this information, so it will not be too hard to add it:
https://github.com/smirzaei/currency-formatter/blob/master/currencies.json
First of all, love the package, very useful! I would like to request if you can please add KGS to the list of currencies.
Thank you!
More info: wikipedia
Add Zambian Kwacha to currency list.
Hello!
Playing around with the picker, I've noticed the Currency
class has decimalSeparator
and thousandsSeparator
fields.
I think they shouldn't, because that is related with the device language, not the currency itself.
An example: in Catalan and Spanish, we use the comma as a decimal separator and the dot as a thousand separator for both numbers and currencies. And the opposite: in English, the comma is for the thousands and the dot for the decimals, for both numbers and currencies.
What do you think?
Thanks!
add gourde (country : Haiti)
The official Congolese franc is missing from the list.
{
"code": "KHR",
"name": "Khmer Riel",
"symbol": "៛",
"flag": "",
"decimal_digits": 2,
"number": ,
"name_plural": "riels",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": false,
},
currency byn is duplicated.
Please add the possibility to specify a custom hint instead of the default "Search", and add the option to show or not show the subtitles in each element of the list.
Thank you :)
Right now, the currencies are ordered by their usage, according to a comment in currencies.dart.
As the library offers a way to show the favorite currencies in the beginning of the list, don't you think we should show the most used currencies there, like EUR or USD, and then order the rest alphabetically? A user that scrolls the list looking for the ethiopian birr doesn't care about the most traded currencies. I know there's a search text field, but as a user, honestly, you find that search text field when you finished scrolling the list 😅
May we order them alphabetically?
Thanks a lot, by the way!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.