TdnMultiSelectDropdown<T> class

Custom multi-select dropdown styled to match TdnDropdownButton.

Tapping the field opens a bottom sheet with checkboxes for each item. Selected values are displayed as chips (default) or as comma-separated text inside the field.

Features:

  • Same border styles as TdnDropdownButton (rounded, top, bottom, square)
  • Chip or text display of selected items
  • Full Form integration via FormField
  • Dark-mode support
  • Premium icon support
  • Disabled state

Usage:

TdnMultiSelectDropdown<String>(
  items: [
    TdnMultiSelectItem(value: '1', label: 'Option 1'),
    TdnMultiSelectItem(value: '2', label: 'Option 2'),
  ],
  hintText: 'Select options',
  onChanged: (values) => setState(() => selected = values),
)

// With initial values
TdnMultiSelectDropdown<String>(
  items: items,
  initialValues: ['1'],
  hintText: 'Categories',
)

// Text display instead of chips
TdnMultiSelectDropdown<String>(
  items: items,
  showAsChips: false,
  hintText: 'Tags',
)

// Single-select mode
TdnMultiSelectDropdown<String>(
  items: items,
  multiSelect: false,
  hintText: 'Pick one',
  onChanged: (values) => setState(() => picked = values.firstOrNull),
)
Inheritance
Available extensions

Constructors

TdnMultiSelectDropdown({Key? key, required List<TdnMultiSelectItem<T>> items, List<T> initialValues = const [], String? hintText, String? labelText, String? errorText, Widget? prefixIcon, bool enabled = true, ValueChanged<List<T>>? onChanged, FormFieldValidator<List<T>>? validator, bool topFieldMode = false, bool bottomFieldMode = false, bool withoutBorders = false, bool premiumIcon = false, bool showAsChips = true, String? bottomSheetTitle, bool multiSelect = true})
const

Properties

bottomFieldMode bool
Border style: square top, rounded bottom (last field in a stack).
final
bottomSheetTitle String?
Title shown at the top of the bottom sheet. Falls back to hintText.
final
enabled bool
Whether the field accepts interaction.
final
errorText String?
Error text. Empty string or null means no error.
final
hashCode int
The hash code for this object.
no setterinherited
hintText String?
Hint text displayed when nothing is selected.
final
initialValues List<T>
Pre-selected values when the widget is first built.
final
items List<TdnMultiSelectItem<T>>
Selectable items shown in the bottom sheet.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelText String?
Floating label text above the field.
final
multiSelect bool
When true (default) multiple items can be selected simultaneously. When false only one item can be active at a time – selecting a new item deselects the previous one and closes the sheet automatically.
final
onChanged ValueChanged<List<T>>?
Called with the full list of selected values whenever selection changes.
final
prefixIcon Widget?
Icon widget displayed at the start of the field.
final
premiumIcon bool
Shows a premium / power-up icon on the right side.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showAsChips bool
When true (default), selected items are displayed as chips. When false, they are shown as comma-separated text.
final
topFieldMode bool
Border style: rounded top, square bottom (first field in a stack).
final
validator FormFieldValidator<List<T>>?
Validator for Form integration. Receives the current selection list.
final
withoutBorders bool
Border style: all square (middle fields in a stack).
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<TdnMultiSelectDropdown<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
toHorizontalScrollWidget({double height = 40.0}) Widget

Available on Widget, provided by the HorizontalScrollWidgetExtension extension

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
withRoundedBorders({double borderRadius = 8.0, bool circular = true, BorderRadius? custom}) Widget

Available on Widget, provided by the BorderRadiusExtension extension

Operators

operator ==(Object other) bool
The equality operator.
inherited