Flutter Currency Picker
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!.withValues(alpha: 0.4),
overflow: TextOverflow.ellipsis,
),
fieldBackground: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.1),
update: (value) => setState(() => currency = value),
);
}
In addition to thanking, you may treat us to :coffee:.
Libraries
- flutter_currency_picker
- gen_l10n/app_localization
- gen_l10n/app_localization_ar
- gen_l10n/app_localization_az
- gen_l10n/app_localization_be
- gen_l10n/app_localization_cs
- gen_l10n/app_localization_de
- gen_l10n/app_localization_en
- gen_l10n/app_localization_es
- gen_l10n/app_localization_fa
- gen_l10n/app_localization_fr
- gen_l10n/app_localization_hi
- gen_l10n/app_localization_it
- gen_l10n/app_localization_ja
- gen_l10n/app_localization_ko
- gen_l10n/app_localization_nl
- gen_l10n/app_localization_pl
- gen_l10n/app_localization_pt
- gen_l10n/app_localization_ro
- gen_l10n/app_localization_tr
- gen_l10n/app_localization_uk
- gen_l10n/app_localization_uz
- gen_l10n/app_localization_zh
- l10n/fallback_localization_delegate