dragEnd method

  1. @override
void dragEnd(
  1. Point<num> startPosition,
  2. Point<num> position
)
override

Called when the drag operation ends.

The avatar must be removed from the DOM in this method if it is not needed any more.

The startPosition is the position where the drag started, position is the current position. Both are relative to the whole document (page coordinates).

Implementation

@override
void dragEnd(Point startPosition, Point position) {
  if (avatar != null) {
    avatar!.remove();
  }
}