flutter_simple_country_picker 0.1.0 flutter_simple_country_picker: ^0.1.0 copied to clipboard
The Flutter package that provides an easy-to-use country selection widget. It allows users to select a country from a comprehensive list of countries, making it simple to integrate country picking fun [...]
flutter_simple_country_picker #
Description #
The Flutter package that provides an easy-to-use country selection widget. It allows users to select a country from a comprehensive list of countries, making it simple to integrate country picking functionality into your Flutter applications. The package supports Android, iOS, and web platforms, and offers customization options for fonts and styles.
Getting Started #
Add the package to your pubspec.yaml:
flutter_simple_country_picker: <version>
Installation #
In your dart file, import the library:
import 'package:flutter_simple_country_picker/flutter_simple_country_picker.dart';
Example #
Add the CountriesLocalization.delegate
in the list of your app delegates. Set supported locales [Locale('ru'), Locale('en')]. And set your locale ru
or en
.
MaterialApp(
locale: const Locale('ru'), // Locale('en'),
supportedLocales: const <Locale>[
Locale('ru'),
Locale('en'),
],
localizationsDelegates: [
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
/// Add [CountriesLocalization] in app [localizationsDelegates]
CountriesLocalization.delegate,
],
home: HomePage(),
);
Example usage of the showCountryPicker
function:
showCountryPicker(
context: context,
exclude: ['RU', 'EN'],
onDone: () {
print('CountryPicker dismissed');
},
onSelect: (Country country) {
print('Selected country: ${country.displayName}');
},
);
Optional argumets of the showCountryPicker
function:
Argument | Description |
---|---|
exclude |
List of countries to exclude from the list. |
filter |
List of countries to filter the list. |
favorite |
List of countries to show at the top of the list. |
showPhoneCode |
Displays the phone code before the country name. |
showWorldWide |
Shows the "World Wide" option at the beginning of the list. |
useAutofocus |
Automatically opens the keyboard when the picker is loaded. |
showSearch |
Enables or disables the search bar. |
isDismissible |
Allows the user to close the modal by swiping it down. |
isScrollControlled |
Controls the scrolling behavior of the modal window. |
useHaptickFeedback |
Enables haptic feedback. |
useSafeArea |
Enables the safe area for the modal window. |
onSelect |
Callback when the select a country. |
onDone |
Callback when the CountryPicker is dismissed, whether a country is selected or not. |
All countries list #
Flag | Country | Code | Phone mask |
---|---|---|---|
๐ฆ๐ซ | Afghanistan | +93 | 00 000 000 |
๐ฆ๐ฑ | Albania | +355 | 00 000 0000 |
๐ฉ๐ฟ | Algeria | +213 | 00 000 0000 |
๐ฆ๐ธ | American Samoa | +1684 | 000 0000 |
๐ฆ๐ฉ | Andorra | +376 | 000 000 |
๐ฆ๐ด | Angola | +244 | 000 000 000 |
๐ฆ๐ฎ | Anguilla | +1264 | 000 0000 |
๐ฆ๐ถ | Antarctica | +672 | 00 000 |
๐ฆ๐ฌ | Antigua and Barbuda | +1268 | 000 0000 |
๐ฆ๐ท | Argentina | +54 | 00 0000 0000 |
๐ฆ๐ฒ | Armenia | +374 | 00 000 000 |
๐ฆ๐ผ | Aruba | +297 | 000 0000 |
๐ฆ๐บ | Australia | +61 | 00 0000 0000 |
๐ฆ๐น | Austria | +43 | 000 0000 0000 |
๐ฆ๐ฟ | Azerbaijan | +994 | 00 000 0000 |
๐ง๐ธ | Bahamas | +1242 | 000 0000 |
๐ง๐ญ | Bahrain | +973 | 0000 0000 |
๐ง๐ฉ | Bangladesh | +880 | 000 000 0000 |
๐ง๐ง | Barbados | +1246 | 000 0000 |
๐ง๐พ | Belarus | +375 | 00 000 0000 |
๐ง๐ช | Belgium | +32 | 000 000 000 |
๐ง๐ฟ | Belize | +501 | 000 0000 |
๐ง๐ฏ | Benin | +229 | 00 00 00 00 |
๐ง๐ฒ | Bermuda | +1441 | 000 0000 |
๐ง๐น | Bhutan | +975 | 00 00 00 |
๐ง๐ด | Bolivia | +591 | 00 000 000 |
๐ง๐ฆ | Bosnia and Herzegovina | +387 | 00 000 000 |
๐ง๐ผ | Botswana | +267 | 00 000 000 |
๐ง๐ท | Brazil | +55 | 00 0000 0000 |
๐ฎ๐ด | British Indian Ocean Territory | +246 | 000 0000 |
๐ป๐ฌ | British Virgin Islands | +1284 | 000 0000 |
๐ง๐ณ | Brunei | +673 | 000 0000 |
๐ง๐ฌ | Bulgaria | +359 | 00 000 000 |
๐ง๐ซ | Burkina Faso | +226 | 00 00 00 00 |
๐ง๐ฎ | Burundi | +257 | 00 00 00 00 |
๐จ๐ป | Cape Verde | +238 | 00 00 00 |
๐ฐ๐ญ | Cambodia | +855 | 00 000 000 |
๐จ๐ฒ | Cameroon | +237 | 00 00 00 00 |
๐จ๐ฆ | Canada | +1 | 000 000 0000 |
๐ฐ๐พ | Cayman Islands | +1345 | 000 0000 |
๐จ๐ซ | Central African Republic | +236 | 00 00 00 00 |
๐น๐ฉ | Chad | +235 | 00 00 00 00 |
๐จ๐ฑ | Chile | +56 | 00 0000 0000 |
๐จ๐ณ | China | +86 | 000 0000 0000 |
๐จ๐ฝ | Christmas Island | +61 | 00 0000 0000 |
๐จ๐จ | Cocos (Keeling) Islands | +61 | 00 0000 0000 |
๐จ๐ด | Colombia | +57 | 000 000 0000 |
๐ฐ๐ฒ | Comoros | +269 | 00 00 00 |
๐จ๐ฌ | Congo | +242 | 00 000 000 |
๐จ๐ฉ | Congo (DRC) | +243 | 00 000 0000 |
๐จ๐ฐ | Cook Islands | +682 | 00 000 |
๐จ๐ท | Costa Rica | +506 | 0000 0000 |
๐จ๐ฎ | Cรดte d'Ivoire | +225 | 00 000 000 |
๐ญ๐ท | Croatia | +385 | 00 000 000 |
๐จ๐บ | Cuba | +53 | 00 000 000 |
๐จ๐ผ | Curaรงao | +5999 | 000 0000 |
๐จ๐พ | Cyprus | +357 | 00 000 000 |
๐จ๐ฟ | Czech Republic | +420 | 000 000 000 |
๐ฉ๐ฐ | Denmark | +45 | 00 00 00 00 |
๐ฉ๐ฏ | Djibouti | +253 | 00 00 00 00 |
๐ฉ๐ฒ | Dominica | +1767 | 000 0000 |
๐ฉ๐ด | Dominican Republic | +1809 | 000 0000 |
๐ช๐จ | Ecuador | +593 | 00 000 0000 |
๐ช๐ฌ | Egypt | +20 | 000 000 0000 |
๐ธ๐ป | El Salvador | +503 | 00 00 00 00 |
๐ฌ๐ถ | Equatorial Guinea | +240 | 00 00 00 00 |
๐ช๐ท | Eritrea | +291 | 00 000 000 |
๐ช๐ช | Estonia | +372 | 000 000 00 |
๐ช๐น | Ethiopia | +251 | 00 000 000 |
๐ซ๐ฐ | Falkland Islands | +500 | 000 000 |
๐ซ๐ด | Faroe Islands | +298 | 000 000 |
๐ซ๐ฏ | Fiji | +679 | 000 000 |
๐ซ๐ฎ | Finland | +358 | 00 000 000 |
๐ซ๐ท | France | +33 | 00 00 00 00 00 |
๐ฌ๐ซ | French Guiana | +594 | 000 000 000 |
๐ต๐ซ | French Polynesia | +689 | 00 00 00 |
๐ฌ๐ฆ | Gabon | +241 | 00 00 00 00 |
๐ฌ๐ฒ | Gambia | +220 | 00 00 00 |
๐ฌ๐ช | Georgia | +995 | 000 000 000 |
๐ฉ๐ช | Germany | +49 | 0000 000000 |
๐ฌ๐ญ | Ghana | +233 | 00 000 0000 |
๐ฌ๐ฎ | Gibraltar | +350 | 0000 0000 |
๐ฌ๐ท | Greece | +30 | 000 000 0000 |
๐ฌ๐ฑ | Greenland | +299 | 00 00 00 |
๐ฌ๐ฉ | Grenada | +1473 | 000 0000 |
๐ฌ๐ต | Guadeloupe | +590 | 000 00 00 00 |
๐ฌ๐บ | Guam | +1671 | 000 0000 |
๐ฌ๐น | Guatemala | +502 | 0000 0000 |
๐ฌ๐ฌ | Guernsey | +44 | |
๐ฌ๐ณ | Guinea | +224 | 00 00 00 00 |
๐ฌ๐ผ | Guinea-Bissau | +245 | 00 00 00 |
๐ฌ๐พ | Guyana | +592 | 000 0000 |
๐ญ๐น | Haiti | +509 | 00 00 000 |
๐ญ๐ณ | Honduras | +504 | 0000 0000 |
๐ญ๐ฐ | Hong Kong | +852 | 0000 0000 |
๐ญ๐บ | Hungary | +36 | 00 000 000 |
๐ฎ๐ธ | Iceland | +354 | 000 0000 |
๐ฎ๐ณ | India | +91 | 0000 000 000 |
๐ฎ๐ฉ | Indonesia | +62 | 0000 000 000 |
๐ฎ๐ท | Iran | +98 | 0000 000 000 |
๐ฎ๐ถ | Iraq | +964 | 00 000 0000 |
๐ฎ๐ช | Ireland | +353 | 000 000 000 |
๐ฎ๐ฒ | Isle of Man | +44 | |
๐ฎ๐ฑ | Israel | +972 | 00 000 0000 |
๐ฎ๐น | Italy | +39 | 000 000 0000 |
๐ฏ๐ฒ | Jamaica | +1876 | 000 0000 |
๐ฏ๐ต | Japan | +81 | 000 000 0000 |
๐ฏ๐ช | Jersey | +44 | |
๐ฏ๐ด | Jordan | +962 | 00 000 0000 |
๐ฐ๐ฟ | Kazakhstan | +7 | 000 000 0000 |
๐ฐ๐ช | Kenya | +254 | 000 000 000 |
๐ฐ๐ฎ | Kiribati | +686 | 00 000 |
๐ฐ๐ผ | Kuwait | +965 | 0000 0000 |
๐ฐ๐ฌ | Kyrgyzstan | +996 | 000 000 000 |
๐ฑ๐ฆ | Laos | +856 | 00 000 000 |
๐ฑ๐ป | Latvia | +371 | 00 000 000 |
๐ฑ๐ง | Lebanon | +961 | 00 000 000 |
๐ฑ๐ธ | Lesotho | +266 | 000 0000 |
๐ฑ๐ท | Liberia | +231 | 00 000 000 |
๐ฑ๐พ | Libya | +218 | 00 000 000 |
๐ฑ๐ฎ | Liechtenstein | +423 | 000 0000 |
๐ฑ๐น | Lithuania | +370 | 00 000 000 |
๐ฑ๐บ | Luxembourg | +352 | 00 00 00 00 |
๐ฒ๐ด | Macau | +853 | 000 000 000 |
๐ฒ๐ฐ | Macedonia | +389 | 00 000 000 |
๐ฒ๐ฌ | Madagascar | +261 | 00 00 000 00 |
๐ฒ๐ผ | Malawi | +265 | 00 0000 000 |
๐ฒ๐พ | Malaysia | +60 | 00 000 0000 |
๐ฒ๐ป | Maldives | +960 | 000 0000 |
๐ฒ๐ฑ | Mali | +223 | 00 00 00 00 |
๐ฒ๐น | Malta | +356 | 0000 0000 |
๐ฒ๐ญ | Marshall Islands | +692 | 000 0000 |
๐ฒ๐ถ | Martinique | +596 | 000 00 00 00 |
๐ฒ๐ท | Mauritania | +222 | 00 00 00 00 |
๐ฒ๐บ | Mauritius | +230 | 000 0000 |
๐ฒ๐ฝ | Mexico | +52 | 000 000 0000 |
๐ซ๐ฒ | Micronesia | +691 | 000 0000 |
๐ฒ๐ฉ | Moldova | +373 | 00 00 00 00 |
๐ฒ๐จ | Monaco | +377 | 00 000 000 |
๐ฒ๐ณ | Mongolia | +976 | 00 000 000 |
๐ฒ๐ช | Montenegro | +382 | 00 000 000 |
๐ฒ๐ธ | Montserrat | +1664 | 000 0000 |
๐ฒ๐ฆ | Morocco | +212 | 00 0000 0000 |
๐ฒ๐ฟ | Mozambique | +258 | 00 00 00 00 |
๐ฒ๐ฒ | Myanmar | +95 | 00 000 000 |
๐ณ๐ฆ | Namibia | +264 | 00 000 0000 |
๐ณ๐ท | Nauru | +674 | 00 000 |
๐ณ๐ต | Nepal | +977 | 000 000 0000 |
๐ณ๐ฑ | Netherlands | +31 | 000 000 0000 |
๐ณ๐จ | New Caledonia | +687 | 00 00 00 |
๐ณ๐ฟ | New Zealand | +64 | 00 000 0000 |
๐ณ๐ฎ | Nicaragua | +505 | 0000 0000 |
๐ณ๐ช | Niger | +227 | 00 00 00 00 |
๐ณ๐ฌ | Nigeria | +234 | 000 000 0000 |
๐ณ๐บ | Niue | +683 | 00 000 |
๐ณ๐ซ | Norfolk Island | +672 | 00 000 |
๐ฒ๐ต | Northern Mariana Islands | +1670 | 000 0000 |
๐ณ๐ด | Norway | +47 | 000 00 000 |
๐ด๐ฒ | Oman | +968 | 0000 0000 |
๐ต๐ฐ | Pakistan | +92 | 000 000 0000 |
๐ต๐ผ | Palau | +680 | 000 0000 |
๐ต๐ฆ | Panama | +507 | 000 0000 |
๐ต๐ฌ | Papua New Guinea | +675 | 000 0000 |
๐ต๐พ | Paraguay | +595 | 000 000 000 |
๐ต๐ช | Peru | +51 | 00 000 000 |
๐ต๐ญ | Philippines | +63 | 000 000 0000 |
๐ต๐ณ | Pitcairn Islands | +64 | |
๐ต๐ฑ | Poland | +48 | 000 000 000 |
๐ต๐น | Portugal | +351 | 000 000 000 |
๐ต๐ท | Puerto Rico | +1 | 000 000 0000 |
๐ถ๐ฆ | Qatar | +974 | 0000 0000 |
๐ท๐ช | Rรฉunion | +262 | 000 00 00 00 |
๐ท๐ด | Romania | +40 | 000 000 000 |
๐ท๐บ | Russia | +7 | 000 000 0000 |
๐ท๐ผ | Rwanda | +250 | 0000 0000 |
๐ฐ๐ณ | Saint Kitts and Nevis | +1869 | 000 0000 |
๐ฑ๐จ | Saint Lucia | +1758 | 000 0000 |
๐ป๐จ | Saint Vincent and the Grenadin | +1784 | 000 0000 |
๐ผ๐ธ | Samoa | +685 | 00 000 |
๐ธ๐ฒ | San Marino | +378 | 00 00 00 |
๐ธ๐น | Sรฃo Tomรฉ and Prรญncipe | +239 | 00 00 00 |
๐ธ๐ฆ | Saudi Arabia | +966 | 000 000 000 |
๐ธ๐ณ | Senegal | +221 | 00 000 000 |
๐ท๐ธ | Serbia | +381 | 00 000 000 |
๐ธ๐จ | Seychelles | +248 | 000 0000 |
๐ธ๐ฑ | Sierra Leone | +232 | 00 000 000 |
๐ธ๐ฌ | Singapore | +65 | 0000 0000 |
๐ธ๐ฝ | Sint Maarten | +1721 | 000 0000 |
๐ธ๐ฐ | Slovakia | +421 | 00 000 000 |
๐ธ๐ฎ | Slovenia | +386 | 00 000 000 |
๐ธ๐ง | Solomon Islands | +677 | 00 000 |
๐ธ๐ด | Somalia | +252 | 00 000 000 |
๐ฟ๐ฆ | South Africa | +27 | 000 000 0000 |
๐ฌ๐ธ | South Georgia | +500 | 000 000 |
๐ฐ๐ท | South Korea | +82 | 00 000 0000 |
๐ธ๐ธ | South Sudan | +211 | 00 000 000 |
๐ช๐ธ | Spain | +34 | 000 000 000 |
๐ฑ๐ฐ | Sri Lanka | +94 | 00 000 000 |
๐ธ๐ฉ | Sudan | +249 | 00 000 000 |
๐ธ๐ท | Suriname | +597 | 000 0000 |
๐ธ๐ฟ | Swaziland | +268 | 0000 0000 |
๐ธ๐ช | Sweden | +46 | 000 000 000 |
๐จ๐ญ | Switzerland | +41 | 000 000 0000 |
๐ธ๐พ | Syria | +963 | 0000 000 000 |
๐น๐ผ | Taiwan | +886 | 0000 000 000 |
๐น๐ฏ | Tajikistan | +992 | 00 000 0000 |
๐น๐ฟ | Tanzania | +255 | 00 000 0000 |
๐น๐ญ | Thailand | +66 | 000 000 0000 |
๐น๐ฑ | Timor-Leste | +670 | 000 0000 |
๐น๐ฌ | Togo | +228 | 00 00 00 00 |
๐น๐ฐ | Tokelau | +690 | 00 000 |
๐น๐ด | Tonga | +676 | 00 000 |
๐น๐น | Trinidad and Tobago | +1868 | 000 0000 |
๐น๐ณ | Tunisia | +216 | 00 000 000 |
๐น๐ท | Turkey | +90 | 000 000 0000 |
๐น๐ฒ | Turkmenistan | +993 | 00 000 000 |
๐น๐ป | Tuvalu | +688 | 00 000 |
๐บ๐ฌ | Uganda | +256 | 000 0000 000 |
๐บ๐ฆ | Ukraine | +380 | 00 000 0000 |
๐ฆ๐ช | United Arab Emirates | +971 | 00 000 0000 |
๐ฌ๐ง | United Kingdom | +44 | 0000 000 000 |
๐บ๐ธ | United States | +1 | 000 000 0000 |
๐บ๐พ | Uruguay | +598 | 0000 0000 |
๐บ๐ฟ | Uzbekistan | +998 | 00 000 0000 |
๐ป๐บ | Vanuatu | +678 | 00 000 |
๐ป๐ฆ | Vatican City | +39 | 000 000 000 |
๐ป๐ช | Venezuela | +58 | 000 000 0000 |
๐ป๐ณ | Vietnam | +84 | 000 0000 000 |
๐พ๐ช | Yemen | +967 | 00 000 000 |
๐ฟ๐ฒ | Zambia | +260 | 00 000 0000 |
๐ฟ๐ผ | Zimbabwe | +263 | 00 000 0000 |
Changelog #
Refer to the Changelog to get all release notes.
Maintainers #
Funding #
If you want to support the development of our library, there are several ways you can do it: