onAttach method

  1. @override
void onAttach()

Implementation

@override
void onAttach() {
  super.onAttach();
  context.gestureDispatcher.addGesture(gesture);
  gesture.edgeFun = (offset) {
    return globalAreaBound.contains(offset);
  };
  gesture.hoverStart = (e) {
    _handleHoverWithDrag(e.globalPosition);
  };
  gesture.hoverMove = (e) {
    _handleHoverWithDrag(e.globalPosition);
  };
  gesture.hoverEnd = (e) {
    _handleHoverWithDrag(null);
  };
  gesture.longPressStart = (e) {
    _handleHoverWithDrag(e.globalPosition);
  };
  gesture.longPressMove = (e) {
    _handleHoverWithDrag(e.globalPosition);
  };
  gesture.longPressEnd = (e) {
    _handleHoverWithDrag(null);
  };
  gesture.longPressCancel = () {
    _handleHoverWithDrag(null);
  };
}