GithubHelp home page GithubHelp logo

siman302 / flutter_currency_picker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daniel-ioannou/flutter_currency_picker

0.0 0.0 0.0 1.86 MB

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

Home Page: https://pub.dev/packages/currency_picker

License: MIT License

Objective-C 0.07% Kotlin 0.24% Dart 98.94% Swift 0.75%

flutter_currency_picker's Introduction

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

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).
  • showSearchField: Option to show/hide the search TextField, 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),
           bottomSheetHeight: MediaQuery.of(context).size.height / 2,
        ),
        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.

flutter_currency_picker's People

Contributors

daniel-ioannou avatar jedi1150 avatar lakshan-costa avatar rocboronat avatar matthewrice345 avatar altotunchitoo avatar kylekun avatar jackiejoker avatar constantinos-impact avatar davemg3 avatar

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.