ReorderableWrapController class
Handles drag and drop of the children in ReorderableBuilder.wrap.
Children in a Wrap can have different sizes, so swapping the positions of two colliding children would let them overlap. Instead, the positions of all children are recalculated like a Wrap would lay them out.
- Inheritance
-
- Object
- ReorderableController
- ReorderableDragAndDropController
- ReorderableBuilderController
- ReorderableWrapController
Constructors
Properties
-
builtKeyValues
→ Set<
String> -
Key values of children built since the item count decreased.
finalinherited
-
childrenKeyMap
→ Map<
String, ReorderableEntity> -
finalinherited
-
childrenOrderMap
→ Map<
int, ReorderableEntity> -
finalinherited
- draggedEntity ↔ ReorderableEntity?
-
Instance of dragged entity when dragging starts.
getter/setter pairinherited
-
draggingAnimationMap
→ Map<
ValueKey, DraggingAnimationEntity> -
Visible offsets of all children animated while dragging, by their key.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isScrollableOutside ↔ bool
-
Defines if the scrollable part is outside of the widget.
getter/setter pairinherited
-
lastBuiltChildren
→ Map<
String, Widget> -
Last built widget of every child by its key value.
finalinherited
-
lastRemovedEntities
↔ List<
ReorderableEntity> -
Entities of the children removed by the last update of the children.
getter/setter pairinherited
-
lockedIndices
↔ List<
int> -
Indices of children that cannot move while drag and drop.
getter/setter pairinherited
-
offsetMap
→ Map<
int, Offset> -
finalinherited
- positionChangeDelay ↔ Duration
-
Delay for position changes caused by removed children.
getter/setter pairinherited
- releasedReorderableEntity ↔ ReleasedReorderableEntity?
-
Entity that is released after drag and drop.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollDirection ↔ Axis?
-
Main axis of the grid, used when dragging before/after all children.
getter/setter pairinherited
- scrollOffset ↔ Offset
-
Holding this value for better performance.
getter/setter pairinherited
- startDraggingScrollOffset ↔ Offset
-
Saves the state of scroll Offset when the drag and drop is starting.
getter/setter pairinherited
-
wrapKey
→ GlobalKey<
State< StatefulWidget> > -
Key of the Wrap returned by ReorderableBuilder.builder.
final
Methods
-
addBuiltChild(
{required ValueKey key, required Widget child}) → void -
Saves
childas the last built widget ofkey.inherited -
applyCollision(
{required ReorderableEntity? collision, required Offset draggedOffset}) → bool -
Exchanges the dragged child with
collisionand lays out all children.override -
calculateWrapOffsets(
{required List< Size> sizes, required RenderWrap renderWrap}) → List<Offset> -
Calculates the offsets of children with
sizeslikerenderWrapwould do. -
getReorderableEntity(
{required ValueKey key, required int index}) → ReorderableEntity -
Returns the entity of
keyatindexwith its known position.override -
handleCreatedChild(
{required Offset? offset, required Size size, required ReorderableEntity reorderableEntity}) → ReorderableEntity -
Marks a measured child that changed its order as moved to animate it.
override
-
handleDragEnd(
) → List< ReorderUpdateEntity> ? -
Returns the moves from the order before dragging to the current order.
override
-
handleDragStarted(
{required ReorderableEntity reorderableEntity, required Offset currentScrollOffset, required List< int> lockedIndices, required bool isScrollableOutside, required int? itemCount, required Axis? scrollDirection}) → void -
inherited
-
handleDragUpdate(
{required PointerMoveEvent pointerMoveEvent}) → bool -
inherited
-
handleMovingFinished(
{required ReorderableEntity reorderableEntity}) → ReorderableEntity -
Updates offset and order id of
reorderableEntityfaded in.inherited -
handleOpacityFinished(
{required ReorderableEntity reorderableEntity}) → ReorderableEntity -
Updates offset and order id of
reorderableEntityfaded in.inherited -
handleSizeChanged(
) → void -
Resets all entities in childrenOrderMap and childrenKeyMap.
inherited
-
initChildren(
{required List< Widget> children}) → void -
Adds ReorderableEntity for all
childrento two maps.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeBuiltChild(
{required ValueKey key, required Widget child}) → void -
Removes
childofkeyfrom lastBuiltChildren after it was disposed.inherited -
reorderList<
T> ({required List< T> items, required List<ReorderUpdateEntity> reorderUpdateEntities}) → List<T> -
Reorders list of
itemsthat depends onreorderUpdateEntities.inherited -
replaceMaps(
{required Map< String, ReorderableEntity> updatedChildrenKeyMap, required Map<int, ReorderableEntity> updatedChildrenOrderMap}) → void -
inherited
-
shortenMapsToItemCount(
{required int itemCount}) → void -
Removes all children that have a higher position the
itemCount.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
updateChildren(
{required List< Widget> children}) → void -
Updates the children and measures the ones with a new position again.
override
-
updateToActualPositions(
) → void -
Iterates through childrenKeyMap and updates ReorderableEntity.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited