SmartSelect<T> class
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SmartSelect
Constructors
-
SmartSelect({Key? key, String? title, String? placeholder, required bool isMultiChoice, S2SingleSelected<
T> ? singleSelected, S2Validation<S2SingleChosen< ? singleValidation, S2Validation<T> >S2SingleChosen< ? singleModalValidation, ValueChanged<T> >S2SingleSelected< ? singleOnChange, S2ChoiceSelect<T> >S2SingleState< ? singleOnSelect, S2ModalOpen<T> , S2Choice<T> >S2SingleState< ? singleOnModalOpen, S2ModalClose<T> >S2SingleState< ? singleOnModalClose, S2ModalWillOpen<T> >S2SingleState< ? singleOnModalWillOpen, S2ModalWillClose<T> >S2SingleState< ? singleOnModalWillClose, S2SingleBuilder<T> >T> ? singleBuilder, S2MultiSelected<T> ? multiSelected, S2Validation<S2MultiChosen< ? multiValidation, S2Validation<T> >S2MultiChosen< ? multiModalValidation, ValueChanged<T> >S2MultiSelected< ? multiOnChange, S2ChoiceSelect<T> >S2MultiState< ? multiOnSelect, S2ModalOpen<T> , S2Choice<T> >S2MultiState< ? multiOnModalOpen, S2ModalClose<T> >S2MultiState< ? multiOnModalClose, S2ModalWillOpen<T> >S2MultiState< ? multiOnModalWillOpen, S2ModalWillClose<T> >S2MultiState< ? multiOnModalWillClose, S2MultiBuilder<T> >T> ? multiBuilder, S2ModalConfig modalConfig = const S2ModalConfig(), S2ChoiceConfig choiceConfig = const S2ChoiceConfig(), S2GroupConfig groupConfig = const S2GroupConfig(), List<S2Choice< ? choiceItems, S2ChoiceLoader<T> >T> ? choiceLoader}) - Default constructor
-
SmartSelect.multiple({Key? key, String? title, String placeholder = 'Select one or more', List<
T> selectedValue = const [], List<S2Choice< ? selectedChoice, S2MultiSelectedResolver<T> >T> ? selectedResolver, ValueChanged<S2MultiSelected< ? onChange, S2ChoiceSelect<T> >S2MultiState< ? onSelect, S2ModalOpen<T> , S2Choice<T> >S2MultiState< ? onModalOpen, S2ModalClose<T> >S2MultiState< ? onModalClose, S2ModalWillOpen<T> >S2MultiState< ? onModalWillOpen, S2ModalWillClose<T> >S2MultiState< ? onModalWillClose, S2Validation<T> >S2MultiChosen< ? validation, S2Validation<T> >S2MultiChosen< ? modalValidation, List<T> >S2Choice< ? choiceItems, S2ChoiceLoader<T> >T> ? choiceLoader, S2MultiBuilder<T> ? builder, S2WidgetBuilder<S2MultiState< ? tileBuilder, S2WidgetBuilder<T> >S2MultiState< ? modalBuilder, S2WidgetBuilder<T> >S2MultiState< ? modalHeaderBuilder, S2ListWidgetBuilder<T> >S2MultiState< ? modalActionsBuilder, S2WidgetBuilder<T> >S2MultiState< ? modalConfirmBuilder, S2WidgetBuilder<T> >S2MultiState< ? modalDividerBuilder, S2WidgetBuilder<T> >S2MultiState< ? modalFilterBuilder, S2WidgetBuilder<T> >S2MultiState< ? modalFilterToggleBuilder, S2ComplexWidgetBuilder<T> >S2MultiState< ? choiceBuilder, S2ComplexWidgetBuilder<T> , S2Choice<T> >S2MultiState< ? choiceTitleBuilder, S2ComplexWidgetBuilder<T> , S2Choice<T> >S2MultiState< ? choiceSubtitleBuilder, S2ComplexWidgetBuilder<T> , S2Choice<T> >S2MultiState< ? choiceSecondaryBuilder, IndexedWidgetBuilder? choiceDividerBuilder, S2WidgetBuilder<T> , S2Choice<T> >S2MultiState< ? choiceEmptyBuilder, S2ComplexWidgetBuilder<T> >S2MultiState< ? groupBuilder, S2ComplexWidgetBuilder<T> , S2Group<T> >S2MultiState< ? groupHeaderBuilder, S2ChoiceConfig? choiceConfig, S2ChoiceStyle? choiceStyle, S2ChoiceStyle? choiceActiveStyle, S2ChoiceType? choiceType, S2ChoiceLayout? choiceLayout, Axis? choiceDirection, bool? choiceGrouped, bool? choiceDivider, SliverGridDelegate? choiceGrid, int? choiceGridCount, double? choiceGridSpacing, int? choicePageLimit, Duration? choiceDelay, S2GroupConfig? groupConfig, bool? groupEnabled, bool? groupSelector, bool? groupCounter, S2GroupSort? groupSortBy, S2GroupHeaderStyle? groupHeaderStyle, S2ModalConfig? modalConfig, S2ModalStyle? modalStyle, S2ModalHeaderStyle? modalHeaderStyle, S2ModalType? modalType, String? modalTitle, bool? modalConfirm, bool? modalHeader, bool? modalFilter, bool? modalFilterAuto, String? modalFilterHint})T> , S2Group<T> > -
Constructor for multiple choice
factory
-
SmartSelect.single({Key? key, String? title, String placeholder = 'Select one', required T selectedValue, S2Choice<
T> ? selectedChoice, S2SingleSelectedResolver<T> ? selectedResolver, ValueChanged<S2SingleSelected< ? onChange, S2ChoiceSelect<T> >S2SingleState< ? onSelect, S2ModalOpen<T> , S2Choice<T> >S2SingleState< ? onModalOpen, S2ModalClose<T> >S2SingleState< ? onModalClose, S2ModalWillOpen<T> >S2SingleState< ? onModalWillOpen, S2ModalWillClose<T> >S2SingleState< ? onModalWillClose, S2Validation<T> >S2SingleChosen< ? validation, S2Validation<T> >S2SingleChosen< ? modalValidation, List<T> >S2Choice< ? choiceItems, S2ChoiceLoader<T> >T> ? choiceLoader, S2SingleBuilder<T> ? builder, S2WidgetBuilder<S2SingleState< ? tileBuilder, S2WidgetBuilder<T> >S2SingleState< ? modalBuilder, S2WidgetBuilder<T> >S2SingleState< ? modalHeaderBuilder, S2ListWidgetBuilder<T> >S2SingleState< ? modalActionsBuilder, S2WidgetBuilder<T> >S2SingleState< ? modalConfirmBuilder, S2WidgetBuilder<T> >S2SingleState< ? modalDividerBuilder, S2WidgetBuilder<T> >S2SingleState< ? modalFilterBuilder, S2WidgetBuilder<T> >S2SingleState< ? modalFilterToggleBuilder, S2ComplexWidgetBuilder<T> >S2SingleState< ? choiceBuilder, S2ComplexWidgetBuilder<T> , S2Choice<T> >S2SingleState< ? choiceTitleBuilder, S2ComplexWidgetBuilder<T> , S2Choice<T> >S2SingleState< ? choiceSubtitleBuilder, S2ComplexWidgetBuilder<T> , S2Choice<T> >S2SingleState< ? choiceSecondaryBuilder, IndexedWidgetBuilder? choiceDividerBuilder, S2WidgetBuilder<T> , S2Choice<T> >S2SingleState< ? choiceEmptyBuilder, S2ComplexWidgetBuilder<T> >S2SingleState< ? groupBuilder, S2ComplexWidgetBuilder<T> , S2Group<T> >S2SingleState< ? groupHeaderBuilder, S2ChoiceConfig? choiceConfig, S2ChoiceStyle? choiceStyle, S2ChoiceStyle? choiceActiveStyle, S2ChoiceType? choiceType, S2ChoiceLayout? choiceLayout, Axis? choiceDirection, bool? choiceGrouped, bool? choiceDivider, SliverGridDelegate? choiceGrid, int? choiceGridCount, double? choiceGridSpacing, int? choicePageLimit, Duration? choiceDelay, S2GroupConfig? groupConfig, bool? groupEnabled, bool? groupSelector, bool? groupCounter, S2GroupSort? groupSortBy, S2GroupHeaderStyle? groupHeaderStyle, S2ModalConfig? modalConfig, S2ModalStyle? modalStyle, S2ModalHeaderStyle? modalHeaderStyle, S2ModalType? modalType, String? modalTitle, bool? modalConfirm, bool? modalHeader, bool? modalFilter, bool? modalFilterAuto, String? modalFilterHint})T> , S2Group<T> > -
Constructor for single choice
factory
Properties
- choiceConfig → S2ChoiceConfig
-
Choice configuration
final
-
choiceItems
→ List<
S2Choice< ?T> > -
List of choice item
final
-
choiceLoader
→ S2ChoiceLoader<
T> ? -
The function to load the choice items
final
- groupConfig → S2GroupConfig
-
Group configuration
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMultiChoice → bool
-
Whether show the choice items
as single choice or multiple choice
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- modalConfig → S2ModalConfig
-
Modal configuration
final
-
multiBuilder
→ S2MultiBuilder<
T> ? -
Builder collection of multiple choice widget
final
-
multiModalValidation
→ S2Validation<
S2MultiChosen< ?T> > -
Modal validation of multiple choice widget
final
-
multiOnChange
→ ValueChanged<
S2MultiSelected< ?T> > -
Called when value changed in multiple choice widget
final
-
multiOnModalClose
→ S2ModalClose<
S2MultiState< ?T> > -
Called when modal closed in multiple choice widget
final
-
multiOnModalOpen
→ S2ModalOpen<
S2MultiState< ?T> > -
Called when modal open in multiple choice widget
final
-
multiOnModalWillClose
→ S2ModalWillClose<
S2MultiState< ?T> > -
Called when modal will close in single choice widget
final
-
multiOnModalWillOpen
→ S2ModalWillOpen<
S2MultiState< ?T> > -
Called when modal will close in single choice widget
final
-
multiOnSelect
→ S2ChoiceSelect<
S2MultiState< ?T> , S2Choice<T> > -
Called when selection has been made in multiple choice widget
final
-
multiSelected
→ S2MultiSelected<
T> ? -
Initial selected choices
final
-
multiValidation
→ S2Validation<
S2MultiChosen< ?T> > -
A function used to validate the selected choices
final
- placeholder → String?
-
The text displayed when the value is null
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
singleBuilder
→ S2SingleBuilder<
T> ? -
Builder collection of single choice widget
final
-
singleModalValidation
→ S2Validation<
S2SingleChosen< ?T> > -
Modal validation of single choice widget
final
-
singleOnChange
→ ValueChanged<
S2SingleSelected< ?T> > -
Called when value changed in single choice widget
final
-
singleOnModalClose
→ S2ModalClose<
S2SingleState< ?T> > -
Called when modal closed in single choice widget
final
-
singleOnModalOpen
→ S2ModalOpen<
S2SingleState< ?T> > -
Called when modal opened in single choice widget
final
-
singleOnModalWillClose
→ S2ModalWillClose<
S2SingleState< ?T> > -
Called when modal will close in single choice widget
final
-
singleOnModalWillOpen
→ S2ModalWillOpen<
S2SingleState< ?T> > -
Called when modal will close in single choice widget
final
-
singleOnSelect
→ S2ChoiceSelect<
S2SingleState< ?T> , S2Choice<T> > -
Called when selection has been made in single choice widget
final
-
singleSelected
→ S2SingleSelected<
T> ? -
Initial selected choice
final
-
singleValidation
→ S2Validation<
S2SingleChosen< ?T> > -
A function used to validate the selected choice
final
- title → String?
-
The primary content of the widget.
Used in trigger widget and header option
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → S2State< 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