X-SLAYER / flutter_overlay_window

Flutter plugin for displaying flutter app over other apps on the screen
https://pub.dev/packages/flutter_overlay_window
MIT License
106 stars 111 forks source link

Can't change only enableDrag flag while being shown overlay #134

Open kimilini1227 opened 2 weeks ago

kimilini1227 commented 2 weeks ago

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: ...
}
sunjiaming commented 2 weeks ago

I think so,This role must be defined as a separate method.