PhoneCodePicker class

A picker widget that displays a list of countries with their phone codes.

Inheritance

Constructors

PhoneCodePicker({Iterable<WorldCountry> countries = WorldCountry.list, bool addAutomaticKeepAlives = true, bool? addRepaintBoundaries, bool? addSemanticIndexes, double? cacheExtent, bool caseSensitiveSearch = false, Iterable<WorldCountry>? chosen, Clip? clipBehavior, CrossAxisAlignment? crossAxisAlignment, Axis? direction, Iterable<WorldCountry>? disabled, DragStartBehavior? dragStartBehavior, Widget emptyStatePlaceholder = UiConstants.placeholder, Widget? itemBuilder(ItemProperties<WorldCountry> itemProperties, {bool? isDense})?, Key? key, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, MainAxisAlignment? mainAxisAlignment, MainAxisSize? mainAxisSize, ValueSetter<WorldCountry>? onSelect, EdgeInsetsGeometry? padding, ScrollPhysics? physics, bool? primary, String? restorationId, bool? reverse, ScrollController? scrollController, TextField? searchBar, EdgeInsetsGeometry? searchBarPadding, Iterable<String> searchIn(WorldCountry item, BuildContext context)?, Widget? separator, bool? showClearButton = true, bool? showSearchBar, bool? shrinkWrap, int sort(WorldCountry, WorldCountry)?, bool startWithSearch = false, TextBaseline? textBaseline, TextDirection? textDirection, VerticalDirection? verticalDirection, TypedLocale<Object>? translation})
Constructor for the PhoneCodePicker class that uses a list of countries with their phone codes.
const
PhoneCodePicker.fromCountryPicker(CountryPicker picker, {Key? key})
Constructor for the PhoneCodePicker class that uses a CountryPicker object.

Properties

addAutomaticKeepAlives bool
Whether to wrap each child in an AutomaticKeepAlive.
finalinherited
addRepaintBoundaries bool?
Whether to wrap each child in a RepaintBoundary.
finalinherited
addSemanticIndexes bool?
Whether to wrap each child in an IndexedSemantics.
finalinherited
cacheExtent double?
The viewport has an area before and after the visible area to cache items that are about to become visible when the user scrolls.
finalinherited
caseSensitiveSearch bool
A boolean indicating whether the search is case-sensitive.
finalinherited
chosen Iterable<WorldCountry>?
A list of items that should be highlighted as selected.
finalinherited
clipBehavior Clip?
The content will be clipped (or not) according to this option.
finalinherited
countries Iterable<WorldCountry>
The list of countries to display.
no setterinherited
crossAxisAlignment CrossAxisAlignment?
How the items should be placed along the cross axis.
finalinherited
direction Axis?
The Axis along which the scroll view's offset increases.
finalinherited
disabled Iterable<WorldCountry>?
A list of items that should be disabled.
finalinherited
dragStartBehavior DragStartBehavior?
Determines the way that drag start behavior is handled.
finalinherited
emptyStatePlaceholder Widget
A widget to display when the list is empty.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
A widget to display above the list of items.
finalinherited
itemBuilder Widget? Function(ItemProperties<WorldCountry> itemProperties, {bool? isDense})?
A builder that returns a widget to display an item in the list.
finalinherited
items Iterable<WorldCountry>
The list of items to display.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior ScrollViewKeyboardDismissBehavior?
ScrollViewKeyboardDismissBehavior the defines how this ScrollView will dismiss the keyboard automatically.
finalinherited
mainAxisAlignment MainAxisAlignment?
How the items should be placed along the main axis.
finalinherited
mainAxisSize MainAxisSize?
How much space should be occupied in the main axis.
finalinherited
onSelect ValueSetter<WorldCountry>?
A callback that is called when an item is selected.
finalinherited
padding EdgeInsetsGeometry?
The amount of space by which to inset the children.
finalinherited
physics ScrollPhysics?
How the scroll view should respond to user input.
finalinherited
primary bool?
Whether this is the primary scroll view associated with the parent PrimaryScrollController.
finalinherited
restorationId String?
Restoration ID to save and restore the scroll offset of the scrollable.
finalinherited
reverse bool?
Whether the scroll view scrolls in the reading direction.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
An object that can be used to control the position to which this scroll view is scrolled.
finalinherited
The optional search bar to display.
finalinherited
searchBarPadding EdgeInsetsGeometry?
The padding to apply to the search bar.
finalinherited
searchIn Iterable<String> Function(WorldCountry item, BuildContext context)?
The method to apply search to the items.
finalinherited
separator Widget?
A widget to display between each item in the list.
finalinherited
showClearButton bool?
A boolean indicating whether to show a clear button in the search bar.
finalinherited
showHeader bool?
Whether to show the header widget.
finalinherited
shrinkWrap bool?
Whether the extent of the scroll view in the scrollDirection should be determined by the contents being viewed.
finalinherited
sort int Function(WorldCountry, WorldCountry)?
A function to sort the items in the list.
finalinherited
startWithSearch bool
A boolean indicating whether to start search with the search string.
finalinherited
textBaseline TextBaseline?
If aligning items according to their baseline, which baseline to use.
finalinherited
textController TextEditingController?
The text editing controller for the search bar.
finalinherited
textDirection TextDirection?
Determines the order to lay children out horizontally and how to interpret start and end in the horizontal direction.
finalinherited
translation TypedLocale<Object>?
The local to use for translations.
finalinherited
verticalDirection VerticalDirection?
Determines the order to lay children out vertically and how to interpret start and end in the vertical direction.
finalinherited

