MRECountryPickerBody class Phone
A searchable list of countries: a title, a search field and the countries.
This is the content of the picker. Put it in your own sheet or page, or open the ready-made one with showMRECountryPicker.
Typing filters by name, ISO code and dial code, ignoring case. Favorites show first while the search is empty.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MRECountryPickerBody
- Available extensions
Constructors
-
MRECountryPickerBody({Key? key, required List<
MRECountry> countries, required ValueChanged<MRECountry> onSelected, MRECountry? selected, List<MRECountry> favorites = const [], String? title, String? searchHint, String? emptyText, String nameBuilder(MRECountry country)?, bool showFlags = true, ScrollController? scrollController, bool autofocusSearch = false}) -
Creates the list for
countries.const
Properties
- autofocusSearch → bool
-
Whether the search field takes focus when the list opens.
final
-
countries
→ List<
MRECountry> -
The countries to list.
final
- emptyText → String?
-
Text when nothing matches. Defaults to
MREFieldsStrings.noCountriesFound.final -
favorites
→ List<
MRECountry> -
Countries pinned at the top while the search is empty.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- nameBuilder → String Function(MRECountry country)?
-
The name to show for a country, in your language. Search matches it too.
Defaults to the English name.
final
-
onSelected
→ ValueChanged<
MRECountry> -
Called with the country the user taps.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
Scroll controller of the list, for a draggable sheet.
final
- searchHint → String?
-
Hint of the search field. Defaults to
MREFieldsStrings.countrySearchHint.final - selected → MRECountry?
-
The country shown as selected.
final
- showFlags → bool
-
Whether to show each country's flag.
final
- title → String?
-
Title. Defaults to
MREFieldsStrings.countryPickerTitle.final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MRECountryPickerBody> -
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, int wrapWidth = 65}) → 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
-
withTextDirection(
String sample) → Widget -
Available on Widget, provided by the MREDirectionalWidget extension
Wraps this widget in a Directionality that followssample.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited