PickerItem<T> class
Represents a single item in a picker column with optional hierarchical children.
PickerItem is the fundamental data structure used by PickerDataAdapter to represent selectable items. Items can have custom display widgets, associated data values, and child items for hierarchical data structures.
Simple Items
PickerItem<String>(
text: Text('Apple'),
value: 'apple',
)
Hierarchical Items
PickerItem<String>(
text: Text('Fruits'),
value: 'fruits',
children: [
PickerItem(text: Text('Apple'), value: 'apple'),
PickerItem(text: Text('Banana'), value: 'banana'),
],
)
Constructors
-
PickerItem.new({Widget? text, T? value, List<
PickerItem< ? children})T> > - Creates a picker item.
Properties
-
children
→ List<
PickerItem< ?T> > -
Child items for hierarchical data structures.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → Widget?
-
The widget used to display this item in the picker.
final
- value → T?
-
The actual data value associated with this item.
final
Methods
-
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