MultiselectScope<T> class Null safety

Widget to manage item selection

Inheritance

Constructors

MultiselectScope({Key? key, required List<T> dataSource, MultiselectController? controller, SelectionChangedCallback<T>? onSelectionChanged, bool clearSelectionOnPop = false, bool keepSelectedItemsBetweenUpdates = true, List<int>? initialSelectedIndexes, required Widget child})

Properties

child Widget
A child widget that usually contains in its subtree a list of items whose selection you want to control
final
clearSelectionOnPop bool
Clear selection if user push back button
final
controller MultiselectController?
An object that stores the selected indexes and also allows you to change them This object may be set once and can not be replaced when updating the widget configuration
final
dataSource List<T>
Data for selection tracking For example list of Cars or Employes
final
hashCode int
The hash code for this object.
@nonVirtualread-onlyinherited
initialSelectedIndexes List<int>?
Selected indexes, which will be initialized when the widget is inserted into the widget tree
final
keepSelectedItemsBetweenUpdates bool
If true: when you update dataSource then selected indexes will update so that the same elements in new dataSource are selected If false: selected indexes will have not automatically updates during dataSource update
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSelectionChanged SelectionChangedCallback<T>?
Function that invoked when selected indexes changes. Builds appropriate listeners on stage of init MultiselectScope widget and then does not change. This function will not invoke on first load of this widget.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _MultiselectScopeState<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.
@protectedinherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.
@nonVirtualinherited

Static Methods

controllerOf(BuildContext context) MultiselectController