CountryListPicker class

Inheritance

Constructors

CountryListPicker({Key? key, Countries initialCountry = Countries.Egypt, Countries? localCountry, Languages language = Languages.English, TextDirection? textDirection, Names displayName = Names.common, bool isShowCountryName = true, bool isShowFlag = true, Size flagSize = const Size(40.0, 40.0), bool isShowDiallingCode = true, Icon iconDown = const Icon(Icons.keyboard_arrow_down, size: 24), bool isShowDownIcon = true, bool isShowInputField = true, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, InputBorder border = const UnderlineInputBorder(), TextStyle diallingCodeStyle = const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), TextStyle countryNameStyle = const TextStyle(fontSize: 15, color: Colors.grey), DialogThemeData dialogTheme = const DialogThemeData(), InputThemeData inputTheme = const InputThemeData(), ValueChanged<Country>? onCountryChanged, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, GestureTapCallback? onTap, TextEditingController? controller})
CountryListPicker is a customizable country picker for Flutter. The sizes and styles used for the picker items can be customized. The CountryListPicker allows to select a country from a list. The CountryListPicker can show many different languages. It can be customized with various properties such as initialCountry, language, textDirection and more. It has various callback properties for events such as onCountryChanged, onChanged and others. It throws an error if isShowFlag and isShowDiallingCode both are set to false. note that: if 'border' property of the 'inputTheme'is not equal InputBorder.none, the border will be canceled. simple code
const

Properties

border InputBorder
The shape of the border to be drawn around the CountryListPicker can be defined using the border variable.
final
controller TextEditingController?
final
countryNameStyle TextStyle
countryNameStyle text style.
final
diallingCodeStyle TextStyle
diallingCodeStyle text style.
final
dialogTheme DialogThemeData
dilaog theme data
final
displayName Names
final
flagSize Size
flagSize is a Size variable that stores the size of the flag to be displayed.
final
hashCode int
The hash code for this object.
no setterinherited
iconDown Icon
Creating a variable called iconDown and assigning it to the Icon class.
final
initialCountry Countries
Use with the Countries Enumration Type to show specific intial country. Countries are identified by their name as listed below, e.g. Countries.Egypt. default value is Countries.Egypt
final
inputTheme InputThemeData
Input field theme data
final
isShowCountryName bool
isShowCountryName is a bool variable that determines whether or not to display the title of the country. If set to true, the title will be shown, and if set to false, the title will be hidden. This variable is declared as final, indicating that it can't be reassigned after being initialized.
final
isShowDiallingCode bool
isShowDiallingCode is a bool variable that determines whether or not to display the dialling code of the country. If set to true, the dialling code will be shown, and if set to false, the dialling code will be hidden. This variable is declared as final, indicating that it can't be reassigned after being initialized.
final
isShowDownIcon bool
isShowDownIcon is a bool variable that determines whether or not to display the down icon. If set to true, the down icon will be shown, and if set to false, the down icon will be hidden. This variable is declared as final, indicating that it can't be reassigned after being initialized.
final
isShowFlag bool
isShowFlag is a bool variable that determines whether or not to display the flag of the country. If set to true, the flage will be shown, and if set to false, the flag will be hidden. This variable is declared as final, indicating that it can't be reassigned after being initialized.
final
isShowInputField bool
isShowInputField is a bool variable that determines whether or not to display the input field. If set to true, the input field will be shown, and if set to false, the input field will be hidden. This variable is declared as final, indicating that it can't be reassigned after being initialized.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
language Languages
Use with the Languages Enumration Type to show specific language. Languages are identified by their name as listed below, e.g. Language.Arabic. default value is Language.English
final
localCountry Countries?
Use with the Countries Enumration Type to show specific local country. Countries are identified by their name as listed below, e.g. Countries.Egypt. default value is null
final
margin EdgeInsetsGeometry?
Empty space to surround the CountryListPicker.
final
onChanged ValueChanged<String>?
Optional ValueChanged callback.
final
onCountryChanged ValueChanged<Country>?
Optional ValueChanged callback.
final
onEditingComplete VoidCallback?
final
onFieldSubmitted ValueChanged<String>?
final
onSaved FormFieldSetter<String>?
final
onTap GestureTapCallback?
final
padding EdgeInsetsGeometry?
Empty space to inscribe inside the CountryListPicker.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textDirection TextDirection?
A direction in which text flows.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CountryListPicker>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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