diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4b9f71b..f89416a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -69,4 +69,33 @@
## 1.0.6
* Fix Memory issues
* Fix Cursor Issue
- * Fix Currency Mask format.
\ No newline at end of file
+ * Fix Currency Mask format.
+
+ ## 1.0.7
+ * Fix Controller on TextEditingController
+ * Fix Relative Cursor Issue
+
+ ## 1.0.8
+ * add currencyChooser
+
+ ## 1.0.9
+ * Minor refactor in currencyChooser
+
+ ## 1.0.10
+ * Add `CustomCurrencyPicker` and `CustomCurrencyChooser` to restrict selectable currencies to a specific list.
+ * Add `CurrencyMultiSelector` widget to support selecting multiple currencies simultaneously.
+
+ ## 1.0.11
+
+ * Add default currency selector
+
+ ## 1.0.12
+
+ * Fix `CurrencyTextField` to display the default amount when the currency is initialized.
+
+# 1.0.13
+
+* Fix pub dev issues.
+
+# 1.0.14
+* Fix Currency Decimal Format.
\ No newline at end of file
diff --git a/README.md b/README.md
index 0cd075b..e0097c4 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,22 @@ A widget for **displaying a list of currency values in a card format**. This is
* Each item in the list can represent a different currency or aspect of a report.
* Customizable to fit various reporting needs.
+### `CurrencyChooser`
+A lightweight widget to **select a currency without requiring an amount**. Use it when you only need the user to pick a currency, with no amount input involved.
+* Dropdown to select from common or all supported currencies.
+* Toggle button (⭐ / 🌐) to switch between most-used and all currencies.
+* Displays the full localized name of the selected currency.
+* Exposes the selection via `CurrencyController.currency` and `CurrencyController.currencyNotifier`.
+
+### `CustomCurrencyPicker`
+Similar to `CurrencyPicker` (includes amount input), but allows you to restrict the selectable currencies to a specific list of currency codes (e.g., `['USD', 'EUR']`).
+
+### `CustomCurrencyChooser`
+Similar to `CurrencyChooser` (no amount input), but displays the options as selectable chips (`ChoiceChip`) instead of a dropdown, and restricts the selectable currencies to a specific list.
+
+### `CurrencyMultiSelector`
+A widget that allows the user to select multiple currencies at once. It displays currencies as actionable chips (`FilterChip`) in a responsive `Wrap` layout, including a toggle button to switch between favorite and all currencies.
+
## Properties per Widget
@@ -41,10 +57,14 @@ A widget for **displaying a list of currency values in a card format**. This is
| Widget | Properties |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| `CurrencyPicker` | `currencyController`: (required) Manages currency state.
|
-| `CurrencyTextField` | `currencyController`: (required) Manages currency state.
`currencyCode`: (required) Code of the currency to use.
|
+| `CurrencyPicker` | `currencyController`: (required) Manages currency state.
`defaultCurrencyCode`: (optional) Initial currency to select. |
+| `CurrencyTextField` | `currencyController`: (required) Manages currency state.
`currencyCode`: (required) Code of the currency to use.
`defaultAmount`: (optional) Initial amount to select. |
| `CurrencyTextView` | `mount`: (required) Amount to display.
`currencyCode`: (required) Code of the currency.
`CurrencyControler` : (required)Manages currency state |
| `CurrencyCardReport` | `title`: (required) Title widget for the card.
`icon`: (required) Icon widget for the card.
`mount`: (required) Amount to display.
`currencyCode`: (required) Code of the currency.
`lang`: (required) Language for formatting.
`style`: Text Style |
+| `CurrencyChooser` | `currencyController`: (required) Manages currency state and exposes the selected currency via `controller.currency` and `controller.currencyNotifier`. |
+| `CustomCurrencyPicker`| `currencyController`: (required) Manages currency state.
`currencyCodes`: (required) List of currency codes to allow.
`defaultCurrencyCode`: (optional) Initial currency to select. |
+| `CustomCurrencyChooser`| `currencyController`: (required) Manages currency state.
`currencyCodes`: (required) List of currency codes to allow.
`defaultCurrencyCode`: (optional) Initial currency to select. |
+| `CurrencyMultiSelector`| `onChanged`: (required) Callback fired when selection changes.
`initialSelected`: List of initially selected currencies.
`showOnlyCommon`: Toggle between common or all currencies.
|
**Note**: All widgets also accept standard Flutter widget properties like `key`, `padding`, `margin`, etc.
@@ -102,7 +122,7 @@ class MyCurrencyScreen extends StatefulWidget {
}
class _MyCurrencyScreenState extends State {
- final CurrencyController _controller = CurrencyController();
+ final CurrencyController _controller = CurrencyController(lang: 'es', initialCurrencyCode: 'EUR');
@override
void dispose() {
@@ -120,7 +140,10 @@ class _MyCurrencyScreenState extends State {
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
- CurrencyPicker(currencyController: _controller),
+ CurrencyPicker(
+ currencyController: _controller,
+ defaultCurrencyCode: 'EUR',
+ ),
SizedBox(height: 20),
// You can listen to changes in the controller
ValueListenableBuilder(
@@ -133,7 +156,38 @@ class _MyCurrencyScreenState extends State {
width: 200,
child:
CurrencyCardReport( title: Text('Currency Report'), icon: Icon(Icons.currency_exchange),mount: 250.24, currencyCode: 'usd', lang: 'en',)
- )
+ ),
+ SizedBox(height: 20),
+ // CurrencyChooser: pick a currency without entering an amount
+ CurrencyChooser(currencyController: _controller),
+ ValueListenableBuilder(
+ valueListenable: _controller.currencyNotifier,
+ builder: (_, currency, __) {
+ return Text('Selected: ${currency?.getDefaultView() ?? ''}');
+ },
+ ),
+ SizedBox(height: 20),
+ // CurrencyMultiSelector: pick multiple currencies at once
+ CurrencyMultiSelector(
+ showOnlyCommon: true,
+ onChanged: (selectedList) {
+ print('Selected currencies: $selectedList');
+ },
+ ),
+ SizedBox(height: 20),
+ // CustomCurrencyChooser: pick a single currency from a restricted list using chips
+ CustomCurrencyChooser(
+ currencyController: _controller,
+ currencyCodes: ['USD', 'EUR', 'ARS'],
+ defaultCurrencyCode: 'USD',
+ ),
+ SizedBox(height: 20),
+ // CustomCurrencyPicker: pick a currency from a restricted list with amount input
+ CustomCurrencyPicker(
+ currencyController: _controller,
+ currencyCodes: ['USD', 'GBP', 'JPY'],
+ defaultCurrencyCode: 'GBP',
+ ),
],
),
),
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 9e652a6..dce6862 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -35,10 +35,25 @@ class _MyHomePageState extends State {
final CurrencyController controller = CurrencyController(lang: 'es');
final String currencyCode = 'usd';
- final CurrencyController currencyController = CurrencyController(lang: 'es');
+ final CurrencyController currencyController = CurrencyController(
+ lang: 'es',
+ initialCurrencyCode: 'ARS',
+ );
final CurrencyController currencyControllerEn = CurrencyController(
lang: 'en',
+ initialCurrencyCode: 'EUR',
+ );
+ final CurrencyController currencyChooserController = CurrencyController(
+ lang: 'es',
+ initialCurrencyCode: 'GBP',
+ );
+
+ final CurrencyController customCurrencyController = CurrencyController(
+ lang: 'es',
);
+ List _selectedCurrencies = [];
+ List get _selectedCurrencyCodes =>
+ _selectedCurrencies.map((c) => c.code).toList();
@override
Widget build(BuildContext context) {
@@ -58,61 +73,121 @@ class _MyHomePageState extends State {
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
- body: Center(
- // Center is a layout widget. It takes a single child and positions it
- // in the middle of the parent.
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- CurrencyPicker(currencyController: currencyControllerEn),
- CurrencyTextView(
- currencyCode: 'usd',
- mount: 250.24,
- currencyController: currencyControllerEn,
- ),
- ListenableBuilder(
- listenable: currencyControllerEn.mount,
- builder: (context, child) {
- return CurrencyTextView(
- currencyCode: currencyControllerEn.currency.code,
- mount: currencyControllerEn.mount.value ?? 0,
- currencyController: currencyControllerEn,
- );
- },
- ),
- CurrencyTextView(
- currencyCode: 'usa',
- mount: 250.24,
- currencyController: CurrencyController(lang: 'es'),
- ),
- CurrencyTextField(
- currencyCode: currencyCode,
- currencyController: currencyController,
- ),
- SizedBox(
- width: 200,
- child: CurrencyCardReport(
- title: 'Currency Report',
- icon: Icon(Icons.currency_exchange),
+ body: SingleChildScrollView(
+ child: Center(
+ // Center is a layout widget. It takes a single child and positions it
+ // in the middle of the parent.
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ // Se inicializará con 'EUR' por el controlador
+ CurrencyPicker(currencyController: currencyControllerEn),
+ CurrencyTextView(
+ currencyCode: 'usd',
mount: 250.24,
- currencyCode: 'eu',
- lang: 'en',
- style: TextStyle(fontSize: 10, fontWeight: FontWeight.bold),
+ currencyController: currencyControllerEn,
+ ),
+ ListenableBuilder(
+ listenable: currencyControllerEn.mount,
+ builder: (context, child) {
+ return CurrencyTextView(
+ currencyCode: currencyControllerEn.currency.code,
+ mount: currencyControllerEn.mount.value ?? 0,
+ currencyController: currencyControllerEn,
+ );
+ },
),
- ),
- SizedBox(
- width: 200,
- child: CurrencyCardReport(
- title: 'Currency Report',
- icon: Icon(Icons.currency_exchange),
+ CurrencyTextView(
+ currencyCode: 'usa',
mount: 250.24,
- currencyCode: 'usd',
- lang: 'en',
+ currencyController: CurrencyController(lang: 'es'),
),
- ),
- ],
+ CurrencyTextField(
+ currencyCode: currencyCode,
+ currencyController: currencyController,
+ defaultAmount: 20,
+ ),
+ SizedBox(
+ width: 200,
+ child: CurrencyCardReport(
+ title: 'Currency Report',
+ icon: Icon(Icons.currency_exchange),
+ mount: 250.24,
+ currencyCode: 'eu',
+ lang: 'en',
+ style: TextStyle(fontSize: 10, fontWeight: FontWeight.bold),
+ ),
+ ),
+ SizedBox(
+ width: 200,
+ child: CurrencyCardReport(
+ title: 'Currency Report',
+ icon: Icon(Icons.currency_exchange),
+ mount: 250.24,
+ currencyCode: 'usd',
+ lang: 'en',
+ ),
+ ),
+ const Divider(),
+ const Text('CurrencyChooser (sin monto)'),
+ CurrencyChooser(currencyController: currencyChooserController),
+ ListenableBuilder(
+ listenable: currencyChooserController.currencyNotifier,
+ builder: (context, child) {
+ return Text(
+ 'Moneda seleccionada: ${currencyChooserController.currency.getDefaultView()}',
+ );
+ },
+ ),
+ const Divider(),
+ const Text(
+ 'Multi-Selector & Custom Chooser',
+ style: TextStyle(fontWeight: FontWeight.bold),
+ ),
+ const SizedBox(height: 10),
+ CurrencyMultiSelector(
+ showOnlyCommon: true,
+ initialSelected: _selectedCurrencies,
+ onChanged: (selected) {
+ setState(() {
+ _selectedCurrencies = selected;
+ });
+ },
+ ),
+ if (_selectedCurrencyCodes.isNotEmpty) ...[
+ const SizedBox(height: 10),
+ CustomCurrencyChooser(
+ currencyController: customCurrencyController,
+ currencyCodes: _selectedCurrencyCodes,
+ // Podemos sobrescribir el del controlador si queremos
+ defaultCurrencyCode: 'EUR',
+ ),
+ const SizedBox(height: 10),
+ const Text('CustomCurrencyPicker'),
+ CustomCurrencyPicker(
+ currencyController: customCurrencyController,
+ currencyCodes: _selectedCurrencyCodes,
+ defaultCurrencyCode: 'USD',
+ ),
+ ListenableBuilder(
+ listenable: customCurrencyController.currencyNotifier,
+ builder: (context, child) {
+ return Text(
+ 'Custom seleccionada: ${customCurrencyController.currency.getDefaultView()}',
+ );
+ },
+ ),
+ ] else ...[
+ const Padding(
+ padding: EdgeInsets.all(8.0),
+ child: Text('Selecciona al menos una moneda arriba'),
+ ),
+ ],
+ const SizedBox(height: 40),
+ ],
+ ),
),
- ), // This trailing comma makes auto-formatting nicer for build methods.
- );
+ ), // closes SingleChildScrollView
+ ); // closes Scaffold
}
}
diff --git a/example/pubspec.lock b/example/pubspec.lock
index 632a0a2..4bb7cb3 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
- sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
+ sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
- version: "1.4.0"
+ version: "1.4.1"
clock:
dependency: transitive
description:
@@ -55,7 +55,7 @@ packages:
path: ".."
relative: true
source: path
- version: "1.0.0"
+ version: "1.0.8"
fake_async:
dependency: transitive
description:
@@ -118,18 +118,18 @@ packages:
dependency: transitive
description:
name: matcher
- sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
+ sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
- version: "0.12.17"
+ version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
- sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
+ sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
- version: "0.11.1"
+ version: "0.13.0"
meta:
dependency: transitive
description:
@@ -195,10 +195,10 @@ packages:
dependency: transitive
description:
name: test_api
- sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
+ sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
url: "https://pub.dev"
source: hosted
- version: "0.7.7"
+ version: "0.7.10"
vector_math:
dependency: transitive
description:
@@ -216,5 +216,5 @@ packages:
source: hosted
version: "15.0.0"
sdks:
- dart: ">=3.8.1 <4.0.0"
+ dart: ">=3.9.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
diff --git a/lib/currency_widget.dart b/lib/currency_widget.dart
index 0c23e37..095ee15 100644
--- a/lib/currency_widget.dart
+++ b/lib/currency_widget.dart
@@ -4,4 +4,8 @@ export 'package:currency_widget/src/view/currency_picker.dart';
export 'package:currency_widget/src/Controller/currency_controller.dart';
export 'package:currency_widget/src/view/currency_textview.dart';
export 'package:currency_widget/src/view/currency_textfield.dart';
-export 'package:currency_widget/src/view/currency_card_view_report.dart';
\ No newline at end of file
+export 'package:currency_widget/src/view/currency_card_view_report.dart';
+export 'package:currency_widget/src/view/currency_chooser.dart';
+export 'package:currency_widget/src/view/custom_currency_chooser.dart';
+export 'package:currency_widget/src/view/custom_currency_picker.dart';
+export 'package:currency_widget/src/view/currency_multi_selector.dart';
\ No newline at end of file
diff --git a/lib/src/Controller/currency_controller.dart b/lib/src/Controller/currency_controller.dart
index 25aefd8..11e3a30 100644
--- a/lib/src/Controller/currency_controller.dart
+++ b/lib/src/Controller/currency_controller.dart
@@ -7,10 +7,16 @@ class CurrencyController{
String lang;
/// Creates a new `CurrencyController` instance.
/// The `lang` parameter is required and specifies the language code for localization.
- CurrencyController({required this.lang});
+ /// The `initialCurrencyCode` parameter is optional and sets the initial currency.
+ CurrencyController({required this.lang, String? initialCurrencyCode}) {
+ if (initialCurrencyCode != null) {
+ currency = getCurrencyByCode(initialCurrencyCode);
+ }
+ }
ValueNotifier mount = ValueNotifier(0);
ValueNotifier _currency = ValueNotifier(null);
+ ValueNotifier get currencyNotifier => _currency;
Currency get currency => _currency.value??supportedCurrencies[0];
void set currency(Currency? currency){
_currency.value = currency;
diff --git a/lib/src/assets/supported_currencies.dart b/lib/src/assets/supported_currencies.dart
index 83f1a6c..899f8e3 100644
--- a/lib/src/assets/supported_currencies.dart
+++ b/lib/src/assets/supported_currencies.dart
@@ -11,6 +11,8 @@ final supportedCurrencies = [
emoji: "🇦🇪",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "AFN",
@@ -19,6 +21,8 @@ final supportedCurrencies = [
emoji: "🇦🇫",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ALL",
@@ -27,6 +31,8 @@ final supportedCurrencies = [
emoji: "🇦🇱",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "AMD",
@@ -35,6 +41,8 @@ final supportedCurrencies = [
emoji: "🇦🇲",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "AOA",
@@ -43,6 +51,8 @@ final supportedCurrencies = [
emoji: "🇦🇴",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ARS",
@@ -51,6 +61,8 @@ final supportedCurrencies = [
emoji: "🇦🇷",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "AUD",
@@ -59,6 +71,8 @@ final supportedCurrencies = [
emoji: "🇦🇺",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "AWG",
@@ -67,6 +81,8 @@ final supportedCurrencies = [
emoji: "🇦🇼",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "AZN",
@@ -75,6 +91,8 @@ final supportedCurrencies = [
emoji: "🇦🇿",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BAM",
@@ -83,6 +101,8 @@ final supportedCurrencies = [
emoji: "🇧🇦",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BBD",
@@ -91,6 +111,8 @@ final supportedCurrencies = [
emoji: "🇧🇧",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BDT",
@@ -99,6 +121,8 @@ final supportedCurrencies = [
emoji: "🇧🇩",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BGN",
@@ -107,6 +131,8 @@ final supportedCurrencies = [
emoji: "🇧🇬",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BHD",
@@ -115,6 +141,8 @@ final supportedCurrencies = [
emoji: "🇧🇭",
decimalDigits: 3,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BIF",
@@ -123,6 +151,8 @@ final supportedCurrencies = [
emoji: "🇧🇮",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BMD",
@@ -131,6 +161,8 @@ final supportedCurrencies = [
emoji: "🇧🇲",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BND",
@@ -139,6 +171,8 @@ final supportedCurrencies = [
emoji: "🇧🇳",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BOB",
@@ -147,6 +181,8 @@ final supportedCurrencies = [
emoji: "🇧🇴",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "BOV",
@@ -155,6 +191,8 @@ final supportedCurrencies = [
emoji: "🇧🇴",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BRL",
@@ -163,6 +201,8 @@ final supportedCurrencies = [
emoji: "🇧🇷",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "BSD",
@@ -171,6 +211,8 @@ final supportedCurrencies = [
emoji: "🇧🇸",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BTN",
@@ -179,6 +221,8 @@ final supportedCurrencies = [
emoji: "🇧🇹",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BWP",
@@ -187,6 +231,8 @@ final supportedCurrencies = [
emoji: "🇧🇼",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BYN",
@@ -195,6 +241,8 @@ final supportedCurrencies = [
emoji: "🇧🇾",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "BZD",
@@ -203,6 +251,8 @@ final supportedCurrencies = [
emoji: "🇧🇿",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "CAD",
@@ -211,6 +261,8 @@ final supportedCurrencies = [
emoji: "🇨🇦",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "CDF",
@@ -219,6 +271,8 @@ final supportedCurrencies = [
emoji: "🇨🇩",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "CHF",
@@ -227,6 +281,8 @@ final supportedCurrencies = [
emoji: "🇨🇭",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "CLF",
@@ -235,6 +291,8 @@ final supportedCurrencies = [
emoji: "🇨🇱",
decimalDigits: 4,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "CLP",
@@ -243,6 +301,8 @@ final supportedCurrencies = [
emoji: "🇨🇱",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "CNY",
@@ -251,6 +311,8 @@ final supportedCurrencies = [
emoji: "🇨🇳",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "COP",
@@ -259,6 +321,8 @@ final supportedCurrencies = [
emoji: "🇨🇴",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "COU",
@@ -267,6 +331,8 @@ final supportedCurrencies = [
emoji: "🇨🇴",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "CRC",
@@ -275,6 +341,8 @@ final supportedCurrencies = [
emoji: "🇨🇷",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "CUP",
@@ -283,6 +351,8 @@ final supportedCurrencies = [
emoji: "🇨🇺",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "CVE",
@@ -291,6 +361,8 @@ final supportedCurrencies = [
emoji: "🇨🇻",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "CZK",
@@ -299,6 +371,8 @@ final supportedCurrencies = [
emoji: "🇨🇿",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "DJF",
@@ -307,6 +381,8 @@ final supportedCurrencies = [
emoji: "🇩🇯",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "DKK",
@@ -315,6 +391,8 @@ final supportedCurrencies = [
emoji: "🇩🇰",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "DOP",
@@ -323,6 +401,8 @@ final supportedCurrencies = [
emoji: "🇩🇴",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "DZD",
@@ -331,6 +411,8 @@ final supportedCurrencies = [
emoji: "🇩🇿",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "EGP",
@@ -339,6 +421,8 @@ final supportedCurrencies = [
emoji: "🇪🇬",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ERN",
@@ -347,6 +431,8 @@ final supportedCurrencies = [
emoji: "🇪🇷",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ETB",
@@ -355,6 +441,8 @@ final supportedCurrencies = [
emoji: "🇪🇹",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "EUR",
@@ -363,6 +451,8 @@ final supportedCurrencies = [
emoji: "🇪🇺",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "FJD",
@@ -371,6 +461,8 @@ final supportedCurrencies = [
emoji: "🇫🇯",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "FKP",
@@ -379,6 +471,8 @@ final supportedCurrencies = [
emoji: "🇫🇰",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "GBP",
@@ -387,6 +481,8 @@ final supportedCurrencies = [
emoji: "🇬🇧",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "GEL",
@@ -395,6 +491,8 @@ final supportedCurrencies = [
emoji: "🇬🇪",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "GHS",
@@ -403,6 +501,8 @@ final supportedCurrencies = [
emoji: "🇬🇭",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "GIP",
@@ -411,6 +511,8 @@ final supportedCurrencies = [
emoji: "🇬🇮",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "GMD",
@@ -419,6 +521,8 @@ final supportedCurrencies = [
emoji: "🇬🇲",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "GNF",
@@ -427,6 +531,8 @@ final supportedCurrencies = [
emoji: "🇬🇳",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "GTQ",
@@ -435,6 +541,8 @@ final supportedCurrencies = [
emoji: "🇬🇹",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "GYD",
@@ -443,6 +551,8 @@ final supportedCurrencies = [
emoji: "🇬🇾",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "HKD",
@@ -451,6 +561,8 @@ final supportedCurrencies = [
emoji: "🇭🇰",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "HNL",
@@ -459,6 +571,8 @@ final supportedCurrencies = [
emoji: "🇭🇳",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "HTG",
@@ -467,6 +581,8 @@ final supportedCurrencies = [
emoji: "🇭🇹",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "HUF",
@@ -475,6 +591,8 @@ final supportedCurrencies = [
emoji: "🇭🇺",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "IDR",
@@ -483,6 +601,8 @@ final supportedCurrencies = [
emoji: "🇮🇩",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ILS",
@@ -491,6 +611,8 @@ final supportedCurrencies = [
emoji: "🇮🇱",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "INR",
@@ -499,6 +621,8 @@ final supportedCurrencies = [
emoji: "🇮🇳",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "IQD",
@@ -507,6 +631,8 @@ final supportedCurrencies = [
emoji: "🇮🇶",
decimalDigits: 3,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "IRR",
@@ -515,6 +641,8 @@ final supportedCurrencies = [
emoji: "🇮🇷",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ISK",
@@ -523,6 +651,8 @@ final supportedCurrencies = [
emoji: "🇮🇸",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "JMD",
@@ -531,6 +661,8 @@ final supportedCurrencies = [
emoji: "🇯🇲",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "JOD",
@@ -539,6 +671,8 @@ final supportedCurrencies = [
emoji: "🇯🇴",
decimalDigits: 3,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "JPY",
@@ -547,6 +681,8 @@ final supportedCurrencies = [
emoji: "🇯🇵",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KES",
@@ -555,14 +691,18 @@ final supportedCurrencies = [
emoji: "🇰🇪",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KGS",
name: "Kyrgyzstani som",
- symbol: "лв",
+ symbol: "с",
emoji: "🇰🇬",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KHR",
@@ -571,6 +711,8 @@ final supportedCurrencies = [
emoji: "🇰🇭",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KMF",
@@ -579,6 +721,8 @@ final supportedCurrencies = [
emoji: "🇰🇲",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KPW",
@@ -587,6 +731,8 @@ final supportedCurrencies = [
emoji: "🇰🇵",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KRW",
@@ -595,6 +741,8 @@ final supportedCurrencies = [
emoji: "🇰🇷",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KWD",
@@ -603,6 +751,8 @@ final supportedCurrencies = [
emoji: "🇰🇼",
decimalDigits: 3,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KYD",
@@ -611,6 +761,8 @@ final supportedCurrencies = [
emoji: "🇰🇾",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "KZT",
@@ -619,6 +771,8 @@ final supportedCurrencies = [
emoji: "🇰🇿",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "LAK",
@@ -627,6 +781,8 @@ final supportedCurrencies = [
emoji: "🇱🇦",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "LBP",
@@ -635,6 +791,8 @@ final supportedCurrencies = [
emoji: "🇱🇧",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "LKR",
@@ -643,6 +801,8 @@ final supportedCurrencies = [
emoji: "🇱🇰",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "LRD",
@@ -651,6 +811,8 @@ final supportedCurrencies = [
emoji: "🇱🇷",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "LSL",
@@ -659,6 +821,8 @@ final supportedCurrencies = [
emoji: "🇱🇸",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "LYD",
@@ -667,6 +831,8 @@ final supportedCurrencies = [
emoji: "🇱🇾",
decimalDigits: 3,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MAD",
@@ -675,6 +841,8 @@ final supportedCurrencies = [
emoji: "🇲🇦",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MDL",
@@ -683,6 +851,8 @@ final supportedCurrencies = [
emoji: "🇲🇩",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MGA",
@@ -691,6 +861,8 @@ final supportedCurrencies = [
emoji: "🇲🇬",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MKD",
@@ -699,6 +871,8 @@ final supportedCurrencies = [
emoji: "🇲🇰",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MMK",
@@ -707,6 +881,8 @@ final supportedCurrencies = [
emoji: "🇲🇲",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MNT",
@@ -715,6 +891,8 @@ final supportedCurrencies = [
emoji: "🇲🇳",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MOP",
@@ -723,6 +901,8 @@ final supportedCurrencies = [
emoji: "🇲🇴",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MRU",
@@ -731,6 +911,8 @@ final supportedCurrencies = [
emoji: "🇲🇷",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MUR",
@@ -739,6 +921,8 @@ final supportedCurrencies = [
emoji: "🇲🇺",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MVR",
@@ -747,6 +931,8 @@ final supportedCurrencies = [
emoji: "🇲🇻",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MWK",
@@ -755,6 +941,8 @@ final supportedCurrencies = [
emoji: "🇲🇼",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MXN",
@@ -763,6 +951,8 @@ final supportedCurrencies = [
emoji: "🇲🇽",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MXV",
@@ -771,6 +961,8 @@ final supportedCurrencies = [
emoji: "🇲🇽",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MYR",
@@ -779,6 +971,8 @@ final supportedCurrencies = [
emoji: "🇲🇾",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "MZN",
@@ -787,6 +981,8 @@ final supportedCurrencies = [
emoji: "🇲🇿",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "NAD",
@@ -795,6 +991,8 @@ final supportedCurrencies = [
emoji: "🇳🇦",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "NGN",
@@ -803,6 +1001,8 @@ final supportedCurrencies = [
emoji: "🇳🇬",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "NIO",
@@ -811,6 +1011,8 @@ final supportedCurrencies = [
emoji: "🇳🇮",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "NOK",
@@ -819,6 +1021,8 @@ final supportedCurrencies = [
emoji: "🇳🇴",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "NPR",
@@ -827,6 +1031,8 @@ final supportedCurrencies = [
emoji: "🇳🇵",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "NZD",
@@ -835,6 +1041,8 @@ final supportedCurrencies = [
emoji: "🇳🇿",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "OMR",
@@ -843,6 +1051,8 @@ final supportedCurrencies = [
emoji: "🇴🇲",
decimalDigits: 3,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "PAB",
@@ -851,6 +1061,8 @@ final supportedCurrencies = [
emoji: "🇵🇦",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "PEN",
@@ -859,6 +1071,8 @@ final supportedCurrencies = [
emoji: "🇵🇪",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "PGK",
@@ -867,6 +1081,8 @@ final supportedCurrencies = [
emoji: "🇵🇬",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "PHP",
@@ -875,6 +1091,8 @@ final supportedCurrencies = [
emoji: "🇵🇭",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "PKR",
@@ -883,6 +1101,8 @@ final supportedCurrencies = [
emoji: "🇵🇰",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "PLN",
@@ -891,6 +1111,8 @@ final supportedCurrencies = [
emoji: "🇵🇱",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "PYG",
@@ -899,6 +1121,8 @@ final supportedCurrencies = [
emoji: "🇵🇾",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "QAR",
@@ -907,6 +1131,8 @@ final supportedCurrencies = [
emoji: "🇶🇦",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "RON",
@@ -915,6 +1141,8 @@ final supportedCurrencies = [
emoji: "🇷🇴",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "RSD",
@@ -923,6 +1151,8 @@ final supportedCurrencies = [
emoji: "🇷🇸",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "RUB",
@@ -931,6 +1161,8 @@ final supportedCurrencies = [
emoji: "🇷🇺",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "RWF",
@@ -939,6 +1171,8 @@ final supportedCurrencies = [
emoji: "🇷🇼",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SAR",
@@ -947,6 +1181,8 @@ final supportedCurrencies = [
emoji: "🇸🇦",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SBD",
@@ -955,6 +1191,8 @@ final supportedCurrencies = [
emoji: "🇸🇧",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SCR",
@@ -963,6 +1201,8 @@ final supportedCurrencies = [
emoji: "🇸🇨",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SDG",
@@ -971,6 +1211,8 @@ final supportedCurrencies = [
emoji: "🇸🇩",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SEK",
@@ -979,6 +1221,8 @@ final supportedCurrencies = [
emoji: "🇸🇪",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SGD",
@@ -987,6 +1231,8 @@ final supportedCurrencies = [
emoji: "🇸🇬",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SHP",
@@ -995,6 +1241,8 @@ final supportedCurrencies = [
emoji: "🇸🇭",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SLE",
@@ -1003,6 +1251,8 @@ final supportedCurrencies = [
emoji: "🇸🇱",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SOS",
@@ -1011,6 +1261,8 @@ final supportedCurrencies = [
emoji: "🇸🇴",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SRD",
@@ -1019,6 +1271,8 @@ final supportedCurrencies = [
emoji: "🇸🇷",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SSP",
@@ -1027,6 +1281,8 @@ final supportedCurrencies = [
emoji: "🇸🇸",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "STN",
@@ -1035,6 +1291,8 @@ final supportedCurrencies = [
emoji: "🇸🇹",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SVC",
@@ -1043,6 +1301,8 @@ final supportedCurrencies = [
emoji: "🇸🇻",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SYP",
@@ -1051,6 +1311,8 @@ final supportedCurrencies = [
emoji: "🇸🇾",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "SZL",
@@ -1059,6 +1321,8 @@ final supportedCurrencies = [
emoji: "🇸🇿",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "THB",
@@ -1067,6 +1331,8 @@ final supportedCurrencies = [
emoji: "🇹🇭",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "TJS",
@@ -1075,6 +1341,8 @@ final supportedCurrencies = [
emoji: "🇹🇯",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "TMT",
@@ -1083,6 +1351,8 @@ final supportedCurrencies = [
emoji: "🇹🇲",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "TND",
@@ -1091,6 +1361,8 @@ final supportedCurrencies = [
emoji: "🇹🇳",
decimalDigits: 3,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "TOP",
@@ -1099,6 +1371,8 @@ final supportedCurrencies = [
emoji: "🇹🇴",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "TRY",
@@ -1107,6 +1381,8 @@ final supportedCurrencies = [
emoji: "🇹🇷",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "TTD",
@@ -1115,6 +1391,8 @@ final supportedCurrencies = [
emoji: "🇹🇹",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "TWD",
@@ -1123,6 +1401,8 @@ final supportedCurrencies = [
emoji: "🇹🇼",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "TZS",
@@ -1131,6 +1411,8 @@ final supportedCurrencies = [
emoji: "🇹🇿",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "UAH",
@@ -1139,6 +1421,8 @@ final supportedCurrencies = [
emoji: "🇺🇦",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "UGX",
@@ -1147,6 +1431,8 @@ final supportedCurrencies = [
emoji: "🇺🇬",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "USD",
@@ -1155,6 +1441,8 @@ final supportedCurrencies = [
emoji: "🇺🇸",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "USN",
@@ -1163,6 +1451,8 @@ final supportedCurrencies = [
emoji: "🇺🇸",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "UYI",
@@ -1171,6 +1461,8 @@ final supportedCurrencies = [
emoji: "🇺🇾",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "UYU",
@@ -1179,6 +1471,8 @@ final supportedCurrencies = [
emoji: "🇺🇾",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "UYW",
@@ -1187,14 +1481,18 @@ final supportedCurrencies = [
emoji: "🇺🇾",
decimalDigits: 4,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "UZS",
name: "Uzbekistani soʻm",
- symbol: "лв",
+ symbol: "so'm",
emoji: "🇺🇿",
decimalDigits: 2,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "VES",
@@ -1203,6 +1501,8 @@ final supportedCurrencies = [
emoji: "🇻🇪",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ".",
+ decimalSeparator: ",",
),
Currency(
code: "VND",
@@ -1211,6 +1511,8 @@ final supportedCurrencies = [
emoji: "🇻🇳",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "VUV",
@@ -1219,6 +1521,8 @@ final supportedCurrencies = [
emoji: "🇻🇺",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "WST",
@@ -1227,6 +1531,8 @@ final supportedCurrencies = [
emoji: "🇼🇸",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XAF",
@@ -1235,6 +1541,8 @@ final supportedCurrencies = [
emoji: "🇨🇲",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XAG",
@@ -1243,6 +1551,8 @@ final supportedCurrencies = [
emoji: "🪙",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XAU",
@@ -1251,6 +1561,8 @@ final supportedCurrencies = [
emoji: "🪙",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XBA",
@@ -1259,6 +1571,8 @@ final supportedCurrencies = [
emoji: "🇪🇺",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XBB",
@@ -1267,6 +1581,8 @@ final supportedCurrencies = [
emoji: "🇪🇺",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XBC",
@@ -1275,6 +1591,8 @@ final supportedCurrencies = [
emoji: "🇪🇺",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XBD",
@@ -1283,6 +1601,8 @@ final supportedCurrencies = [
emoji: "🇪🇺",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XCD",
@@ -1291,6 +1611,8 @@ final supportedCurrencies = [
emoji: "🇰🇳",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XDR",
@@ -1299,6 +1621,8 @@ final supportedCurrencies = [
emoji: "🏦",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XOF",
@@ -1307,6 +1631,8 @@ final supportedCurrencies = [
emoji: "🇨🇮",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XPD",
@@ -1315,6 +1641,8 @@ final supportedCurrencies = [
emoji: "🪙",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XPF",
@@ -1323,6 +1651,8 @@ final supportedCurrencies = [
emoji: "🇵🇫",
decimalDigits: 0,
position: "last",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XPT",
@@ -1331,6 +1661,8 @@ final supportedCurrencies = [
emoji: "🪙",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XSU",
@@ -1339,6 +1671,8 @@ final supportedCurrencies = [
emoji: "🇪🇨",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XTS",
@@ -1347,6 +1681,8 @@ final supportedCurrencies = [
emoji: "❓",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "XUA",
@@ -1355,6 +1691,8 @@ final supportedCurrencies = [
emoji: "🏦",
decimalDigits: 0,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "YER",
@@ -1363,6 +1701,8 @@ final supportedCurrencies = [
emoji: "🇾🇪",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ZAR",
@@ -1371,6 +1711,8 @@ final supportedCurrencies = [
emoji: "🇿🇦",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ZMW",
@@ -1379,6 +1721,8 @@ final supportedCurrencies = [
emoji: "🇿🇲",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
Currency(
code: "ZWL",
@@ -1387,5 +1731,7 @@ final supportedCurrencies = [
emoji: "🇿🇼",
decimalDigits: 2,
position: "first",
+ thousandSeparator: ",",
+ decimalSeparator: ".",
),
];
diff --git a/lib/src/models/currency.dart b/lib/src/models/currency.dart
index affc1e4..bfdc0d8 100644
--- a/lib/src/models/currency.dart
+++ b/lib/src/models/currency.dart
@@ -7,6 +7,8 @@ class Currency{
String emoji;
int decimalDigits;
String position;
+ String thousandSeparator;
+ String decimalSeparator;
Currency({
required this.code,
@@ -14,7 +16,9 @@ class Currency{
required this.symbol,
required this.emoji,
required this.decimalDigits,
- required this.position
+ required this.position,
+ this.thousandSeparator = ',',
+ this.decimalSeparator = '.',
});
factory Currency.fromJson(Map json) {
@@ -25,6 +29,8 @@ class Currency{
emoji: json['emoji'] as String? ?? '',
decimalDigits: json['decimal_digits'] as int? ?? 0,
position: json['position'] as String? ?? '',
+ thousandSeparator: json['thousand_separator'] as String? ?? ',',
+ decimalSeparator: json['decimal_separator'] as String? ?? '.',
);
}
@@ -37,6 +43,8 @@ class Currency{
'emoji': emoji,
'decimal_digits': decimalDigits,
'position': position,
+ 'thousand_separator': thousandSeparator,
+ 'decimal_separator': decimalSeparator,
};
}
diff --git a/lib/src/utils/currency_format_utils.dart b/lib/src/utils/currency_format_utils.dart
new file mode 100644
index 0000000..3462e82
--- /dev/null
+++ b/lib/src/utils/currency_format_utils.dart
@@ -0,0 +1,38 @@
+import '../models/currency.dart';
+
+class CurrencyFormatUtils {
+ /// Formats a [double] amount into a string using the [Currency] object's separators.
+ static String formatAmount(double amount, Currency currency) {
+ String integerPart;
+ String decimalPart = '';
+
+ final decimalDigits = currency.decimalDigits;
+ final decimalSeparator = currency.decimalSeparator;
+ final thousandSeparator = currency.thousandSeparator;
+
+ // Convert to fixed string with proper decimal digits
+ String fixedString = amount.toStringAsFixed(decimalDigits);
+
+ List parts = fixedString.split('.');
+ integerPart = parts[0];
+ if (parts.length > 1) {
+ decimalPart = parts[1];
+ }
+
+ // Apply thousands separator
+ String formattedInt = '';
+ for (int i = 0; i < integerPart.length; i++) {
+ final reversedIndex = integerPart.length - i - 1;
+ formattedInt = integerPart[reversedIndex] + formattedInt;
+ if ((i + 1) % 3 == 0 && reversedIndex != 0 && integerPart[reversedIndex - 1] != '-') {
+ formattedInt = thousandSeparator + formattedInt;
+ }
+ }
+
+ if (decimalDigits == 0) {
+ return formattedInt;
+ } else {
+ return '$formattedInt$decimalSeparator$decimalPart';
+ }
+ }
+}
diff --git a/lib/src/utils/currency_picker_utils.dart b/lib/src/utils/currency_picker_utils.dart
new file mode 100644
index 0000000..cb26f18
--- /dev/null
+++ b/lib/src/utils/currency_picker_utils.dart
@@ -0,0 +1,58 @@
+import 'package:currency_widget/currency_widget.dart';
+import 'package:currency_widget/src/assets/supported_currencies.dart';
+import 'package:currency_widget/src/utils/common_currencies.dart';
+import 'package:flutter/material.dart';
+
+/// Returns the filtered list of currencies based on [showOnlyCommon].
+List filteredCurrencies(bool showOnlyCommon) {
+ if (showOnlyCommon) {
+ return supportedCurrencies
+ .where((c) => commonCurrencyCodes.contains(c.code.toUpperCase()))
+ .toList();
+ }
+ return supportedCurrencies;
+}
+
+/// Returns the filtered list of currencies based on a custom list of [codes].
+List customFilteredCurrencies(List codes) {
+ final upperCodes = codes.map((c) => c.toUpperCase()).toList();
+ return supportedCurrencies
+ .where((c) => upperCodes.contains(c.code.toUpperCase()))
+ .toList();
+}
+
+/// Returns the localized tooltip text for the common/all toggle button.
+String currencyFilterTooltip(String lang, bool showOnlyCommon) {
+ const Map> translations = {
+ 'en': {'common': 'Most used', 'all': 'All currencies'},
+ 'es': {'common': 'Más usadas', 'all': 'Todas'},
+ 'pt': {'common': 'Mais usadas', 'all': 'Todas'},
+ 'fr': {'common': 'Plus utilisées', 'all': 'Toutes'},
+ 'de': {'common': 'Meist genutzt', 'all': 'Alle'},
+ 'it': {'common': 'Più usate', 'all': 'Tutte'},
+ 'ru': {'common': 'Популярные', 'all': 'Все'},
+ 'zh': {'common': '常用', 'all': '全部'},
+ 'ja': {'common': 'よく使われる', 'all': 'すべて'},
+ 'ko': {'common': '자주 사용됨', 'all': '모두'},
+ 'ar': {'common': 'الأكثر استخداماً', 'all': 'الكل'},
+ 'hi': {'common': 'अधिक उपयोग', 'all': 'सभी'},
+ 'id': {'common': 'Paling banyak digunakan', 'all': 'Semua'},
+ 'ur': {'common': 'سب سے زیادہ استعمال', 'all': 'تمام'},
+ };
+ final t = translations[lang.toLowerCase()] ?? translations['en']!;
+ return showOnlyCommon ? t['common']! : t['all']!;
+}
+
+/// Builds the [DropdownMenuItem] list for a given [currencies] list.
+List> currencyDropdownItems(
+ List currencies) {
+ return currencies.map((Currency currency) {
+ return DropdownMenuItem(
+ value: currency,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 15),
+ child: Text(currency.getDefaultView()),
+ ),
+ );
+ }).toList();
+}
diff --git a/lib/src/utils/masked_text_editing_controller.dart b/lib/src/utils/masked_text_editing_controller.dart
index d91b6be..7cc3b14 100644
--- a/lib/src/utils/masked_text_editing_controller.dart
+++ b/lib/src/utils/masked_text_editing_controller.dart
@@ -20,27 +20,43 @@ class AutoDecimalNumberFormatter extends TextInputFormatter {
/// - `thousandSeparator`: ','
AutoDecimalNumberFormatter({
this.decimalDigits = 2,
- this.decimalSeparator = '.',
- this.thousandSeparator = ',',
+ required this.decimalSeparator,
+ required this.thousandSeparator,
});
@override
TextEditingValue formatEditUpdate(
- TextEditingValue oldValue,
- TextEditingValue newValue,
- ) {
+ TextEditingValue oldValue,
+ TextEditingValue newValue,
+ ) {
// Permitir borrado completo
if (newValue.text.isEmpty) {
- return newValue.copyWith(selection: const TextSelection.collapsed(offset: 0));
+ return newValue.copyWith(
+ selection: const TextSelection.collapsed(offset: 0));
}
// Solo permitir dígitos
final digitsOnly = newValue.text.replaceAll(RegExp(r'[^\d]'), '');
if (digitsOnly.isEmpty) {
- return newValue.copyWith(text: '');
+ return const TextEditingValue(
+ text: '',
+ selection: TextSelection.collapsed(offset: 0),
+ );
}
- // Calcular posición del cursor
- final cursorPosition = newValue.selection.baseOffset;
+ // Guardar la posición del cursor original
+ // Si hay una selección (rango), usar el final de la selección
+ final oldCursorPosition = newValue.selection.isCollapsed
+ ? newValue.selection.baseOffset
+ : newValue.selection.end;
+
+ // Contar cuántos dígitos hay DESPUÉS del cursor en el texto sin formatear
+ // Esto mantiene la posición relativa desde el final
+ int digitsAfterCursor = 0;
+ for (int i = oldCursorPosition; i < newValue.text.length; i++) {
+ if (RegExp(r'\d').hasMatch(newValue.text[i])) {
+ digitsAfterCursor++;
+ }
+ }
// Separar parte entera y decimal
String integerPart;
@@ -80,11 +96,26 @@ class AutoDecimalNumberFormatter extends TextInputFormatter {
: '$formattedInt$decimalSeparator$decimalPart';
// Calcular nueva posición del cursor
- int newCursorPosition = formatted.length;
- if (cursorPosition > 0 && cursorPosition <= newValue.text.length) {
- // Lógica para mantener el cursor en una posición relativa
- final relativePosition = cursorPosition / newValue.text.length;
- newCursorPosition = (formatted.length * relativePosition).round();
+ int newCursorPosition;
+
+ // Caso especial: si no hay dígitos después del cursor, poner al final
+ if (digitsAfterCursor == 0) {
+ newCursorPosition = formatted.length;
+ } else {
+ // Contar dígitos desde el final para encontrar la posición correcta
+ int digitCount = 0;
+ newCursorPosition = formatted.length;
+
+ for (int i = formatted.length - 1; i >= 0; i--) {
+ if (RegExp(r'\d').hasMatch(formatted[i])) {
+ digitCount++;
+ if (digitCount == digitsAfterCursor) {
+ // El cursor debe ir ANTES de este dígito
+ newCursorPosition = i;
+ break;
+ }
+ }
+ }
}
return TextEditingValue(
diff --git a/lib/src/view/currency_card_view_report.dart b/lib/src/view/currency_card_view_report.dart
index 28eded2..6209d01 100644
--- a/lib/src/view/currency_card_view_report.dart
+++ b/lib/src/view/currency_card_view_report.dart
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../../currency_widget.dart';
+import '../utils/currency_format_utils.dart';
class CurrencyCardReport extends StatefulWidget {
final String title;
@@ -38,8 +39,10 @@ class _CurrencyCardReportState extends State {
currencyController.currency = currency;
textController = TextEditingController(
- text: currencyController.mount.value
- ?.toStringAsFixed(currency?.decimalDigits ?? 0),
+ text: currencyController.mount.value != null && currency != null
+ ? CurrencyFormatUtils.formatAmount(
+ currencyController.mount.value!, currency!)
+ : '',
);
}
diff --git a/lib/src/view/currency_chooser.dart b/lib/src/view/currency_chooser.dart
new file mode 100644
index 0000000..eebcef8
--- /dev/null
+++ b/lib/src/view/currency_chooser.dart
@@ -0,0 +1,96 @@
+import 'package:currency_widget/currency_widget.dart';
+import 'package:currency_widget/src/assets/currencies_names/currencies_names.dart';
+import 'package:currency_widget/src/utils/currency_picker_utils.dart';
+import 'package:flutter/material.dart';
+
+/// A widget that allows the user to select a currency without requiring an amount.
+///
+/// Use [CurrencyChooser] when you only need the user to pick a currency,
+/// without any amount input. The selected [Currency] is exposed through
+/// the [currencyController].
+///
+/// Example:
+/// ```dart
+/// CurrencyChooser(currencyController: CurrencyController(lang: 'en'))
+/// ```
+class CurrencyChooser extends StatefulWidget {
+ final CurrencyController currencyController;
+
+ const CurrencyChooser({super.key, required this.currencyController});
+
+ @override
+ State createState() => _CurrencyChooserState();
+}
+
+class _CurrencyChooserState extends State {
+ List _currencies = [];
+ bool _showOnlyCommon = true;
+
+ @override
+ void initState() {
+ super.initState();
+ _updateCurrencyList();
+ widget.currencyController.currency = _currencies[0];
+ }
+
+ void _updateCurrencyList() {
+ _currencies = filteredCurrencies(_showOnlyCommon);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ margin: const EdgeInsets.all(10),
+ child: ListTile(
+ title: Row(
+ children: [
+ Expanded(child: _buildDropdown()),
+ Tooltip(
+ message: _getTooltipText(),
+ child: IconButton(
+ icon: Icon(
+ _showOnlyCommon ? Icons.star : Icons.public,
+ size: 22,
+ ),
+ onPressed: () {
+ setState(() {
+ _showOnlyCommon = !_showOnlyCommon;
+ _updateCurrencyList();
+ if (!_currencies
+ .contains(widget.currencyController.currency)) {
+ widget.currencyController.currency = _currencies[0];
+ }
+ });
+ },
+ ),
+ ),
+ ],
+ ),
+ subtitle: Text(
+ countryNames(
+ widget.currencyController.lang,
+ widget.currencyController.currency.code,
+ ),
+ style: const TextStyle(fontSize: 13),
+ ),
+ ),
+ );
+ }
+
+ DropdownButton _buildDropdown() {
+ return DropdownButton(
+ value: widget.currencyController.currency,
+ onChanged: (Currency? newValue) {
+ if (newValue == null) return;
+ setState(() {
+ widget.currencyController.currency = newValue;
+ });
+ },
+ items: currencyDropdownItems(_currencies),
+ );
+ }
+
+ String _getTooltipText() {
+ return currencyFilterTooltip(widget.currencyController.lang, _showOnlyCommon);
+ }
+}
diff --git a/lib/src/view/currency_multi_selector.dart b/lib/src/view/currency_multi_selector.dart
new file mode 100644
index 0000000..ccd41b8
--- /dev/null
+++ b/lib/src/view/currency_multi_selector.dart
@@ -0,0 +1,107 @@
+import 'package:currency_widget/currency_widget.dart';
+import 'package:currency_widget/src/utils/currency_picker_utils.dart';
+import 'package:flutter/material.dart';
+
+/// A widget that displays currencies as actionable chips in a Wrap layout,
+/// allowing the user to select multiple currencies.
+class CurrencyMultiSelector extends StatefulWidget {
+ /// Callback fired when the selection changes.
+ final ValueChanged> onChanged;
+
+ /// The initially selected currencies.
+ final List initialSelected;
+
+ /// If true, shows only the most common currencies. If false, shows all supported currencies.
+ final bool showOnlyCommon;
+
+ /// The language code for tooltips (e.g., 'en', 'es').
+ final String lang;
+
+ const CurrencyMultiSelector({
+ super.key,
+ required this.onChanged,
+ this.initialSelected = const [],
+ this.showOnlyCommon = true,
+ this.lang = 'en',
+ });
+
+ @override
+ State createState() => _CurrencyMultiSelectorState();
+}
+
+class _CurrencyMultiSelectorState extends State {
+ late List _availableCurrencies;
+ late Set _selectedCurrencies;
+
+ late bool _showOnlyCommon;
+
+ @override
+ void initState() {
+ super.initState();
+ _showOnlyCommon = widget.showOnlyCommon;
+ _selectedCurrencies = Set.from(widget.initialSelected);
+ _availableCurrencies = filteredCurrencies(_showOnlyCommon);
+ }
+
+ @override
+ void didUpdateWidget(covariant CurrencyMultiSelector oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if (widget.showOnlyCommon != oldWidget.showOnlyCommon) {
+ _showOnlyCommon = widget.showOnlyCommon;
+ _availableCurrencies = filteredCurrencies(_showOnlyCommon);
+ }
+ }
+
+ void _toggleSelection(Currency currency) {
+ setState(() {
+ if (_selectedCurrencies.contains(currency)) {
+ _selectedCurrencies.remove(currency);
+ } else {
+ _selectedCurrencies.add(currency);
+ }
+ });
+ widget.onChanged(_selectedCurrencies.toList());
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ Tooltip(
+ message: currencyFilterTooltip(widget.lang, _showOnlyCommon),
+ child: IconButton(
+ icon: Icon(
+ _showOnlyCommon ? Icons.star : Icons.public,
+ size: 22,
+ ),
+ onPressed: () {
+ setState(() {
+ _showOnlyCommon = !_showOnlyCommon;
+ _availableCurrencies = filteredCurrencies(_showOnlyCommon);
+ });
+ },
+ ),
+ ),
+ ],
+ ),
+ Wrap(
+ spacing: 8.0,
+ runSpacing: 8.0,
+ children: _availableCurrencies.map((currency) {
+ final isSelected = _selectedCurrencies.contains(currency);
+ return FilterChip(
+ label: Text(currency.getDefaultView()),
+ selected: isSelected,
+ onSelected: (_) => _toggleSelection(currency),
+ );
+ }).toList(),
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/src/view/currency_picker.dart b/lib/src/view/currency_picker.dart
index b147ad2..445ff7d 100644
--- a/lib/src/view/currency_picker.dart
+++ b/lib/src/view/currency_picker.dart
@@ -1,13 +1,14 @@
import 'package:currency_widget/currency_widget.dart';
import 'package:currency_widget/src/assets/currencies_names/currencies_names.dart';
-import 'package:currency_widget/src/assets/supported_currencies.dart';
-import 'package:currency_widget/src/utils/common_currencies.dart';
+import 'package:currency_widget/src/utils/currency_format_utils.dart';
+import 'package:currency_widget/src/utils/currency_picker_utils.dart';
import 'package:currency_widget/src/utils/masked_text_editing_controller.dart';
import 'package:flutter/material.dart';
class CurrencyPicker extends StatefulWidget {
final CurrencyController currencyController;
- const CurrencyPicker({super.key, required this.currencyController});
+ final String? defaultCurrencyCode;
+ const CurrencyPicker({super.key, required this.currencyController, this.defaultCurrencyCode});
@override
State createState() => _CurrencyPicker();
@@ -22,49 +23,31 @@ class _CurrencyPicker extends State {
void initState() {
super.initState();
_updateCurrencyList();
- widget.currencyController.currency = _currencies[0];
+
+ if (widget.defaultCurrencyCode != null) {
+ final defaultCurrency = _currencies.firstWhere(
+ (c) =>
+ c.code.toLowerCase() == widget.defaultCurrencyCode!.toLowerCase(),
+ orElse: () => _currencies[0],
+ );
+ widget.currencyController.currency = defaultCurrency;
+ } else if (widget.currencyController.currencyNotifier.value == null) {
+ widget.currencyController.currency = _currencies[0];
+ }
// Initialize controller with current value
+ final mount = widget.currencyController.mount.value;
controller = TextEditingController(
- text: widget.currencyController.mount.value != null &&
- widget.currencyController.mount.value! > 0
- ? widget.currencyController.mount.value.toString()
+ text: mount != null && mount > 0
+ ? CurrencyFormatUtils.formatAmount(
+ mount, widget.currencyController.currency)
: '',
);
- // Listen to mount changes to update TextField
- widget.currencyController.mount.addListener(_onMountChanged);
- }
-
- void _onMountChanged() {
- final mount = widget.currencyController.mount.value;
- if (mount != null && mount > 0) {
- final formatted = mount.toStringAsFixed(
- widget.currencyController.currency.decimalDigits,
- );
- if (controller.text != formatted) {
- // Remover listener temporalmente para evitar loops
- widget.currencyController.mount.removeListener(_onMountChanged);
-
- controller.text = formatted;
- // Poner cursor al final para evitar auto-selección
- controller.selection = TextSelection.collapsed(offset: formatted.length);
-
- // Re-agregar listener
- widget.currencyController.mount.addListener(_onMountChanged);
- }
- }
}
void _updateCurrencyList() {
- if (_showOnlyCommon) {
- _currencies = supportedCurrencies
- .where((currency) =>
- commonCurrencyCodes.contains(currency.code.toUpperCase()))
- .toList();
- } else {
- _currencies = supportedCurrencies;
- }
+ _currencies = filteredCurrencies(_showOnlyCommon);
}
@override
@@ -103,6 +86,7 @@ class _CurrencyPicker extends State {
controller: controller,
keyboardType: TextInputType.number,
textAlign: TextAlign.center,
+ enableInteractiveSelection: true,
decoration: InputDecoration(
hintText: 0.toStringAsFixed(
widget.currencyController.currency.decimalDigits),
@@ -122,9 +106,12 @@ class _CurrencyPicker extends State {
widget.currencyController.mount.value = 0;
return;
}
+ final currency = widget.currencyController.currency;
try {
// Usar str en lugar de controller.text para evitar conflictos
- String value = str.replaceAll(',', '');
+ String value = str
+ .replaceAll(currency.thousandSeparator, '')
+ .replaceAll(currency.decimalSeparator, '.');
widget.currencyController.mount.value = double.parse(value);
} catch (e) {
// Invalid input, ignore
@@ -133,8 +120,13 @@ class _CurrencyPicker extends State {
},
inputFormatters: [
AutoDecimalNumberFormatter(
- decimalDigits:
- widget.currencyController.currency.decimalDigits),
+ decimalDigits:
+ widget.currencyController.currency.decimalDigits,
+ thousandSeparator:
+ widget.currencyController.currency.thousandSeparator,
+ decimalSeparator:
+ widget.currencyController.currency.decimalSeparator,
+ ),
],
),
),
@@ -150,14 +142,7 @@ class _CurrencyPicker extends State {
onChanged: (Currency? newValue) async {
chooseCurrency(newValue!);
},
- items: _currencies.map((Currency currency) {
- return DropdownMenuItem(
- value: currency,
- child: Padding(
- padding: const EdgeInsets.only(left: 15, right: 15),
- child: Text(currency.getDefaultView())),
- );
- }).toList(),
+ items: currencyDropdownItems(_currencies),
);
}
@@ -169,41 +154,18 @@ class _CurrencyPicker extends State {
// Update TextField formatting when currency changes
final mount = widget.currencyController.mount.value;
if (mount != null && mount > 0) {
- controller.text = mount.toStringAsFixed(selected.decimalDigits);
+ controller.text = CurrencyFormatUtils.formatAmount(mount, selected);
}
});
}
@override
void dispose() {
- widget.currencyController.mount.removeListener(_onMountChanged);
controller.dispose();
super.dispose();
}
String _getTooltipText() {
- final lang = widget.currencyController.lang.toLowerCase();
- final isCommon = _showOnlyCommon;
-
- // Translations for tooltip using the same locale system as countryNames
- final Map> translations = {
- 'en': {'common': 'Most used', 'all': 'All currencies'},
- 'es': {'common': 'Más usadas', 'all': 'Todas'},
- 'pt': {'common': 'Mais usadas', 'all': 'Todas'},
- 'fr': {'common': 'Plus utilisées', 'all': 'Toutes'},
- 'de': {'common': 'Meist genutzt', 'all': 'Alle'},
- 'it': {'common': 'Più usate', 'all': 'Tutte'},
- 'ru': {'common': 'Популярные', 'all': 'Все'},
- 'zh': {'common': '常用', 'all': '全部'},
- 'ja': {'common': 'よく使われる', 'all': 'すべて'},
- 'ko': {'common': '자주 사용됨', 'all': '모두'},
- 'ar': {'common': 'الأكثر استخداماً', 'all': 'الكل'},
- 'hi': {'common': 'अधिक उपयोग', 'all': 'सभी'},
- 'id': {'common': 'Paling banyak digunakan', 'all': 'Semua'},
- 'ur': {'common': 'سب سے زیادہ استعمال', 'all': 'تمام'},
- };
-
- final langTranslations = translations[lang] ?? translations['en']!;
- return isCommon ? langTranslations['common']! : langTranslations['all']!;
+ return currencyFilterTooltip(widget.currencyController.lang, _showOnlyCommon);
}
}
diff --git a/lib/src/view/currency_textfield.dart b/lib/src/view/currency_textfield.dart
index 56f2b28..37f746c 100644
--- a/lib/src/view/currency_textfield.dart
+++ b/lib/src/view/currency_textfield.dart
@@ -4,15 +4,18 @@ import 'package:flutter/material.dart';
import '../../currency_widget.dart';
import '../utils/currency_errors.dart';
import '../utils/masked_text_editing_controller.dart';
+import '../utils/currency_format_utils.dart';
class CurrencyTextField extends StatefulWidget {
final String currencyCode;
final CurrencyController? currencyController;
+ final double? defaultAmount;
const CurrencyTextField({
super.key,
required this.currencyCode,
required this.currencyController,
+ this.defaultAmount,
});
@override
@@ -26,8 +29,39 @@ class _CurrencyTextFieldState extends State {
@override
void initState() {
super.initState();
- controller = TextEditingController();
- currency = widget.currencyController!.getCurrencyByCode(widget.currencyCode);
+ _updateCurrency();
+
+ if (widget.defaultAmount != null &&
+ (widget.currencyController?.mount.value == null ||
+ widget.currencyController?.mount.value == 0)) {
+ widget.currencyController?.mount.value = widget.defaultAmount;
+ }
+
+ final initialMount = widget.currencyController?.mount.value;
+ controller = TextEditingController(
+ text: initialMount != null && initialMount > 0 && currency != null
+ ? CurrencyFormatUtils.formatAmount(initialMount, currency!)
+ : '',
+ );
+ }
+
+ void _updateCurrency() {
+ currency =
+ widget.currencyController?.getCurrencyByCode(widget.currencyCode);
+ }
+
+ @override
+ void didUpdateWidget(covariant CurrencyTextField oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if (widget.currencyCode != oldWidget.currencyCode) {
+ setState(() {
+ _updateCurrency();
+ final mount = widget.currencyController?.mount.value;
+ if (mount != null && mount > 0 && currency != null) {
+ controller.text = CurrencyFormatUtils.formatAmount(mount, currency!);
+ }
+ });
+ }
}
@override
@@ -56,6 +90,7 @@ class _CurrencyTextFieldState extends State {
enabled: true,
// Set readOnly to false to allow user input.
readOnly: false,
+ enableInteractiveSelection: true,
textAlign: currency!.position == 'first'
? TextAlign.start
: currency!.position == 'last'
@@ -66,7 +101,10 @@ class _CurrencyTextFieldState extends State {
controller: controller,
onChanged: (str) {
// Usar str en lugar de controller.text para evitar conflictos
- String value = str.replaceAll(',', '');
+ // Remover separador de miles y reemplazar separador decimal por punto para parsear
+ String value = str
+ .replaceAll(currency!.thousandSeparator, '')
+ .replaceAll(currency!.decimalSeparator, '.');
try {
widget.currencyController!.mount.value =
double.parse(value);
@@ -78,6 +116,8 @@ class _CurrencyTextFieldState extends State {
inputFormatters: [
AutoDecimalNumberFormatter(
decimalDigits: currency!.decimalDigits,
+ thousandSeparator: currency!.thousandSeparator,
+ decimalSeparator: currency!.decimalSeparator,
),
])),
)
diff --git a/lib/src/view/currency_textview.dart b/lib/src/view/currency_textview.dart
index 8884341..8308f0c 100644
--- a/lib/src/view/currency_textview.dart
+++ b/lib/src/view/currency_textview.dart
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import '../../currency_widget.dart';
import '../utils/currency_errors.dart';
+import '../utils/currency_format_utils.dart';
///[CurrencyTextView]
///
@@ -40,6 +41,7 @@ class _CurrencyTextViewState extends State {
@override
void initState() {
super.initState();
+ controller = TextEditingController();
_updateCurrency();
_updateController();
}
@@ -62,7 +64,9 @@ class _CurrencyTextViewState extends State {
}
void _updateController() {
- controller.text = widget.mount.toStringAsFixed(currency?.decimalDigits ?? 0);
+ controller.text = currency != null
+ ? CurrencyFormatUtils.formatAmount(widget.mount, currency!)
+ : widget.mount.toStringAsFixed(0);
}
@override
diff --git a/lib/src/view/custom_currency_chooser.dart b/lib/src/view/custom_currency_chooser.dart
new file mode 100644
index 0000000..2089026
--- /dev/null
+++ b/lib/src/view/custom_currency_chooser.dart
@@ -0,0 +1,112 @@
+import 'package:currency_widget/currency_widget.dart';
+import 'package:currency_widget/src/assets/currencies_names/currencies_names.dart';
+import 'package:currency_widget/src/utils/currency_picker_utils.dart';
+import 'package:flutter/material.dart';
+
+/// A widget that allows the user to select a currency from a custom list.
+///
+/// Use [CustomCurrencyChooser] when you want to restrict the selectable
+/// currencies to a specific list of currency codes (e.g., `['USD', 'EUR']`).
+class CustomCurrencyChooser extends StatefulWidget {
+ final CurrencyController currencyController;
+ final List currencyCodes;
+ final String? defaultCurrencyCode;
+
+ const CustomCurrencyChooser({
+ super.key,
+ required this.currencyController,
+ required this.currencyCodes,
+ this.defaultCurrencyCode,
+ });
+
+ @override
+ State createState() => _CustomCurrencyChooserState();
+}
+
+class _CustomCurrencyChooserState extends State {
+ List _currencies = [];
+
+ @override
+ void initState() {
+ super.initState();
+ _updateCurrencyList();
+
+ if (widget.defaultCurrencyCode != null) {
+ final defaultCurrency = _currencies.firstWhere(
+ (c) =>
+ c.code.toLowerCase() == widget.defaultCurrencyCode!.toLowerCase(),
+ orElse: () => _currencies.isNotEmpty ? _currencies[0] : _currencies[0],
+ );
+ widget.currencyController.currency = defaultCurrency;
+ } else if (widget.currencyController.currencyNotifier.value == null &&
+ _currencies.isNotEmpty) {
+ widget.currencyController.currency = _currencies[0];
+ }
+
+ // Ensure the selected currency is within the allowed list
+ if (_currencies.isNotEmpty &&
+ !_currencies.contains(widget.currencyController.currency)) {
+ widget.currencyController.currency = _currencies[0];
+ }
+ }
+
+ void _updateCurrencyList() {
+ _currencies = customFilteredCurrencies(widget.currencyCodes);
+ }
+
+ @override
+ void didUpdateWidget(covariant CustomCurrencyChooser oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if (widget.currencyCodes != oldWidget.currencyCodes) {
+ setState(() {
+ _updateCurrencyList();
+ if (_currencies.isNotEmpty && !_currencies.contains(widget.currencyController.currency)) {
+ widget.currencyController.currency = _currencies[0];
+ }
+ });
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ if (_currencies.isEmpty) {
+ return const SizedBox.shrink();
+ }
+
+ return Container(
+ margin: const EdgeInsets.all(10),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Wrap(
+ spacing: 8.0,
+ runSpacing: 8.0,
+ children: _currencies.map((currency) {
+ final isSelected = widget.currencyController.currency == currency;
+ return ChoiceChip(
+ label: Text(currency.getDefaultView()),
+ selected: isSelected,
+ onSelected: (selected) {
+ if (selected) {
+ setState(() {
+ widget.currencyController.currency = currency;
+ });
+ }
+ },
+ );
+ }).toList(),
+ ),
+ const SizedBox(height: 8),
+ Text(
+ countryNames(
+ widget.currencyController.lang,
+ widget.currencyController.currency.code,
+ ),
+ style: const TextStyle(fontSize: 13, color: Colors.grey),
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/src/view/custom_currency_picker.dart b/lib/src/view/custom_currency_picker.dart
new file mode 100644
index 0000000..64dac03
--- /dev/null
+++ b/lib/src/view/custom_currency_picker.dart
@@ -0,0 +1,182 @@
+import 'package:currency_widget/currency_widget.dart';
+import 'package:currency_widget/src/assets/currencies_names/currencies_names.dart';
+import 'package:currency_widget/src/utils/currency_format_utils.dart';
+import 'package:currency_widget/src/utils/currency_picker_utils.dart';
+import 'package:currency_widget/src/utils/masked_text_editing_controller.dart';
+import 'package:flutter/material.dart';
+
+/// A widget that allows the user to select a currency from a custom list and input an amount.
+///
+/// Use [CustomCurrencyPicker] when you want to restrict the selectable
+/// currencies to a specific list of currency codes (e.g., `['USD', 'EUR']`).
+class CustomCurrencyPicker extends StatefulWidget {
+ final CurrencyController currencyController;
+ final List currencyCodes;
+ final String? defaultCurrencyCode;
+
+ const CustomCurrencyPicker({
+ super.key,
+ required this.currencyController,
+ required this.currencyCodes,
+ this.defaultCurrencyCode,
+ });
+
+ @override
+ State createState() => _CustomCurrencyPickerState();
+}
+
+class _CustomCurrencyPickerState extends State {
+ List _currencies = [];
+ late TextEditingController controller;
+
+ @override
+ void initState() {
+ super.initState();
+ _updateCurrencyList();
+
+ if (widget.defaultCurrencyCode != null) {
+ final defaultCurrency = _currencies.firstWhere(
+ (c) =>
+ c.code.toLowerCase() == widget.defaultCurrencyCode!.toLowerCase(),
+ orElse: () => _currencies.isNotEmpty ? _currencies[0] : _currencies[0],
+ );
+ widget.currencyController.currency = defaultCurrency;
+ } else if (widget.currencyController.currencyNotifier.value == null &&
+ _currencies.isNotEmpty) {
+ widget.currencyController.currency = _currencies[0];
+ }
+
+ // Ensure the selected currency is within the allowed list
+ if (_currencies.isNotEmpty &&
+ !_currencies.contains(widget.currencyController.currency)) {
+ widget.currencyController.currency = _currencies[0];
+ }
+
+ final mount = widget.currencyController.mount.value;
+ controller = TextEditingController(
+ text: mount != null && mount > 0
+ ? CurrencyFormatUtils.formatAmount(
+ mount, widget.currencyController.currency)
+ : '',
+ );
+ }
+
+ void _updateCurrencyList() {
+ _currencies = customFilteredCurrencies(widget.currencyCodes);
+ }
+
+ @override
+ void didUpdateWidget(covariant CustomCurrencyPicker oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if (widget.currencyCodes != oldWidget.currencyCodes) {
+ setState(() {
+ _updateCurrencyList();
+ if (_currencies.isNotEmpty && !_currencies.contains(widget.currencyController.currency)) {
+ widget.currencyController.currency = _currencies[0];
+ final mount = widget.currencyController.mount.value;
+ if (mount != null && mount > 0) {
+ controller.text =
+ CurrencyFormatUtils.formatAmount(mount, _currencies[0]);
+ }
+ }
+ });
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ if (_currencies.isEmpty) {
+ return const SizedBox.shrink();
+ }
+
+ return Container(
+ margin: const EdgeInsets.all(10),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ ListTile(
+ title: Row(
+ children: [
+ Expanded(child: _buildDropdown()),
+ ],
+ ),
+ subtitle: TextField(
+ controller: controller,
+ keyboardType: TextInputType.number,
+ textAlign: TextAlign.center,
+ enableInteractiveSelection: true,
+ decoration: InputDecoration(
+ hintText: 0.toStringAsFixed(
+ widget.currencyController.currency.decimalDigits),
+ labelText: countryNames(
+ widget.currencyController.lang,
+ widget.currencyController.currency.code),
+ prefixText:
+ widget.currencyController.currency.position == 'first'
+ ? widget.currencyController.currency.symbol
+ : null,
+ suffixText:
+ widget.currencyController.currency.position == 'last'
+ ? widget.currencyController.currency.symbol
+ : null,
+ ),
+ onChanged: (str) {
+ if (str.isEmpty) {
+ widget.currencyController.mount.value = 0;
+ return;
+ }
+ final currency = widget.currencyController.currency;
+ try {
+ String value = str
+ .replaceAll(currency.thousandSeparator, '')
+ .replaceAll(currency.decimalSeparator, '.');
+ widget.currencyController.mount.value = double.parse(value);
+ } catch (e) {
+ widget.currencyController.mount.value = 0;
+ }
+ },
+ inputFormatters: [
+ AutoDecimalNumberFormatter(
+ decimalDigits:
+ widget.currencyController.currency.decimalDigits,
+ thousandSeparator:
+ widget.currencyController.currency.thousandSeparator,
+ decimalSeparator:
+ widget.currencyController.currency.decimalSeparator,
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+
+ DropdownButton _buildDropdown() {
+ return DropdownButton(
+ value: widget.currencyController.currency,
+ isExpanded: true,
+ onChanged: (Currency? newValue) async {
+ chooseCurrency(newValue);
+ },
+ items: currencyDropdownItems(_currencies),
+ );
+ }
+
+ void chooseCurrency(Currency? selected) {
+ if (selected == null) return;
+ setState(() {
+ widget.currencyController.currency = selected;
+ final mount = widget.currencyController.mount.value;
+ if (mount != null && mount > 0) {
+ controller.text = CurrencyFormatUtils.formatAmount(mount, selected);
+ }
+ });
+ }
+
+ @override
+ void dispose() {
+ controller.dispose();
+ super.dispose();
+ }
+}
diff --git a/pubspec.yaml b/pubspec.yaml
index 400be95..b133473 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: currency_widget
description: "A currency list of widgets which you can choose or get information about the currency"
-version: 1.0.6
+version: 1.0.14
homepage: https://github.com/DecksPlayer/currency_widget
repository: https://github.com/DecksPlayer/currency_widget
@@ -15,7 +15,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
- flutter_lints: ^6.0.0
+ flutter_lints: '>=6.0.0 <7.0.0'
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
diff --git a/script/currencies/currencies_generator.dart b/script/currencies/currencies_generator.dart
index 0aaba51..4c4098b 100755
--- a/script/currencies/currencies_generator.dart
+++ b/script/currencies/currencies_generator.dart
@@ -21,6 +21,8 @@ void main() async {
buffer.writeln(' emoji: "${currency['emoji']}",');
buffer.writeln(' decimalDigits: ${currency['decimal_digits']},');
buffer.writeln(' position: "${currency['position']}",');
+ buffer.writeln(' thousandSeparator: "${currency['thousand_separator'] ?? ','}",');
+ buffer.writeln(' decimalSeparator: "${currency['decimal_separator'] ?? '.'}",');
buffer.writeln(' ),');
}
diff --git a/script/currencies/currency.dart b/script/currencies/currency.dart
index d5f2acc..3282073 100644
--- a/script/currencies/currency.dart
+++ b/script/currencies/currency.dart
@@ -5,7 +5,9 @@ List