StatePickerDialog<T> class
A dialog for selecting a state or other items.
The StatePickerDialog provides a customizable dialog to display a list of items (such as states) for selection. The dialog supports sorting, filtering, searching, and customizing item rendering.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- StatePickerDialog
Constructors
-
StatePickerDialog({Key? key, required ValueChanged<
T> onValuePicked, required List<T> states, Widget? title, EdgeInsetsGeometry? titlePadding, EdgeInsetsGeometry contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0), String? semanticLabel, ItemFilter<T> ? itemFilter, Comparator<T> ? sortComparator, List<T> ? topStates, ItemBuilder<T> ? itemBuilder, bool isDividerEnabled = false, Widget divider = const Divider(height: 0.0), bool isSearchable = false, bool popOnPick = true, InputDecoration? searchInputDecoration, Color? searchCursorColor, Widget? searchEmptyView, SearchFilter<T> ? searchFilter}) -
Creates a StatePickerDialog.
const
Properties
- contentPadding → EdgeInsetsGeometry
-
Padding for the content of the dialog.
final
- divider → Widget
-
Divider widget to separate sections in the dialog.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDividerEnabled → bool
-
Flag to indicate whether the divider should be shown.
final
- isSearchable → bool
-
Flag to enable or disable the search functionality.
final
-
itemBuilder
→ ItemBuilder<
T> ? -
A builder function for customizing how each item is displayed.
final
-
itemFilter
→ ItemFilter<
T> ? -
A filter function to determine which items should be displayed.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onValuePicked
→ ValueChanged<
T> -
Callback triggered when an item is selected.
final
- popOnPick → bool
-
Determines whether the dialog should close after an item is picked.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchCursorColor → Color?
-
Color of the cursor in the search input field.
final
- searchEmptyView → Widget?
-
Widget to display when no items match the search query.
final
-
searchFilter
→ SearchFilter<
T> ? -
Filter function to determine if an item matches the search query.
final
- searchInputDecoration → InputDecoration?
-
Decoration for the search input field.
final
- semanticLabel → String?
-
Semantic label for accessibility.
final
-
sortComparator
→ Comparator<
T> ? -
Comparator function for sorting items.
final
-
states
→ List<
T> -
List of items to display in the dialog.
final
- title → Widget?
-
Optional title widget displayed at the top of the dialog.
final
- titlePadding → EdgeInsetsGeometry?
-
Padding for the title widget.
final
-
topStates
→ List<
T> ? -
A list of items that should appear at the top of the dialog.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → StatePickerDialogState< T> -
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited