Skip to content

Commit

Permalink
V2.0.18
Browse files Browse the repository at this point in the history
Merge pull request #90 from Daniel-Ioannou/v2.0.18
closed: #75
  • Loading branch information
Daniel-Ioannou committed Oct 16, 2023
2 parents 68b4060 + 256605e commit eafb498
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 51 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## 2.0.18
* Add more currencies:
- Maldivian Rufiyaa
* Add styling options for search field input decoration.
``` Dart
showCurrencyPicker(
context: context,
theme: CurrencyPickerThemeData(
// Optional. Styles the search field.
inputDecoration: InputDecoration(
labelText: 'Search',
hintText: 'Start typing to search',
prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder(
borderSide: BorderSide(
color: const Color(0xFF8C98A8).withOpacity(0.2),
),
),
),
),
onSelect: (Currency currency) {
print('Select currency: ${currency.name}');
},
);
```

## 2.0.17
* Add more currencies:
- Iraqi dinar
Expand Down
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A flutter package to select a currency from a list of currencies.
Add the package to your pubspec.yaml:

```yaml
currency_picker: ^2.0.17
currency_picker: ^2.0.18
```

In your dart file, import the library:
Expand Down Expand Up @@ -53,14 +53,25 @@ showCurrencyPicker(
* `theme`: Can be used to customizing the currency list bottom sheet. (optional).
```Dart
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}'),
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,
//Optional. Styles the search field.
inputDecoration: InputDecoration(
labelText: 'Search',
hintText: 'Start typing to search',
prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder(
borderSide: BorderSide(
color: const Color(0xFF8C98A8).withOpacity(0.2),
),
),
),
),
onSelect: (Currency currency) => print('Select currency: ${currency.name}'),
);
```
## Contributions
Expand Down
29 changes: 20 additions & 9 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A flutter package to select a currency from a list of currencies.
Add the package to your pubspec.yaml:

```yaml
currency_picker: ^2.0.17
currency_picker: ^2.0.18
```

In your dart file, import the library:
Expand Down Expand Up @@ -53,14 +53,25 @@ showCurrencyPicker(
* `theme`: Can be used to customizing the currency list bottom sheet. (optional).
```Dart
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}'),
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,
//Optional. Styles the search field.
inputDecoration: InputDecoration(
labelText: 'Search',
hintText: 'Start typing to search',
prefixIcon: const Icon(Icons.search),
border: OutlineInputBorder(
borderSide: BorderSide(
color: const Color(0xFF8C98A8).withOpacity(0.2),
),
),
),
),
onSelect: (Currency currency) => print('Select currency: ${currency.name}'),
);
```
## Contributions
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.0.17"
version: "2.0.18"
fake_async:
dependency: transitive
description:
Expand Down
10 changes: 5 additions & 5 deletions lib/currency_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ void showCurrencyPicker({
required ValueChanged<Currency> onSelect,
List<String>? favorite,
List<String>? currencyFilter,
@Deprecated(
'Use inputDecoration instead. '
'This feature was deprecated after v2.0.18.',
)
String? searchHint,
bool showSearchField = true,
bool showFlag = true,
bool showCurrencyName = true,
bool showCurrencyCode = true,
bool useRootNavigator = false,
ScrollPhysics? physics,
CurrencyPickerThemeData? theme,
@Deprecated(
'Use inputDecoration instead. '
'This feature was deprecated after v2.0.18.',
)
String? searchHint,
}) {
assert(
showCurrencyName || showCurrencyCode,
Expand Down
52 changes: 26 additions & 26 deletions lib/src/currencies.dart
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,19 @@ List<Map<String, dynamic>> currencies = [
"space_between_amount_and_symbol": true,
"symbol_on_left": false,
},
{
"code": "IQD",
"name": "Iraqi Dinar",
"symbol": "د.ع",
"flag": "IQD",
"decimal_digits": 3,
"number": 368,
"name_plural": "Iraqi dinars",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": true,
"symbol_on_left": true
},
{
"code": "JMD",
"name": "Jamaica Dollar",
Expand Down Expand Up @@ -1027,6 +1040,19 @@ List<Map<String, dynamic>> currencies = [
"space_between_amount_and_symbol": true,
"symbol_on_left": false,
},
{
"code": "MVR",
"name": "Maldivian Rufiyaa",
"symbol": "/-",
"flag": "MV",
"decimal_digits": 2,
"number": 462,
"name_plural": "Maldivian Rufiyaa",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": false
},
{
"code": "MWK",
"name": "Malawian Kwacha",
Expand Down Expand Up @@ -1482,30 +1508,4 @@ List<Map<String, dynamic>> currencies = [
"space_between_amount_and_symbol": false,
"symbol_on_left": true,
},
{
"code": "IQD",
"name": "Iraqi Dinar",
"symbol": "د.ع",
"flag": "IQD",
"decimal_digits": 3,
"number": 368,
"name_plural": "Iraqi dinars",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": true,
"symbol_on_left": true
},
{
"code": "MVR",
"name": "Maldivian Rufiyaa",
"symbol": "/-",
"flag": "MV",
"decimal_digits": 2,
"number": 462,
"name_plural": "Maldivian Rufiyaa",
"thousands_separator": ",",
"decimal_separator": ".",
"space_between_amount_and_symbol": false,
"symbol_on_left": false
},
];
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A flutter package to select a currency from a list of currencies.
homepage: https://github.com/Daniel-Ioannou
repository: https://github.com/Daniel-Ioannou/flutter_currency_picker

version: 2.0.17
version: 2.0.18

environment:
sdk: '>=2.12.0 <4.0.0'
Expand Down

0 comments on commit eafb498

Please sign in to comment.