country_search library
A Flutter package for country selection with search functionality.
This package provides a beautiful and customizable country picker widget with multi-language support, fast search, and phone code integration.
Features
- ð 245+ countries with flags and phone codes
- ð Instant search by name, code, or phone code
- ð Multi-language support (21 languages)
- ðĻ Customizable UI with dark theme support
- ðģïļ Standalone
CountryFlagwidget (emoji + svg) - ðą Responsive design for all screen sizes
- ⥠Optimized performance (~110Ξs per search)
Quick Start
CountryPicker(
selectedCountry: selectedCountry,
onCountrySelected: (Country country) {
setState(() {
selectedCountry = country;
});
},
)
Classes
- Country
- Represents a country with its ISO code, flag emoji, and phone code
- CountryData
- Utility class for managing country data and operations
- CountryFlag
- Country flag widget with emoji and SVG modes.
- CountryFlagStyle
- Visual style for CountryFlag.
- CountryLocalizations
-
Callers can lookup localized country names with an instance of CountryLocalizations
returned by
CountryLocalizations.of(context). - CountryLocalizationsAr
- Arabic localization for country names
- CountryLocalizationsBn
- Bengali localization for country names
- CountryLocalizationsDe
- German localization for country names
- CountryLocalizationsEn
- English localization for country names
- CountryLocalizationsEs
- Spanish localization for country names
- CountryLocalizationsFr
- French localization for country names
- CountryLocalizationsHi
- Hindi localization for country names
- CountryLocalizationsId
- Indonesian localization for country names
- CountryLocalizationsIt
- Italian localization for country names
- CountryLocalizationsJa
- Japanese localization for country names
- CountryLocalizationsKo
- Korean localization for country names
- CountryLocalizationsNl
- Dutch localization for country names
- CountryLocalizationsPl
- Polish localization for country names
- CountryLocalizationsPt
- Portuguese localization for country names
- CountryLocalizationsRu
- Russian localization for country names
- CountryLocalizationsTh
- Thai localization for country names
- CountryLocalizationsTr
- Turkish localization for country names
- CountryLocalizationsUk
- Ukrainian localization for country names
- CountryLocalizationsUr
- Urdu localization for country names
- CountryLocalizationsVi
- Vietnamese localization for country names
- CountryLocalizationsZh
- Chinese localization for country names
- CountryPicker
- CountryPickerBuilder
- Builder API for creating CountryPicker with a fluent interface
- CountryPickerThemeData
- Theme configuration for CountryPicker.
Enums
- CountryFlagMode
- Rendering mode for CountryFlag.
- CountryPickerModalPresentation
- Presentation style for country picker modal
Functions
-
lookupCountryLocalizations(
Locale locale) â CountryLocalizations - Lookup function to get the appropriate CountryLocalizations instance
Typedefs
- CountryFilter = bool Function(Country country)
- CountryFlagSvgBuilder = Widget Function(BuildContext context, String svgUrl, Country country, CountryFlagStyle style, Widget fallback)
- Custom builder for SVG flag rendering.
- CountryPickerEmptySearchBuilder = Widget Function(BuildContext context, String query)
- CountryPickerItemBuilder = Widget Function(BuildContext context, Country country, bool isSelected, VoidCallback onSelect, Widget defaultItem)
- CountryPickerModalHeaderBuilder = Widget Function(BuildContext context, Widget defaultHeader)