SelectDelegate class abstract

Base configuration for a select.

A SelectDelegate is responsible for:

  • Defining its data, either synchronously (entries, selectedEntries and resetEntries) or lazily via loader callbacks.
  • Defining UI/theme overrides (colors and per-widget themes).
  • Building the select body widget, a loading skeleton and an error widget.

The actual selection state is managed by SelectController and widgets under src/select/.

Implementers

Constructors

SelectDelegate({SelectionMode selectionMode = SelectionMode.single, SelectEntries? entries, Future<SelectEntries> entriesLoader()?, SelectEntries? selectedEntries, SelectEntries? selectedEntriesLoader()?, SelectEntries? resetEntries, SelectEntries? resetEntriesLoader()?, SelectActionBarBuilder? actionBarBuilder, Color? selectedColor, Color? onSelectedColor, Color? backgroundColor, Color? onBackgroundColor, Color? backgroundColorHigh, Color? backgroundColorHighest, Color? onBackgroundColorHighest, String? resetText, String? applyText, bool searchEnabled = false, SelectSearchPredicate? searchPredicate, String? searchHintText, Duration searchDebounceDuration = const Duration(milliseconds: 300), SelectSearchBarTheme? searchBarTheme, SelectActionBarTheme? actionBarTheme, SelectTabBarTheme? tabBarTheme, SelectSideBarTheme? sideBarTheme, SelectGridTileTheme? gridTileTheme, SelectListTileTheme? listTileTheme, SelectFieldTileTheme? fieldTileTheme, SelectExpansionTileTheme? expansionTileTheme, SelectChipBarTheme? chipBarTheme, SelectPanelTheme? panelTheme, WidgetBuilder? skeletonBuilder, Widget errorBuilder(Object error, StackTrace? stackTrace)?})

Properties

actionBarBuilder SelectActionBarBuilder?
Optional builder to customize the action bar UI.
final
actionBarTheme SelectActionBarTheme?
Theme overrides for the action bar widget.
final
applyText String?
final
asyncEntries Future<SelectEntries>?
The selectable entries future, lazily initialized on first access from entries (wrapped in Future.value) or entriesLoader.
no setter
backgroundColor Color?
Base background color used by the select panel.
final
backgroundColorHigh Color?
A higher-contrast background color used for elevated sections.
final
backgroundColorHighest Color?
The highest-contrast background color (often used for nested levels).
final
chipBarTheme SelectChipBarTheme?
Theme overrides for the selected chips bar.
final
entries SelectEntries?
The full selectable entries supplied synchronously, if any.
no setter
entriesLoader Future<SelectEntries> Function()?
Fetches the full selectable entries for this select.
final
errorBuilder Widget Function(Object error, StackTrace? stackTrace)?
Optional builder invoked when entriesLoader fails to load.
final
expansionTileTheme SelectExpansionTileTheme?
Theme overrides for expansion tiles.
final
fieldTileTheme SelectFieldTileTheme?
Theme overrides for range field tiles.
final
gridTileTheme SelectGridTileTheme?
Theme overrides for grid tiles.
final
hashCode int
The hash code for this object.
no setterinherited
hasSyncEntries bool
Whether the entries were supplied synchronously via entries, as opposed to an entriesLoader.
no setter
listTileTheme SelectListTileTheme?
Theme overrides for list tiles.
final
onBackgroundColor Color?
Text/icon color used on top of backgroundColor.
final
onBackgroundColorHighest Color?
Text/icon color used on top of backgroundColorHighest.
final
onSelectedColor Color?
Text/icon color used on top of selectedColor.
final
panelTheme SelectPanelTheme?
Theme overrides for the panel's elevation, shadow and shape decoration.
final
resetEntries SelectEntries?
The reset selection entries, lazily initialized from resetEntriesLoader on first access, or the value passed to the constructor.
no setter
resetEntriesLoader SelectEntries? Function()?
Returns the selection that should be used when "Reset" is tapped.
final
resetText String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchBarTheme SelectSearchBarTheme?
Theme overrides for the search bar.
final
searchDebounceDuration Duration
The debounce delay before filtering entries after the search text changes.
final
searchEnabled bool
Whether the search bar is visible in the select panel.
final
searchHintText String?
Hint text shown in the search bar when the input is empty.
final
searchPredicate SelectSearchPredicate?
Custom predicate used to match entries against a search query.
final
selectedColor Color?
The background color used for selected entries.
final
selectedEntries SelectEntries?
The previously selected entries to restore.
getter/setter pair
selectedEntriesLoader SelectEntries? Function()?
Returns the previously selected entries to restore.
final
selectionMode SelectionMode
The panel-wide selection mode.
final
sideBarTheme SelectSideBarTheme?
Theme overrides for the side bar (vertical category bar).
final
skeletonBuilder WidgetBuilder?
Optional builder for the loading skeleton.
final
tabBarTheme SelectTabBarTheme?
Theme overrides for the tab bar (horizontal category bar).
final

Methods

buildBody(BuildContext context, List<SelectEntry> entries, Set<SelectEntry>? selectedEntries, {String searchQuery = ''}) Widget
Builds the select body widget.
buildError(BuildContext context, Object error, StackTrace? stackTrace) Widget
Builds the error widget shown when entriesLoader fails to load.
buildSkeleton(BuildContext context) Widget
Builds the loading skeleton.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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