M3EExpandableList class

A spring-animated expandable card list.

Supports three layouts via named constructors:

Header reorder and selection are supported on main expandable rows (reorder / onReorder, selection / selectionState, …). Nested sublists keep their own APIs via M3EExpandableExpanded.list. If a row is expanded when a reorder drag starts, it snap-collapses and restores after settle. Sliver layout supports selection but not reorder.

Inheritance

Constructors

M3EExpandableList({Key? key, required List<M3EExpandableData> data, bool? allowMultipleExpanded, Set<int> initiallyExpanded = const {}, M3EExpandableStyle? style, M3ESpring? expandMotion, M3ESpring? collapseMotion, void onExpansionChanged(int index, {required bool isExpanded})?, bool selection = false, M3ESelectionController? selectionController, ValueChanged<Set<int>>? onSelectionChanged, M3EListSelectionState? selectionState, bool reorder = false, ReorderCallback? onReorder, M3EListReorderState? reorderState})
M3EExpandableList.
M3EExpandableList.builder({Key? key, required int itemCount, required M3EExpandableHeaderBuilder headerBuilder, required M3EExpandableBodyBuilder bodyBuilder, M3EExpandableExpanded? expandedBuilder(int index)?, bool? allowMultipleExpanded, Set<int> initiallyExpanded = const {}, M3EExpandableStyle? style, M3ESpring? expandMotion, M3ESpring? collapseMotion, void onExpansionChanged(int index, {required bool isExpanded})?, bool selection = false, M3ESelectionController? selectionController, ValueChanged<Set<int>>? onSelectionChanged, M3EListSelectionState? selectionState, bool reorder = false, ReorderCallback? onReorder, M3EListReorderState? reorderState})
builder.
const
M3EExpandableList.scrollable({Key? key, required List<M3EExpandableData> data, bool? allowMultipleExpanded, Set<int> initiallyExpanded = const {}, M3EExpandableStyle? style, M3ESpring? expandMotion, M3ESpring? collapseMotion, void onExpansionChanged(int index, {required bool isExpanded})?, bool selection = false, M3ESelectionController? selectionController, ValueChanged<Set<int>>? onSelectionChanged, M3EListSelectionState? selectionState, bool reorder = false, ReorderCallback? onReorder, M3EListReorderState? reorderState, ScrollController? controller, ScrollPhysics? physics, bool shrinkWrap = false, EdgeInsetsGeometry? padding})
scrollable.
M3EExpandableList.scrollableBuilder({Key? key, required int itemCount, required M3EExpandableHeaderBuilder headerBuilder, required M3EExpandableBodyBuilder bodyBuilder, M3EExpandableExpanded? expandedBuilder(int index)?, bool? allowMultipleExpanded, Set<int> initiallyExpanded = const {}, M3EExpandableStyle? style, M3ESpring? expandMotion, M3ESpring? collapseMotion, void onExpansionChanged(int index, {required bool isExpanded})?, bool selection = false, M3ESelectionController? selectionController, ValueChanged<Set<int>>? onSelectionChanged, M3EListSelectionState? selectionState, bool reorder = false, ReorderCallback? onReorder, M3EListReorderState? reorderState, ScrollController? controller, ScrollPhysics? physics, bool shrinkWrap = false, EdgeInsetsGeometry? padding})
scrollableBuilder.
const
M3EExpandableList.sliver({Key? key, required List<M3EExpandableData> data, bool? allowMultipleExpanded, Set<int> initiallyExpanded = const {}, M3EExpandableStyle? style, M3ESpring? expandMotion, M3ESpring? collapseMotion, void onExpansionChanged(int index, {required bool isExpanded})?, bool selection = false, M3ESelectionController? selectionController, ValueChanged<Set<int>>? onSelectionChanged, M3EListSelectionState? selectionState})
sliver.
M3EExpandableList.sliverBuilder({Key? key, required int itemCount, required M3EExpandableHeaderBuilder headerBuilder, required M3EExpandableBodyBuilder bodyBuilder, M3EExpandableExpanded? expandedBuilder(int index)?, bool? allowMultipleExpanded, Set<int> initiallyExpanded = const {}, M3EExpandableStyle? style, M3ESpring? expandMotion, M3ESpring? collapseMotion, void onExpansionChanged(int index, {required bool isExpanded})?, bool selection = false, M3ESelectionController? selectionController, ValueChanged<Set<int>>? onSelectionChanged, M3EListSelectionState? selectionState})
sliverBuilder.
const

Properties

allowMultipleExpanded bool?
allowMultipleExpanded.
finalinherited
bodyBuilder M3EExpandableBodyBuilder
bodyBuilder.
finalinherited
collapseMotion M3ESpring?
collapseMotion.
finalinherited
controller ScrollController?
controller.
final
expandedBuilder M3EExpandableExpanded? Function(int index)?
Optional per-index expanded content (.list or .content).
finalinherited
expandMotion M3ESpring?
expandMotion.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
headerBuilder M3EExpandableBodyBuilder
headerBuilder.
finalinherited
initiallyExpanded Set<int>
initiallyExpanded.
finalinherited
itemCount int
itemCount.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onExpansionChanged → void Function(int index, {required bool isExpanded})?
Called when an item expands or collapses.
finalinherited
onReorder ReorderCallback?
Called after a successful header reorder drop.
finalinherited
onSelectionChanged ValueChanged<Set<int>>?
Called when selection indices change.
finalinherited
padding EdgeInsetsGeometry?
padding.
final
physics ScrollPhysics?
physics.
final
reorder bool
Enables long-press reorder of header rows. Requires onReorder.
finalinherited
reorderState M3EListReorderState?
Optional reorder state override (else M3EListTheme.reorder).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selection bool
Enables selection on main expandable rows (not nested sublists).
finalinherited
selectionController M3ESelectionController?
Optional selection controller; ancestor M3ESelectionScope wins.
finalinherited
selectionState M3EListSelectionState?
Optional selection state override (else M3EListTheme.selection).
finalinherited
shrinkWrap bool
shrinkWrap.
final
style M3EExpandableStyle?
style.
finalinherited

Methods

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