flutter_overlay_window icon indicating copy to clipboard operation
flutter_overlay_window copied to clipboard

Can't change only enableDrag flag while being shown overlay

Open kimilini1227 opened this issue 1 year ago • 1 comments

Hi. I create overlay paiting app. Therefore I need to switch enableDrag flag depend on whether start position of dragging is on canvas or top window bar.

However according to the documentation the way that change enableDrag flag while being shown overlay is only resizeOverlay that end up changing overlay size so I can't change only enableDrag flag.

In the first place why resizeOverlay have a role change enableDrag flag? This role must be defined as a separate method.

My showOverlay

FlutterOverlayWindow.showOverlay(
  height: HEIGHTOVERLAY,
  width: WIDTHOVERLAY,
  alignment: OverlayAlignment.topLeft,
  flag: OverlayFlag.defaultFlag,
  enableDrag: true,
  positionGravity: PositionGravity.none,
  startPosition: OverlayPosition(XPOSOVERLAY, YPOSOVERLAY),
);

My GestureDetector in canvas

GestureDetector(
  onPanStart: (DragStartDetails start) async {
    await FlutterOverlayWindow.updateEnableDrag(false);
  },
  onPanEnd:  (DragEndDetails end) async {
    await FlutterOverlayWindow.updateEnableDrag(true);
  },
  child: ...
}

kimilini1227 avatar Sep 09 '24 14:09 kimilini1227