CountryPickerDropdown class Null safety

Provides a customizable DropdownButton for all countries

Inheritance

Constructors

CountryPickerDropdown({required ValueChanged<Country> onValuePicked, ItemFilter? itemFilter, Comparator<Country>? sortComparator, List<Country>? priorityList, ItemBuilder? itemBuilder, String? initialValue, bool isExpanded = false, double? itemHeight = kMinInteractiveDimension, ItemBuilder? selectedItemBuilder, bool isDense = false, Widget? underline, Color? dropdownColor, VoidCallback? onTap, Widget? icon, Color? iconDisabledColor, Color? iconEnabledColor, double iconSize = 24.0, Widget? hint, Widget? disabledHint, bool isFirstDefaultIfInitialValueNotProvided = true})

Properties

disabledHint Widget?
See disabledHint of DropdownButton
final
See dropdownColor of DropdownButton
final
hashCode int
The hash code for this object.
@nonVirtualread-onlyinherited
hint Widget?
See hint of DropdownButton
final
icon Widget?
See icon of DropdownButton
final
iconDisabledColor Color?
See iconDisabledColor of DropdownButton
final
iconEnabledColor Color?
See iconEnabledColor of DropdownButton
final
iconSize double
See iconSize of DropdownButton
final
initialValue String?
It should be one of the ISO ALPHA-2 Code that is provided in countryList map of countries.dart file.
final
isDense bool
See isDense of DropdownButton
final
isExpanded bool
Boolean property to enabled/disable expanded property of DropdownButton
final
isFirstDefaultIfInitialValueNotProvided bool
Set first item in the country list as selected initially if initialValue is not provided
final
itemBuilder ItemBuilder?
This function will be called to build the child of DropdownMenuItem If it is not provided, default one will be used which displays flag image, isoCode and phoneCode in a row. Check _buildDefaultMenuItem method for details.
final
itemFilter ItemFilter?
Filters the available country list
final
itemHeight double?
See itemHeight of DropdownButton
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTap VoidCallback?
See onTap of DropdownButton
final
onValuePicked ValueChanged<Country>
This function will be called whenever a Country item is selected.
final
priorityList List<Country>?
List of countries that are placed on top
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
selectedItemBuilder ItemBuilder?
Selected country widget builder to display. See selectedItemBuilder of DropdownButton
final
sortComparator Comparator<Country>?
Comparator to be used in sort of country list
final
underline Widget?
See underline of DropdownButton
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _CountryPickerDropdownState
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.
@protectedinherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.
@nonVirtualinherited