PromptedChoice<T> class

Widget to create prompted choice with single or multiple selection

Inheritance

Constructors

PromptedChoice.new({Key? key, String? title, bool multiple = false, bool clearable = false, bool confirmation = false, bool loading = false, bool error = false, List<T> value = const [], ValueChanged<List<T>>? onChanged, required int itemCount, required IndexedChoiceStateBuilder<T> itemBuilder, ChoiceSkipResolver<T>? itemSkip, ChoiceGroupResolver? itemGroup, ChoiceStateBuilder<T>? dividerBuilder, ChoiceStateBuilder<T>? leadingBuilder, ChoiceStateBuilder<T>? trailingBuilder, ChoiceStateBuilder<T>? placeholderBuilder, ChoiceStateBuilder<T>? errorBuilder, ChoiceStateBuilder<T>? loaderBuilder, ChoiceGroupSortResolver? groupSort, ChoiceGroupBuilder? groupBuilder, ChoiceGroupItemBuilder? groupItemBuilder, ChoiceGroupHeaderBuilder<T>? groupHeaderBuilder, ChoiceListBuilder? listBuilder, ChoiceStateBuilder<T>? modalHeaderBuilder, ChoiceStateBuilder<T>? modalFooterBuilder, ChoiceStateBuilder<T>? modalSeparatorBuilder, FlexFit modalFit = FlexFit.loose, ChoicePromptBuilder<T>? anchorBuilder, ChoicePromptDelegate<T>? promptDelegate, bool searchable = false, ValueSetter<String>? onSearch})
Create prompted choice widget with single or multiple selection
const
PromptedChoice.multiple({Key? key, String? title, bool clearable = false, bool confirmation = false, bool loading = false, bool error = false, List<T> value = const [], ValueChanged<List<T>>? onChanged, required int itemCount, required IndexedChoiceStateBuilder<T> itemBuilder, ChoiceSkipResolver<T>? itemSkip, ChoiceGroupResolver? itemGroup, ChoiceStateBuilder<T>? dividerBuilder, ChoiceStateBuilder<T>? leadingBuilder, ChoiceStateBuilder<T>? trailingBuilder, ChoiceStateBuilder<T>? placeholderBuilder, ChoiceStateBuilder<T>? errorBuilder, ChoiceStateBuilder<T>? loaderBuilder, ChoiceGroupSortResolver? groupSort, ChoiceGroupBuilder? groupBuilder, ChoiceGroupItemBuilder? groupItemBuilder, ChoiceGroupHeaderBuilder<T>? groupHeaderBuilder, ChoiceListBuilder? listBuilder, ChoiceStateBuilder<T>? modalHeaderBuilder, ChoiceStateBuilder<T>? modalFooterBuilder, ChoiceStateBuilder<T>? modalSeparatorBuilder, FlexFit modalFit = FlexFit.loose, ChoicePromptBuilder<T>? anchorBuilder, ChoicePromptDelegate<T>? promptDelegate, bool searchable = false, ValueSetter<String>? onSearch})
Create prompted choice widget with multiple selection
const
PromptedChoice.single({Key? key, String? title, bool clearable = false, bool confirmation = false, bool loading = false, bool error = false, T? value, ValueChanged<T?>? onChanged, required int itemCount, required IndexedChoiceStateBuilder<T> itemBuilder, ChoiceSkipResolver<T>? itemSkip, ChoiceGroupResolver? itemGroup, ChoiceStateBuilder<T>? dividerBuilder, ChoiceStateBuilder<T>? leadingBuilder, ChoiceStateBuilder<T>? trailingBuilder, ChoiceStateBuilder<T>? placeholderBuilder, ChoiceStateBuilder<T>? errorBuilder, ChoiceStateBuilder<T>? loaderBuilder, ChoiceGroupSortResolver? groupSort, ChoiceGroupBuilder? groupBuilder, ChoiceGroupItemBuilder? groupItemBuilder, ChoiceGroupHeaderBuilder<T>? groupHeaderBuilder, ChoiceListBuilder? listBuilder, ChoiceStateBuilder<T>? modalHeaderBuilder, ChoiceStateBuilder<T>? modalFooterBuilder, ChoiceStateBuilder<T>? modalSeparatorBuilder, FlexFit modalFit = FlexFit.loose, ChoicePromptBuilder<T>? anchorBuilder, ChoicePromptDelegate<T>? promptDelegate, bool searchable = false, ValueSetter<String>? onSearch})
Create prompted choice widget with single selection

Properties

anchorBuilder ChoicePromptBuilder<T>?
Called to build trigger widget to invoke modal prompt
final
clearable bool
Determines whether the choice can be cleared
final
confirmation bool
Specifies whether the choice selection needs to be confirmed
final
dividerBuilder ChoiceStateBuilder<T>?
Called to build divider item
final
error bool
Specifies whether the choice list has error
final
errorBuilder ChoiceStateBuilder<T>?
Called to build an error indicator widget when choice list cannot be shown
final
groupBuilder ChoiceGroupBuilder?
Called to build the grouped list of choice items
final
groupHeaderBuilder ChoiceGroupHeaderBuilder<T>?
Called to build the grouped header of choice items
final
groupItemBuilder ChoiceGroupItemBuilder?
Called to build the grouped item of choice items
final
groupSort ChoiceGroupSortResolver?
If provided, sort group by the given callback
final
hashCode int
The hash code for this object.
no setterinherited
itemBuilder IndexedChoiceStateBuilder<T>
Called to build choice item
final
itemCount int
The total number of item, this choice list can provide
final
itemGroup ChoiceGroupResolver?
Called to enable grouped choices and specify group name of choice item
final
itemSkip ChoiceSkipResolver<T>?
Called to specify which indices to skip when building choice item
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leadingBuilder ChoiceStateBuilder<T>?
Called to build leading item of the item collection
final
listBuilder ChoiceListBuilder?
Called to build the list of choice items
final
loaderBuilder ChoiceStateBuilder<T>?
Called to build loading indicator when loading is true
final
loading bool
Specify whether the choice items is in loading state
final
no setter
modalFit FlexFit
How a flexible modal body is inscribed into the available space.
final
modalFooterBuilder ChoiceStateBuilder<T>?
Called to build modal footer widget
final
modalHeaderBuilder ChoiceStateBuilder<T>?
Called to build modal header widget
final
modalSeparatorBuilder ChoiceStateBuilder<T>?
Called to build modal separator widget
final
multiple bool
Determines whether the choice is multiple or single selection
final
onChanged ValueChanged<List<T>>?
Called when the choice selection should change.
final
onSearch ValueSetter<String>?
Called when search value changed
final
placeholderBuilder ChoiceStateBuilder<T>?
Called to build placeholder when there are no choice items
final
promptDelegate ChoicePromptDelegate<T>?
Called to specify ways to invoke modal prompt
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchable bool
Specifies whether the choice can be searched
final
title String?
Primary text of the modal and trigger widget
final
trailingBuilder ChoiceStateBuilder<T>?
Called to build trailing item of the item collection
final
value List<T>
List of type T of the selection value
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PromptedChoice<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

Static Properties

defaultListBuilder ChoiceListBuilder
final