Git Product home page Git Product logo

flutter_currency_picker's People

Contributors

altotunchitoo avatar constantinos-impact avatar daniel-ioannou avatar davemg3 avatar dhurghamfahem avatar docteur-parfait avatar faizanahmad127 avatar haze23 avatar jackiejoker avatar jedi1150 avatar kylekun avatar lakshan-costa avatar matthewrice345 avatar rocboronat avatar samooh-9820060 avatar zssoftwarestudio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_currency_picker's Issues

Add XAF currency

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

Use emoji flags directly instead of computing them

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?

Incorrect currency symbols

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

Null Safety

When are you planning to move it to null safe ?

Offer a way to mark a currency as the selected one

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.

Add cryptocurrencies

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,
  }

Currency symbol on Android showing incorrectly

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?

Add more support for African countries

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
}

CurrencyListView

Please can you expose CurrencyListView so that it can be used also independent of the BottomSheet

Add the Seychellois rupees

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,
},

Add params useRootNavigator

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,
    ),
  );
}

Currency removal

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).

Unable to load Asset no_flag.png

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
Screenshot 2022-07-13 at 02 58 25
C

More currency-related info will be appreciated

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

The currencies shouldn't know about the decimal and the thousands separator

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!

Gourde

add gourde (country : Haiti)

Add Riel Currrency

{
"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,
},

Order the currencies alphabetically

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!

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.