FlCountryCodePicker class

A Flutter package for showing a modal that contains country dial code.

The user can also search for the available codes and select right from the modal.

Constructors

FlCountryCodePicker({Widget? title, Color defaultAppbarBackgroundColor = Colors.white, Color defaultAppbarForegroundColor = Colors.black, Color defaultAppbarCloseIconBackgroundColor = const Color.fromARGB(255, 224, 224, 224), String defaultAppbarText = 'Select Country Code', IconData defaultAppbarCloseIcon = Icons.clear_rounded, bool localize = true, double? horizontalTitleGap, InputDecoration? searchBarDecoration, bool showDialCode = true, bool showSearchBar = true, List<String> favorites = const [], List<String> filteredCountries = const [], Icon? favoritesIcon, TextStyle? countryTextStyle, TextStyle? dialCodeTextStyle, TextStyle? searchBarTextStyle})
A Flutter package for showing a modal that contains country dial code.
const

Properties

countryCodes → List<CountryCode>
Convenient getter for all of the available country codes.
no setter
countryTextStyle → TextStyle?
Optional parameter to customize the text style of the country names.
final
defaultAppbarBackgroundColor → Color
Can be used to customize the background color of the default appbar.
final
defaultAppbarCloseIcon → IconData
It is the close icon of the default appbar.
final
defaultAppbarCloseIconBackgroundColor → Color
Can be used to customize the background color of the close icon.
final
defaultAppbarForegroundColor → Color
Can be used to customize the foreground color of the default appbar. Color of icon and text.
final
defaultAppbarText → String
It is the text of the default appbar.
final
dialCodeTextStyle → TextStyle?
Optional parameter to customize the appearance of the country dial codes.
final
favorites → List<String>
Favorite CountryCodes that can be shown at the top of the list.
final
favoritesIcon → Icon?
Custom icon of favorite countries.
final
filteredCountries → List<String>
Filters all of the CountryCodes available and only show the codes that are existing in this list.
final
hashCode → int
The hash code for this object.
no setterinherited
horizontalTitleGap → double?
Horizontal space between flag, country name, and trailing icon.
final
localize → bool
An optional argument for localizing the country names based on device's current selected Language (country/region).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
searchBarDecoration → InputDecoration?
Can be used to customize the appearance of search bar.
final
searchBarTextStyle → TextStyle?
Optional parameter to customize the appearance of the search bar.
final
showDialCode → bool
An optional argument for showing dial code at country tiles.
final
showSearchBar → bool
An optional argument for showing search bar.
final
title → Widget?
Can be used to customize the title of the country code picker modal.
final

Methods

addFavorites(List<String> countries) → void
Adds all favorites to the list.
addFilteredCountries(List<String> countries) → void
Adds all of filtered countries to the list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
showPicker({required BuildContext context, bool fullScreen = false, ShapeBorder shape = kShape, double pickerMinHeight = 150, double pickerMaxHeight = 770, String? initialSelectedLocale, bool scrollToDeviceLocale = false, Color barrierColor = kBarrierColor, Clip? clipBehavior = Clip.hardEdge, Color backgroundColor = kBackgroundColor}) → Future<CountryCode?>
Shows the CountryCodePickerModal modal.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited