currency_picker 2.0.5
currency_picker: ^2.0.5 copied to clipboard

A flutter package to select a currency from a list of currencies.

Currency picker #

pub package

A flutter package to select a currency from a list of currencies.

n1

Getting Started #

Add the package to your pubspec.yaml:

 currency_picker: ^2.0.5

In your dart file, import the library:

 import 'package:currency_picker/currency_picker.dart';

Show currency picker using showCurrencyPicker:

showCurrencyPicker(
   context: context,
   showFlag: true,
   showCurrencyName: true,
   showCurrencyCode: true,
   onSelect: (Currency currency) {
      print('Select currency: ${currency.name}');
   },
);

Parameters: #

  • onSelect: Called when a currency is select. The currency picker passes the new value to the callback (required)
  • showFlag: Shows flag for each currency. Default value true (optional).
  • searchHint: Option to customize hint of the search TextField (optional).
  • showCurrencyName: Option to show/hide the currency name, default value true (optional).
  • showCurrencyCode: Option to show/hide the currency code, default value true (optional).
  • currencyFilter: Can be used to filter the Currency list (optional).
     showCurrencyPicker(
        context: context,
        onSelect: (Currency currency) {
           print('Select currency: ${currency.name}');
        },
        currencyFilter: <String>['EUR', 'GBP', 'USD', 'AUD', 'CAD', 'JPY', 'HKD', 'CHF', 'SEK', 'ILS'],
     );
    
  • favorite: Can be used to show the favorite currencies at the top of the list (optional).
  • theme: Can be used to customizing the currency list bottom sheet. (optional).
     showCurrencyPicker(
        context: context,
        theme: CurrencyPickerThemeData(
           flagSize: 25,
           titleTextStyle: TextStyle(fontSize: 17),
           subtitleTextStyle: TextStyle(fontSize: 15, color: Theme.of(context).hintColor),
        ),
        onSelect: (Currency currency) => print('Select currency: ${currency.name}'),
     );
    

Contributions #

Contributions of any kind are more than welcome! Feel free to fork and improve currency_picker in any way you want, make a pull request, or open an issue.

15
likes
130
pub points
89%
popularity

A flutter package to select a currency from a list of currencies.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

collection, flutter

More

Packages that depend on currency_picker