AnimatedSliverMultiBoxAdaptorElement class
An element that lazily builds children for a SliverWithKeepAliveWidget.
Implements RenderSliverBoxChildManager, which lets this element manage the children of subclasses of RenderSliverMultiBoxAdaptor.
This class takes the implementation of the standard SliverMultiBoxAdaptorElement class and adds support for animations and reordering feature.
- Inheritance
-
- Object
- DiagnosticableTree
- Element
- RenderObjectElement
- AnimatedSliverMultiBoxAdaptorElement
- Implemented types
Constructors
- AnimatedSliverMultiBoxAdaptorElement(AnimatedSliverMultiBoxAdaptorWidget widget)
- Creates an element that lazily builds children for the given widget with support for animations and reordering.
Properties
- childCount → int
-
no setteroverride
- debugDoingBuild → bool
-
Whether the widget is currently updating the widget or render tree.
no setterinherited
- debugIsActive → bool
-
Returns true if the Element is active.
no setterinherited
- debugIsDefunct → bool
-
Returns true if the Element is defunct.
no setterinherited
- delegate → AnimatedSliverChildDelegate
-
no setter
- depth → int
-
An integer that is guaranteed to be greater than the parent's, if any.
The element at the root of the tree must have a depth greater than 0.
no setterinherited
- dirty → bool
-
Returns true if the element has been marked as needing rebuilding.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isHorizontal → bool
-
no setter
-
listOfPopUps
→ List<
_PopUpList> -
no setteroverride
-
managedPopUpLists
→ Iterable<
_PopUpList> -
no setter
- mounted → bool
-
Whether the Widget this context is associated with is currently
mounted in the widget tree.
no setterinherited
- owner → BuildOwner?
-
The object that manages the lifecycle of this element.
no setterinherited
- renderObject → AnimatedRenderSliverMultiBoxAdaptor
-
The underlying RenderObject for this element.
no setteroverride
- renderObjectAttachingChild → Element?
-
Returns the child of this Element that will insert a RenderObject into
an ancestor of this Element to construct the render tree.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → Size?
-
The size of the RenderBox returned by findRenderObject.
no setterinherited
- slot → Object?
-
Information set by parent to define where this child fits in its parent's
child list.
no setterinherited
- widget → AnimatedSliverMultiBoxAdaptorWidget
-
The configuration for this element.
no setteroverride
Methods
-
activate(
) → void -
Transition from the "inactive" to the "active" lifecycle state.
inherited
-
attachNotificationTree(
) → void -
Called in Element.mount and Element.activate to register this element in
the notification tree.
inherited
-
attachRenderObject(
Object? newSlot) → void -
Add renderObject to the render tree at the location specified by
newSlot
.inherited -
batch(
VoidCallback callback) → void - See AnimatedListController.batch.
-
build(
int index, {bool measureOnly = false, _PopUpList? popUpList}) → Widget? -
buildIndexFromContext(
BuildContext context) → _Slot? -
computeItemBox(
int index, bool absolute) → Rect? - See AnimatedListController.computeItemBox.
-
createChild(
_PopUpList? popUpList, int index, {required RenderBox? after}) → void -
Copied from SliverMultiBoxAdaptorElement.createChild.
override
-
deactivate(
) → void -
Transition from the "active" to the "inactive" lifecycle state.
inherited
-
deactivateChild(
Element child) → void -
Move the given element to the list of inactive elements and detach its
render object from the render tree.
inherited
-
debugAssertChildListLocked(
) → bool -
Copied from SliverMultiBoxAdaptorElement.debugAssertChildListLocked.
override
-
debugDeactivated(
) → void -
Called, in debug mode, after children have been deactivated (see deactivate).
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugExpectsRenderObjectForSlot(
Object? slot) → bool -
Whether the child in the provided
slot
(or one of its descendants) must insert a RenderObject into its ancestor RenderObjectElement by calling RenderObjectElement.insertRenderObjectChild on it.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
debugGetCreatorChain(
int limit) → String -
Returns a description of what caused this element to be created.
inherited
-
debugGetDiagnosticChain(
) → List< Element> -
Returns the parent chain from this element back to the root of the tree.
inherited
-
debugVisitOnstageChildren(
ElementVisitor visitor) → void -
Copied from SliverMultiBoxAdaptorElement.debugVisitOnstageChildren.
override
-
dependOnInheritedElement(
InheritedElement ancestor, {Object? aspect}) → InheritedWidget -
Registers this build context with
ancestor
such that whenancestor
's widget changes this build context is rebuilt.inherited -
dependOnInheritedWidgetOfExactType<
T extends InheritedWidget> ({Object? aspect}) → T? -
Returns the nearest widget of the given type
T
and creates a dependency on it, or null if no appropriate widget is found.inherited -
describeElement(
String name, {DiagnosticsTreeStyle style = DiagnosticsTreeStyle.errorProperty}) → DiagnosticsNode -
Returns a description of the Element associated with the current build context.
inherited
-
describeMissingAncestor(
{required Type expectedAncestorType}) → List< DiagnosticsNode> -
Adds a description of a specific type of widget missing from the current
build context's ancestry tree.
inherited
-
describeOwnershipChain(
String name) → DiagnosticsNode -
Adds a description of the ownership chain from a specific Element
to the error report.
inherited
-
describeWidget(
String name, {DiagnosticsTreeStyle style = DiagnosticsTreeStyle.errorProperty}) → DiagnosticsNode -
Returns a description of the Widget associated with the current build context.
inherited
-
detachRenderObject(
) → void -
Remove renderObject from the render tree.
inherited
-
didAdoptChild(
RenderBox child) → void -
Copied from SliverMultiBoxAdaptorElement.didAdoptChild.
An assertion has been removed to allow adoption of off-list elements.
override
-
didChangeDependencies(
) → void -
Called when a dependency of this element changes.
override
-
didFinishLayout(
_PopUpList? popUpList) → void -
Copied from SliverMultiBoxAdaptorElement.didFinishLayout.
override
-
didStartLayout(
_PopUpList? popUpList) → void -
Copied from SliverMultiBoxAdaptorElement.didStartLayout.
override
-
dispatchNotification(
Notification notification) → void -
Start bubbling this notification at the given build context.
inherited
-
disposableElement(
Widget widget, void callback(RenderBox)) → void -
It creates an disposable off-list element built with the specified
widget
, and executes thecallback
. Eventually, the child is disposed. -
doesDependOnInheritedElement(
InheritedElement ancestor) → bool -
Returns
true
if dependOnInheritedElement was previously called withancestor
.inherited -
estimateLayoutOffset(
int buildIndex, int childCount, {double? time, _MovingPopUpList? popUpList}) → _Measure -
estimateMaxScrollOffset(
SliverConstraints constraints, {int? firstIndex, int? lastIndex, double? leadingScrollOffset, double? trailingScrollOffset}) → double -
Copied from SliverMultiBoxAdaptorElement.estimateMaxScrollOffset.
The SliverMultiBoxAdaptorWidget.estimateMaxScrollOffset method call
has been removed just now.
override
-
findAncestorRenderObjectOfType<
T extends RenderObject> () → T? -
Returns the RenderObject object of the nearest ancestor RenderObjectWidget widget
that is an instance of the given type
T
.inherited -
findAncestorStateOfType<
T extends State< (StatefulWidget> >) → T? -
Returns the State object of the nearest ancestor StatefulWidget widget
that is an instance of the given type
T
.inherited -
findAncestorWidgetOfExactType<
T extends Widget> () → T? -
Returns the nearest ancestor widget of the given type
T
, which must be the type of a concrete Widget subclass.inherited -
findRenderObject(
) → RenderObject? -
The current RenderObject for the widget. If the widget is a
RenderObjectWidget, this is the render object that the widget created
for itself. Otherwise, it is the render object of the first descendant
RenderObjectWidget.
inherited
-
findRootAncestorStateOfType<
T extends State< (StatefulWidget> >) → T? -
Returns the State object of the furthest ancestor StatefulWidget widget
that is an instance of the given type
T
.inherited -
forgetChild(
Element child) → void -
Copied from SliverMultiBoxAdaptorElement.forgetChild.
override
-
getElementForInheritedWidgetOfExactType<
T extends InheritedWidget> () → InheritedElement? -
Obtains the element corresponding to the nearest widget of the given type
T
, which must be the type of a concrete InheritedWidget subclass.inherited -
getInheritedWidgetOfExactType<
T extends InheritedWidget> () → T? -
Returns the nearest widget of the given InheritedWidget subclass
T
or null if an appropriate ancestor is not found.inherited -
getItemSizesFromSliverList(
int buildFrom, int buildTo) → _SizeResult? -
getItemVisibleSize(
int index) → _PercentageSize? - See AnimatedListController.getItemVisibleSize.
-
inflateWidget(
Widget newWidget, Object? newSlot) → Element -
Create an element for the given widget and add it as a child of this
element in the given slot.
inherited
-
insertRenderObjectChild(
covariant RenderObject child, covariant _Slot? slot) → void -
Copied from SliverMultiBoxAdaptorElement.insertRenderObjectChild.
This method has been changed to prevent inserting off-list elements into the children list.
override
-
markNeedsBuild(
) → void -
Marks the element as dirty and adds it to the global list of widgets to
rebuild in the next frame.
inherited
-
markNeedsLayout(
) → void -
measureItem(
Widget widget) → double -
Measures the size of the
widget
. -
measureItems(
_Cancelled? cancelled, int count, IndexedWidgetBuilder builder, [double startingSize = 0, int startingCount = 0]) → Future< _Measure> -
Measures the size of a bunch of off-list children up to
count
elements. You have to provide abuilder
to build thei
-th widget. The calculation is asynchronous and can becancelled
. -
mount(
Element? parent, dynamic newSlot) → void -
This method has been overridden to give the render object the
didChangeDependencies
method and to link this list view to its controller.override -
moveRenderObjectChild(
covariant RenderObject child, covariant _Slot? oldSlot, covariant _Slot? newSlot) → void -
Copied from SliverMultiBoxAdaptorElement.moveRenderObjectChild.
This method has been changed to prevent assertion errors.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyChangedRange(
int from, int count, AnimatedWidgetBuilder changedItemBuilder) → void - See AnimatedListController.notifyChangedRange.
-
notifyInsertedRange(
int from, int count) → void - See AnimatedListController.notifyInsertedRange.
-
notifyMovedRange(
int from, int count, int newIndex) → void - See AnimatedListController.notifyMovedRange.
-
notifyRemovedRange(
int from, int count, AnimatedWidgetBuilder removedItemBuilder) → void - See AnimatedListController.notifyRemovedRange.
-
notifyReplacedRange(
int from, int removeCount, int insertCount, AnimatedWidgetBuilder removedItemBuilder) → void - See AnimatedListController.notifyReplacedRange.
-
notifyStartReorder(
BuildContext context, double dx, double dy) → bool - See AnimatedListController.notifyStartReorder.
-
notifyStopReorder(
bool cancel) → void - See AnimatedListController.notifyStopReorder.
-
notifyUpdateReorder(
double dx, double dy) → void - See AnimatedListController.notifyUpdateReorder.
-
oldIndexToNewIndex(
int? index, _PopUpList? popUpList) → _ReindexResult -
This function takes the old
index
of a child and calculates the new one by considering all the pendingupdates
. This method can returnnull
if the child no longer exists (for example, all elements of a remove interval disappear when it becomes a resizing interval). -
performRebuild(
) → void -
Inspired by SliverMultiBoxAdaptorElement.performRebuild.
override
-
reassemble(
) → void -
Called whenever the application is reassembled during debugging, for
example during hot reload.
inherited
-
rebuild(
{bool force = false}) → void -
Cause the widget to update itself. In debug builds, also verify various
invariants.
inherited
-
removeChild(
_PopUpList? popUpList, RenderBox child) → void -
Copied from SliverMultiBoxAdaptorElement.removeChild.
override
-
removeRenderObjectChild(
covariant RenderObject child, covariant _Slot? slot) → void -
Copied from SliverMultiBoxAdaptorElement.removeRenderObjectChild.
This method has been changed to prevent the removal of unlisted children (eg off-list elements).
override
-
renderBoxAt(
int buildIndex) → RenderBox? -
reorderCancel(
) → void -
resizingIntervalUpdated(
_AnimatedSpaceInterval interval, double delta) → void - Notifies that the resizing interval has changed its size by the delta amount.
-
setDidUnderflow(
bool value) → void -
Copied from SliverMultiBoxAdaptorElement.setDidUnderflow.
The
didUnderflow
variabile is no longer needed.override -
test(
) → void -
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 element.
inherited
-
unmount(
) → void -
This method has been overridden to give the render object a
dispose
method and to unlink this list view from its controller.override -
update(
covariant AnimatedSliverMultiBoxAdaptorWidget newWidget) → void -
Change the widget used to configure this element.
override
-
updateChild(
Element? child, Widget? newWidget, dynamic newSlot) → Element? -
Copied from SliverMultiBoxAdaptorElement.updateChild.
override
-
updateChildren(
List< Element> oldChildren, List<Widget> newWidgets, {Set<Element> ? forgottenChildren, List<Object?> ? slots}) → List<Element> -
Updates the children of this element to use new widgets.
inherited
-
updateSlot(
Object? newSlot) → void -
Called by updateSlotForChild when the framework needs to change the slot
that this Element occupies in its ancestor.
inherited
-
updateSlotForChild(
Element child, Object? newSlot) → void -
Change the slot that the given child occupies in its parent.
inherited
-
visitAncestorElements(
ConditionalElementVisitor visitor) → void -
Walks the ancestor chain, starting with the parent of this build context's
widget, invoking the argument for each ancestor.
inherited
-
visitChildElements(
ElementVisitor visitor) → void -
Wrapper around visitChildren for BuildContext.
inherited
-
visitChildren(
ElementVisitor visitor) → void -
Copied from SliverMultiBoxAdaptorElement.visitChildren.
This method has been changed to include pop-up elements.
override
-
wrapWidget(
AnimatedWidgetBuilder builder, int index, AnimatedWidgetBuilderData data, [bool map = true]) → Widget
Operators
-
operator ==(
Object other) → bool -
Compare two widgets for equality.
inherited