Giter Club home page Giter Club logo

flutter_currency_picker's Introduction

Flutter Currency Picker

Test Status Build Status

Wrapper on top of SearchAnchor with a localization (ar, az, en, be, uk, pl, pt, fr, de, es, ja) support.

Representation layer of conversion number to a currency as string. Native selector extension for Currency Selector with a dependency injection (list representation layer) approach, and localization support.

https://pub.dev/packages/flutter_currency_picker

Converter

// locale 'en_US'
1234.5.toCurrency(code: 'EUR') // 1 234,50 €
1234.5.toCurrency(code: 'EUR', withPattern: false) // €1,234.50

Currencies Localization

// Init from context
CurrencyProvider.initFromContext(context);

// [OR] Inject your own
import 'package:flutter_gen/gen_l10n/app_localization_de.dart';
CurrencyDefaults.labels = AppLocalizationsDe();

Selector

Currency? currency;

@override
Widget build(BuildContext context) {
  return CurrencySelector(
    value: currency?.code,
    hintText: 'Currency Type (Code)',
    hintStyle: Theme.of(context).textTheme.copyWith(
      color: textTheme.headlineSmall?.color!.withOpacity(0.4),
      overflow: TextOverflow.ellipsis,
    ),
    fieldBackground: Theme.of(context).colorScheme.onSurface.withOpacity(0.1),
    update: (value) => setState(() => currency = value),
  );
}

Selector Sample

In addition to thanking, you may treat us to ☕.

flutter_currency_picker's People

Contributors

lyskouski avatar

Watchers

 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.