onDragStart method

bool onDragStart(
  1. Point<double> localPosition
)

Implementation

bool onDragStart(Point<double> localPosition) {
  // In Flutter, a tap test may not be triggered because a tap down event
  // may not be registered if the the drag gesture happens without any pause.
  if (_activeListeners.isEmpty) {
    _populateActiveListeners(localPosition);
  }

  // Walk through listeners stopping at the first handled listener.
  final claimingListener = _activeListeners.firstWhereOrNull(
      (GestureListener listener) =>
          listener.onDragStart?.call(localPosition) ?? false);

  if (claimingListener != null) {
    _activeListeners =
        _cancel(all: _activeListeners, keep: [claimingListener]);
    return true;
  }
  return false;
}