Methods

compareWithInput(String input, String itemText) bool
Compares an input string with an item's text.
inherited
compareWithTextInput(TextEditingController controller, String item) bool
Compares an TextEditingController text input string with an item's text.
inherited
copyWith({Iterable<WorldCountry>? items, bool? addAutomaticKeepAlives, bool? addRepaintBoundaries, bool? addSemanticIndexes, double? cacheExtent, bool? caseSensitiveSearch, Iterable<WorldCountry>? chosen, Clip? clipBehavior, CrossAxisAlignment? crossAxisAlignment, Axis? direction, Iterable<WorldCountry>? disabled, DragStartBehavior? dragStartBehavior, Widget? emptyStatePlaceholder, Key? key, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, MainAxisAlignment? mainAxisAlignment, MainAxisSize? mainAxisSize, void onSelect(WorldCountry country)?, EdgeInsetsGeometry? padding, ScrollPhysics? physics, bool? primary, String? restorationId, bool? reverse, ScrollController? scrollController, TextField? searchBar, EdgeInsetsGeometry? searchBarPadding, Widget? separator, bool? showClearButton, bool? showSearchBar, bool? shrinkWrap, int sort(WorldCountry country1, WorldCountry country2)?, bool? startWithSearch, TextBaseline? textBaseline, TextDirection? textDirection, VerticalDirection? verticalDirection, Iterable<String> searchIn(WorldCountry country, BuildContext context)?, Widget? itemBuilder(ItemProperties<WorldCountry> itemProperties, {bool? isDense})?, TypedLocale<Object>? translation}) PhoneCodePicker
Creates a copy of this picker with the given fields replaced with the new values.
override
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<BasicPicker<WorldCountry>>
Creates the mutable state for this widget at a given location in the tree.
inherited
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
defaultBuilder(BuildContext context, ItemProperties<WorldCountry> itemProperties, {bool? isDense}) Widget
Returns the default builder for the items. It also has an optional parameter isDense, which indicates whether the item uses less vertical space or not, defaults to false.
override
defaultSearch(WorldCountry item, BuildContext context) Iterable<String>
Returns the default search function for the items. By default returns translated name of the item (if exists).
override
filteredProperties(Iterable<WorldCountry> filtered, BuildContext context, int index) ItemProperties<WorldCountry>
Creates ItemProperties for an item at the specified index using the provided filtered items and context.
inherited
itemNameTranslated(WorldCountry item, BuildContext context) Text?
Returns the name translation of the item (if exists) in form of Text widget.
inherited
maybeSelectAndPop(WorldCountry item, BuildContext context) WorldCountry
Selects the given item and pops the current route.
inherited
nameTranslationCache(WorldCountry item, TypedLocale<Object> locale) String?
Returns translated common name of the item (if exists).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
properties(BuildContext context, int index) ItemProperties<WorldCountry>
Returns the ItemProperties for an item at the specified index.
inherited
searchSuggestions(BuildContext context, SearchController controller) FutureOr<Iterable<Widget>>
Called to get the suggestion list for the search view (typically in SearchAnchor widgets).
inherited
showInDialog(BuildContext context, {bool barrierDismissible = true, Color? barrierColor = Colors.black54, String? barrierLabel, bool useSafeArea = true, bool useRootNavigator = true, RouteSettings? routeSettings, Offset? anchorPoint, TraversalEdgeBehavior? traversalEdgeBehavior, Key? key, Widget? icon, EdgeInsetsGeometry? iconPadding, Color? iconColor, Widget? title, EdgeInsetsGeometry? titlePadding, TextStyle? titleTextStyle, Widget? content, EdgeInsetsGeometry? contentPadding, TextStyle? contentTextStyle, List<Widget>? actions, EdgeInsetsGeometry? actionsPadding, MainAxisAlignment? actionsAlignment, OverflowBarAlignment? actionsOverflowAlignment, VerticalDirection? actionsOverflowDirection, double? actionsOverflowButtonSpacing, EdgeInsetsGeometry? buttonPadding, Color? backgroundColor, double? elevation, Color? shadowColor, Color? surfaceTintColor, String? semanticLabel, EdgeInsets insetPadding = const EdgeInsets.symmetric(vertical: 24, horizontal: 40), Clip clipBehavior = Clip.none, ShapeBorder? shape, AlignmentGeometry? alignment, bool scrollable = false}) Future<WorldCountry?>?
Twin of a Material's showDialog function.
inherited
showInModalBottomSheet(BuildContext context, {Color? backgroundColor, double? elevation, ShapeBorder? shape = UiConstants.shape, Clip? clipBehavior, BoxConstraints? constraints, Color? barrierColor, bool isScrollControlled = true, bool useRootNavigator = false, bool isDismissible = true, bool enableDrag = true, bool? showDragHandle, bool useSafeArea = false, RouteSettings? routeSettings, AnimationController? transitionAnimationController, Offset? anchorPoint, double? heightFactor = 0.66}) Future<WorldCountry?>
Twin of a Material's showModalBottomSheet function.
inherited
showInSearch(BuildContext context, {String? query = "", bool useRootNavigator = false, String? searchFieldLabel, TextStyle? searchFieldStyle, InputDecorationTheme? searchFieldDecorationTheme, PreferredSizeWidget? appBarBottom, IconButton? backIconButton, IconButton? clearIconButton, TextInputType? keyboardType, TextInputAction textInputAction = UiConstants.textInputAction, ThemeData? appBarThemeData}) Future<WorldCountry?>
Twin of a Material's showSearch function.
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