InsertionPoint class

a position at which a child can be inserted

Constructors

InsertionPoint({required int index, required bool insertingAfter, required Offset position, bool inserterWide = false})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
the index of the item being most closely hovered
final
inserterWide bool
is wide when it's not inserting at a between point, in which case a narrow selector visual wouldn't look right
final
insertingAfter bool
whether it's inserting after element at index (otherwise, it's inserting before it)
final
position Offset
relative to the wrap (note, you use a global position to get the insertionPoint, they're different coordinate systems)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cleverInsertionIndexFor(int currentIndex, int listLength) → (bool, int)
this will behave more in line with user intent, if a user drags an item to its neighbor, this will always place it beyond its neighbor, while midwayInsertionIndex will sometimes place it back where it was to begin with and produce no action. Returns false if it's still going to have no effect anyway (eg if there's no room for a movement).
midwayInsertionIndex() int
if you just want to insert between the nearest two elements, this is the index you want to insert into the array at. If you're moving something that is itself already in the list, we recommend that you use the below method instead
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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