ItemView<K extends Object, Section, Item> class

Rich view of a visible item passed to an item builder.

Constructors

ItemView({required K key, required Item item, required K sectionKey, required Section section, required int indexInSection, required SectionedListController<K, Section, Item> controller})
const

Properties

controller SectionedListController<K, Section, Item>
The controller backing this view.
final
hashCode int
The hash code for this object.
no setterinherited
indexInSection int
Position among siblings in the section, 0-based, in live-list space (skipping pending-deletion siblings).
final
item → Item
User payload.
final
key → K
Unique identifier for this item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
section → Section
Section payload, resolved for convenience.
final
sectionKey → K
Identifier of the section this item belongs to.
final

Methods

moveTo({K? section, int? index}) → void
Moves this item to section and/or index.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove({bool animate = true}) → void
Removes this item.
toString() String
A string representation of this object.
inherited
update(Item item) → void
Replaces this item's payload. Asserts that the item still exists.
watch({required Widget builder(BuildContext context, ItemView<K, Section, Item> view), Key? widgetKey}) Widget
Selectively rebuilds builder when this item's payload changes via controller.updateItem. Does NOT trigger on indexInSection changes (e.g., a sibling moves) or on reparenting — those are structural and the row is rebuilt by the underlying SliverTree as part of normal layout.

Operators

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