flutter_simple_country_picker 0.0.2 copy "flutter_simple_country_picker: ^0.0.2" to clipboard
flutter_simple_country_picker: ^0.0.2 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 [...]

Pub Version popularity likes codecov style: flutter lints

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: ^0.0.1

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 #

Anton Ustinoff (ziqq)

Funding #

If you want to support the development of our library, there are several ways you can do it:

License #

MIT

Coverage #

1
likes
0
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

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. Made with โค๏ธ by ziqq.

Homepage
Repository (GitHub)
View/report issues

Funding

Consider supporting this project:

www.buymeacoffee.com
www.patreon.com
boosty.to

License

unknown (license)

Dependencies

collection, flutter, flutter_localizations, intl, meta

More

Packages that depend on flutter_simple_country_picker