Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Ioannou committed Aug 22, 2020
1 parent d40e649 commit 95f5673
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A flutter package to select a country from a list of countries.
Add the package to your pubspec.yaml:

```yaml
country_picker: ^1.0.2
country_picker: ^1.0.3
```
In your dart file, import the library:
Expand All @@ -21,6 +21,7 @@ A flutter package to select a country from a list of countries.
```Dart
showCountryPicker(
context: context,
showPhoneCode: true, // optional. Shows phone code before the country name.
onSelect: (Country country) {
print('Select country: ${country.displayName}');
},
Expand All @@ -29,6 +30,7 @@ showCountryPicker(

### Parameters:
* `onSelect`: Called when a country is select. The country picker passes the new value to the callback (required)
* `showPhoneCode`: Can be used to to show phone code before the country name.
* `exclude`: Can be used to exclude(remove) one ore more country from the countries list (optional).
```Dart
showCountryPicker(
Expand Down
2 changes: 2 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class HomePage extends StatelessWidget {
onPressed: () {
showCountryPicker(
context: context,
//Optional. Can be used to exclude(remove) one ore more country from the countries list (optional).
exclude: <String>['KN', 'MF'],
//Optional. Shows phone code before the country name.
showPhoneCode: true,
onSelect: (Country country) {
print('Select country: ${country.displayName}');
Expand Down

0 comments on commit 95f5673

Please sign in to comment.