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

Constructors

SmartSelect({Key? key, String? title, String? placeholder, required bool isMultiChoice, S2SingleSelected<T>? singleSelected, S2Validation<S2SingleChosen<T>>? singleValidation, S2Validation<S2SingleChosen<T>>? singleModalValidation, ValueChanged<S2SingleSelected<T>>? singleOnChange, S2ChoiceSelect<S2SingleState<T>, S2Choice<T>>? singleOnSelect, S2ModalOpen<S2SingleState<T>>? singleOnModalOpen, S2ModalClose<S2SingleState<T>>? singleOnModalClose, S2ModalWillOpen<S2SingleState<T>>? singleOnModalWillOpen, S2ModalWillClose<S2SingleState<T>>? singleOnModalWillClose, S2SingleBuilder<T>? singleBuilder, S2MultiSelected<T>? multiSelected, S2Validation<S2MultiChosen<T>>? multiValidation, S2Validation<S2MultiChosen<T>>? multiModalValidation, ValueChanged<S2MultiSelected<T>>? multiOnChange, S2ChoiceSelect<S2MultiState<T>, S2Choice<T>>? multiOnSelect, S2ModalOpen<S2MultiState<T>>? multiOnModalOpen, S2ModalClose<S2MultiState<T>>? multiOnModalClose, S2ModalWillOpen<S2MultiState<T>>? multiOnModalWillOpen, S2ModalWillClose<S2MultiState<T>>? multiOnModalWillClose, S2MultiBuilder<T>? multiBuilder, S2ModalConfig modalConfig = const S2ModalConfig(), S2ChoiceConfig choiceConfig = const S2ChoiceConfig(), S2GroupConfig groupConfig = const S2GroupConfig(), List<S2Choice<T>>? choiceItems, S2ChoiceLoader<T>? choiceLoader})
Default constructor
SmartSelect.multiple({Key? key, String? title, String placeholder = 'Select one or more', List<T> selectedValue = const [], List<S2Choice<T>>? selectedChoice, S2MultiSelectedResolver<T>? selectedResolver, ValueChanged<S2MultiSelected<T>>? onChange, S2ChoiceSelect<S2MultiState<T>, S2Choice<T>>? onSelect, S2ModalOpen<S2MultiState<T>>? onModalOpen, S2ModalClose<S2MultiState<T>>? onModalClose, S2ModalWillOpen<S2MultiState<T>>? onModalWillOpen, S2ModalWillClose<S2MultiState<T>>? onModalWillClose, S2Validation<S2MultiChosen<T>>? validation, S2Validation<S2MultiChosen<T>>? modalValidation, List<S2Choice<T>>? choiceItems, S2ChoiceLoader<T>? choiceLoader, S2MultiBuilder<T>? builder, S2WidgetBuilder<S2MultiState<T>>? tileBuilder, S2WidgetBuilder<S2MultiState<T>>? modalBuilder, S2WidgetBuilder<S2MultiState<T>>? modalHeaderBuilder, S2ListWidgetBuilder<S2MultiState<T>>? modalActionsBuilder, S2WidgetBuilder<S2MultiState<T>>? modalConfirmBuilder, S2WidgetBuilder<S2MultiState<T>>? modalDividerBuilder, S2WidgetBuilder<S2MultiState<T>>? modalFooterBuilder, S2WidgetBuilder<S2MultiState<T>>? modalFilterBuilder, S2WidgetBuilder<S2MultiState<T>>? modalFilterToggleBuilder, S2ComplexWidgetBuilder<S2MultiState<T>, S2Choice<T>>? choiceBuilder, S2ComplexWidgetBuilder<S2MultiState<T>, S2Choice<T>>? choiceTitleBuilder, S2ComplexWidgetBuilder<S2MultiState<T>, S2Choice<T>>? choiceSubtitleBuilder, S2ComplexWidgetBuilder<S2MultiState<T>, S2Choice<T>>? choiceSecondaryBuilder, IndexedWidgetBuilder? choiceDividerBuilder, S2WidgetBuilder<S2MultiState<T>>? choiceEmptyBuilder, S2ComplexWidgetBuilder<S2MultiState<T>, S2Group<T>>? groupBuilder, S2ComplexWidgetBuilder<S2MultiState<T>, S2Group<T>>? 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})
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<T>>? onChange, S2ChoiceSelect<S2SingleState<T>, S2Choice<T>>? onSelect, S2ModalOpen<S2SingleState<T>>? onModalOpen, S2ModalClose<S2SingleState<T>>? onModalClose, S2ModalWillOpen<S2SingleState<T>>? onModalWillOpen, S2ModalWillClose<S2SingleState<T>>? onModalWillClose, S2Validation<S2SingleChosen<T>>? validation, S2Validation<S2SingleChosen<T>>? modalValidation, List<S2Choice<T>>? choiceItems, S2ChoiceLoader<T>? choiceLoader, S2SingleBuilder<T>? builder, S2WidgetBuilder<S2SingleState<T>>? tileBuilder, S2WidgetBuilder<S2SingleState<T>>? modalBuilder, S2WidgetBuilder<S2SingleState<T>>? modalHeaderBuilder, S2ListWidgetBuilder<S2SingleState<T>>? modalActionsBuilder, S2WidgetBuilder<S2SingleState<T>>? modalConfirmBuilder, S2WidgetBuilder<S2SingleState<T>>? modalDividerBuilder, S2WidgetBuilder<S2SingleState<T>>? modalFooterBuilder, S2WidgetBuilder<S2SingleState<T>>? modalFilterBuilder, S2WidgetBuilder<S2SingleState<T>>? modalFilterToggleBuilder, S2ComplexWidgetBuilder<S2SingleState<T>, S2Choice<T>>? choiceBuilder, S2ComplexWidgetBuilder<S2SingleState<T>, S2Choice<T>>? choiceTitleBuilder, S2ComplexWidgetBuilder<S2SingleState<T>, S2Choice<T>>? choiceSubtitleBuilder, S2ComplexWidgetBuilder<S2SingleState<T>, S2Choice<T>>? choiceSecondaryBuilder, IndexedWidgetBuilder? choiceDividerBuilder, S2WidgetBuilder<S2SingleState<T>>? choiceEmptyBuilder, S2ComplexWidgetBuilder<S2SingleState<T>, S2Group<T>>? groupBuilder, S2ComplexWidgetBuilder<S2SingleState<T>, S2Group<T>>? 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})
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