diff --git a/CHANGELOG.md b/CHANGELOG.md index 5526d4e..fa6e936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ ## [1.0.0] - 11 Aug 2020 * Initial developers preview release. + +## [1.0.1] - 12 Aug 2020 + +* Add documentation. diff --git a/README.md b/README.md index 779c8ec..153403c 100644 --- a/README.md +++ b/README.md @@ -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.0 + country_picker: ^1.0.1 ``` In your dart file, import the library: diff --git a/example/pubspec.lock b/example/pubspec.lock index 75d5c91..6fb86a9 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -56,7 +56,7 @@ packages: path: ".." relative: true source: path - version: "0.0.1" + version: "1.0.0" crypto: dependency: transitive description: diff --git a/lib/country_picker.dart b/lib/country_picker.dart index 976e43d..9b4a51a 100644 --- a/lib/country_picker.dart +++ b/lib/country_picker.dart @@ -7,6 +7,15 @@ import 'src/country_list_bottom_sheet.dart'; export 'src/country.dart'; +/// Shows a bottom sheet containing a list of countries to select one. +/// +/// The callback function [onSelect] call when the user select a country. +/// The function called with parameter the country that the user has selected. +/// If the user cancels the bottom sheet, the function is not call. +/// +/// The `context` argument is used to look up the [Scaffold] for the bottom +/// sheet. It is only used when the method is called. Its corresponding widget +/// can be safely removed from the tree before the bottom sheet is closed. void showCountryPicker({ @required BuildContext context, @required ValueChanged onSelect, diff --git a/lib/src/country_list_view.dart b/lib/src/country_list_view.dart index 836bd1e..9eea8d0 100644 --- a/lib/src/country_list_view.dart +++ b/lib/src/country_list_view.dart @@ -1,8 +1,8 @@ -import 'package:country_picker/res/country_codes.dart'; import 'package:country_picker/src/utils.dart'; import 'package:flutter/material.dart'; import 'country.dart'; +import 'res/country_codes.dart'; class CountryListView extends StatefulWidget { /// Called when a country is select. diff --git a/lib/res/country_codes.dart b/lib/src/res/country_codes.dart similarity index 99% rename from lib/res/country_codes.dart rename to lib/src/res/country_codes.dart index 038c99e..75e1d40 100644 --- a/lib/res/country_codes.dart +++ b/lib/src/res/country_codes.dart @@ -1,4 +1,4 @@ -List> countryCodes = [ +final List> countryCodes = [ { "e164_cc": "93", "iso2_cc": "AF", diff --git a/pubspec.yaml b/pubspec.yaml index c2f3a6d..1847fbf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: country_picker description: A flutter package to select a country from a list of countries. -version: 1.0.0 +version: 1.0.1 homepage: https://github.com/Daniel-Ioannou repository: https://github.com/Daniel-Ioannou/flutter_country_picker