BasicPicker<T extends IsoTranslated<TranslatedName, Object, BasicLocale>, W extends IsoTile<T>> class abstract

An abstract class that provides a basic picker Widget, with search functionality and indexing support.

Inheritance
Implemented types
Mixed-in types
Implementers
Annotations

Constructors

BasicPicker(Iterable<T>? items, {bool addAutomaticKeepAlives = true, bool? addRepaintBoundaries, bool? addSemanticIndexes, double? cacheExtent, bool caseSensitiveSearch = false, Iterable<T>? chosen, Clip? clipBehavior, CrossAxisAlignment? crossAxisAlignment, Axis? direction, Iterable<T>? disabled, DragStartBehavior? dragStartBehavior, Widget emptyStatePlaceholder = UiConstants.placeholder, Widget? itemBuilder(ItemProperties<T>, IsoTile<T>?)?, Key? key, HitTestBehavior? hitTestBehavior, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, MainAxisAlignment? mainAxisAlignment, MainAxisSize? mainAxisSize, ValueSetter<T>? onSelect, EdgeInsetsGeometry? padding, ScrollPhysics? physics, bool? primary, String? restorationId, bool? reverse, ScrollController? scrollController, SearchData searchIn(T item, BuildContext context)?, Widget? separator, bool? showSearchBar, bool? shrinkWrap, int sort(T, T)?, bool startWithSearch = false, TextBaseline? textBaseline, TextDirection? textDirection, VerticalDirection? verticalDirection, Iterable<T> onSearchResultsBuilder(String query, SearchMap<T> map)?, double? spacing, TextField? searchBar, EdgeInsetsGeometry? searchBarPadding, bool? showClearButton = true, IsoMaps? maps, DecoratedFlagInterface? flagTheme})
Constructor for the BasicPicker class.
const

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?
Deprecated. Use scrollCacheExtent instead.
finalinherited
caseSensitiveSearch → bool
A boolean indicating whether the search is case-sensitive.
finalinherited
chosen → Iterable<T>?
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
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<T>?
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
flagTheme → DecoratedFlagInterface?
Optional FlagThemeData override for the flags rendered in tiles.
final
hashCode → int
The hash code for this object.
no setterinherited
A widget to display above the list of items.
finalinherited
hitTestBehavior → HitTestBehavior?
Defines the behavior of gesture detector used in this Scrollable.
finalinherited
itemBuilder → Widget? Function(ItemProperties<T>, IsoTile<T>?)?
Custom itemBuilder that receives the default tile for customization.
final
items → Iterable<T>?
The list of items to display.
finalinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior?
The ScrollViewKeyboardDismissBehavior 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
maps → IsoMaps?
Cached translations/flags bundle to use for rendering.
final
onSearchResultsBuilder → Iterable<T> Function(String query, SearchMap<T> map)?
A function that takes a query (usually user typed input) and a map of items to their search strings and returns an iterable of items that match the query. Useful for customizing the search results with different search algorithms.
finalinherited
onSelect → ValueSetter<T>?
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.
final
searchBarPadding → EdgeInsetsGeometry?
The padding to apply to the search bar.
final
searchIn → SearchData Function(T item, BuildContext context)?
The method to apply search to the items and return search data.
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.
final
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(T, T)?
A function to sort the items in the list.
finalinherited
spacing → double?
How much space to place between children in the main axis.
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
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<T>? items, bool? addAutomaticKeepAlives, bool? addRepaintBoundaries, bool? addSemanticIndexes, double? cacheExtent, bool? caseSensitiveSearch, Iterable<T>? chosen, Clip? clipBehavior, CrossAxisAlignment? crossAxisAlignment, Axis? direction, Iterable<T>? disabled, DragStartBehavior? dragStartBehavior, Widget? emptyStatePlaceholder, Key? key, HitTestBehavior? hitTestBehavior, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, MainAxisAlignment? mainAxisAlignment, MainAxisSize? mainAxisSize, void onSelect(T item)?, 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(T, T)?, bool? startWithSearch, TextBaseline? textBaseline, TextDirection? textDirection, VerticalDirection? verticalDirection, SearchData searchIn(T item, BuildContext context)?, Iterable<T> onSearchResultsBuilder(String query, SearchMap<T> map)?, Widget? itemBuilder(ItemProperties<T>, IsoTile<T>)?, double? spacing, IsoMaps? maps, DecoratedFlagInterface? flagTheme}) → BasicPicker<T, W>
Creates a copy of this picker with the given fields replaced with the new values.
createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<BasicPicker<T, W>>
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
defaultBuilder(ItemProperties<T> itemProperties) → W
Returns the default tile widget for the items.
defaultItems(BuildContext? context) → Iterable<T>
Provides the default list of items to display when items is null.
inherited
defaultSearch(T item, BuildContext context) → SearchData
Returns the default search function for the items. By default returns translated name of the item (if exists).
filteredProperties(Iterable<T> filtered, BuildContext context, int index) → ItemProperties<T>
Creates ItemProperties for an item at the specified index using the provided filtered items and context.
inherited
itemNameTranslated(T item, BuildContext context) → Text?
Returns the name translation of the item (if exists) in form of Text widget.
maybeMaps(BuildContext? context) → IsoMaps?
Returns the first available IsoMaps from the following sources in order: direct maps parameter, theme PickersThemeData.maps, or global TypedLocaleDelegate translation cache.
maybeNameTranslation(T item, BuildContext context) → String?
Returns the translated name of an item by searching in order of priority: direct maps, theme PickersThemeData.maps, and global TypedLocaleDelegate translation cache.
maybeSelectAndPop(T item, BuildContext context) → T
Selects the given item and pops the current route.
inherited
nameTranslationCache(T item, IsoMaps isoMaps) → String?
Returns translated common name of the item (if exists).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
properties(BuildContext context, int index, [Iterable<T>? source]) → ItemProperties<T>
Returns the ItemProperties for an item at the specified index.
inherited
resolvedFlagTheme(BuildContext? context) → DecoratedFlagInterface
Returns the first available FlagThemeData from the following sources in order: direct flagTheme parameter, theme PickersThemeData, or the current Theme extension. Falls back to a default FlagThemeData.small() flag theme if none of the sources provide a flag theme.
resolvedItems([BuildContext? context]) → Iterable<T>
Returns the items to display, using items if provided, otherwise falling back to defaultItems.
inherited
searchSuggestions(BuildContext context, SearchController controller) → FutureOr<Iterable<Widget>>
Called to get the suggestion list for the search view (typically in SearchAnchor widgets).
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, bool? requestFocus, AnimationStyle? animationStyle}) → Future<T?>?
Twin of a Material's showDialog function.
override
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, AnimationStyle? sheetAnimationStyle, bool? requestFocus}) → Future<T?>
Twin of a Material's showModalBottomSheet function.
override
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, bool maintainState = false, bool autocorrect = true, bool enableSuggestions = true}) → Future<T?>
Twin of a Material's showSearch function.
override
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

Operators

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