countrify library
A beautiful and highly customizable country picker package for Flutter
This package provides:
- Comprehensive country data with ISO 3166-1 codes
- Beautiful and customizable country picker widgets
- Flag images for all countries
- Utility functions for country data access
- Multiple display modes (bottom sheet, dialog, full screen)
- Advanced search and filtering capabilities
- Complete customization options
Classes
- AllCountries
- Complete list of all countries with ISO 3166-1 codes Generated from CSV data
- City
- A model representing a city or populated place within a CountryState.
- CityDropdownField
- A form-style dropdown that opens a CityPicker for the provided stateId.
- CityPicker
- A picker that lets users choose a City from the provided stateId.
- CitySearchField
- A searchable text field that searches across all cities for a given country without requiring a pre-selected state. When a city is selected the parent state is resolved automatically.
- CountrifyFieldStyle
- A single, modular style class for the Countrify field widgets.
- CountrifyIcons
- Custom Lucide-based icons bundled with Countrify.
- Country
- A model representing a country with all its relevant information
- CountryDropdownField
- A text field-style dropdown for selecting countries with consistent styling.
- CountryEmptyState
- Displayed when a country search or filter yields no results.
- CountryFilter
- Country filter configuration.
- CountryFlag
- A standalone flag widget that displays a country's flag image with automatic emoji fallback.
- CountryListTile
- A reusable country row widget that displays a flag, country name, dial code, and optional selected checkmark.
- CountryListView
- A scrollable list of countries with selection support and empty state.
- CountryNameL10n
- Provides country name translations keyed by ISO 639-1 language code and ISO 3166-1 alpha-2 country code.
- CountryPicker
- A highly customizable and modern country picker with extensive styling options.
- CountryPickerConfig
- Shared configuration for country picker widgets.
- CountryPickerTheme
- Comprehensive theme configuration for the country picker
- CountrySearchBar
- A reusable, theme-aware search bar with debounce, clear button, and accessibility support.
- CountryState
- A model representing a state, province, region or other top-level administrative subdivision of a country.
- CountryStateCityField
- A composite form field that stacks CountryDropdownField, StateDropdownField, and CityDropdownField into a cascading country → state → city selector.
- CountryStateCitySelection
- Immutable snapshot of the current country / state / city selection.
- CountryUtils
- Utility functions for working with country data
- Currency
- A model representing a currency
- GeoPickerConfig
-
Non-visual configuration for
StatePickerandCityPicker. - GeoPickerTheme
-
Comprehensive theme configuration shared by
StatePickerandCityPicker. - GeoRepository
- Lazy loader for the bundled state / city dataset.
- Language
- A model representing a language
- PhoneCodePicker
- A specialized country picker for phone code selection with modern UI.
- PhoneMetadata
- Lightweight phone number metadata for basic validation.
- PhoneNumberField
- A text field for phone number input with an integrated country code picker as a prefix.
- SearchNormalizer
- Small utilities for normalizing user-entered search queries.
- StateDropdownField
- A form-style dropdown that opens a StatePicker for the provided countryIso2.
- StatePicker
- A picker that lets users choose a CountryState from the provided countryIso2.
Enums
- CitySortBy
-
Sort order applied to the city list inside
CityPickerandCityDropdownField. - CountryCodeEnum
- ISO 3166-1 alpha-2 country codes used by countrify.
- CountryPickerMode
- How the country picker is displayed.
- CountryPickerType
- Types of country picker displays.
- CountrySortBy
- Country sorting options.
- FlagShape
- Flag shape options.
- StateSortBy
-
Sort order applied to the state list inside
StatePickerandStateDropdownField.
Extensions
Typedefs
- CityItemBuilder = Widget Function(BuildContext context, City city, bool selected)
-
Signature for a custom city item row.
selectedreflects whether the row corresponds to the currently-selected city. - CityMatcher = bool Function(City city, String query)
-
Signature for a custom matcher that decides whether
citymatches the already-normalizedquery. - CitySearchResult = ({City city, CountryState state})
- Result record returned by CitySearchField.onChanged.
- CountryCode = CountryCodeEnum
- GeoEmptyStateBuilder = Widget Function(BuildContext context)
- Signature for the empty-state builder.
- GeoHeaderBuilder = Widget Function(BuildContext context, VoidCallback onClose)
- Signature for fully-custom header builders.
-
GeoItemBuilder<
T> = Widget Function(BuildContext context, T item, bool selected) -
Signature for a row builder. Called for every visible item; return a
widget to render inside the tap region.
selectedindicates whether the item is the currently-selected one and can be used to alter appearance. - GeoSearchBuilder = Widget Function(BuildContext context, TextEditingController controller)
-
Signature for fully-custom search field builders. The provided
controllermust be attached to the returned widget for the picker to receive query updates. - StateItemBuilder = Widget Function(BuildContext context, CountryState state, bool selected)
-
Signature for a custom state item row.
selectedreflects whether the row corresponds to the currently-selected state and can be used to alter the appearance of the returned widget. - StateMatcher = bool Function(CountryState state, String query)
-
Signature for a custom matcher that decides whether
statematches the normalizedquery(already trimmed, lower-cased, and — when the config allows — accent-folded).