MultiSelectSearch<T> class

Make sure your model class must contain fromJson & toJson method/ If you want to change selected item Chip theme change chipThemeData in your AppTheme

Inheritance

Constructors

MultiSelectSearch({Key? key, EdgeInsetsGeometry? padding, Widget? clearAll, double? maxHeight, Decoration? decoration, TextStyle? chipTextStyle, required List<T> items, required void onChanged(List<T> data), Widget? emptyListIndicator, required Widget itemBuilder(T), required List<T> initialValue, InputDecoration? searchFieldDecoration, required String chipLabelKey})
const

Properties

chipLabelKey String
A field name of your model to show its value in Chip For examle: You have a List
final
chipTextStyle TextStyle?
Selected item Chip's text style
final
clearAll Widget?
When clicked, all selected items will be cleared. Don't give button widgets because they have their own onPressed method.
final
decoration Decoration?
Search field & selected items Container decoration
final
emptyListIndicator Widget?
A widget to display when there is no more item to choose in the list
final
hashCode int
The hash code for this object.
no setterinherited
initialValue List<T>
The list of initial selected items
final
itemBuilder Widget Function(T)
A builder to display list of widgets that you can select/unselect from.
final
items List<T>
List of all items to select from
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxHeight double?
Search field & selected items Container's max height
final
onChanged → void Function(List<T> data)
Called everytime when user selects or unselects an item. Returns selected items. If user selects an item it gets added to the selected items. If user unselect by tapping on deleteIcon on the chip, it gets removed from the selected items.
final
padding EdgeInsetsGeometry?
Search field & selected items Container padding
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchFieldDecoration InputDecoration?
Search field input decoration to change its style, hint text and more.
final

Methods

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