How to make a frameless flutter desktop window draggable

Viewed 469

I used this to make flutter window frameless:

HWND window = CreateWindow(
      window_class, title.c_str(), WS_THICKFRAME | WS_POPUP | WS_VISIBLE,
      Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
      Scale(size.width, scale_factor), Scale(size.height, scale_factor),
      nullptr, nullptr, GetModuleHandle(nullptr), this);

But now the window isn't draggable. Can I use some way to make appbar draggable? (I'm using a custom app bar - i.e. app bar is not widget AppBar. Any ways are okay, including modifing cpp files, add a function to use in flutter, etc.

1 Answers

I'm not sure if it's completely the same with vanilla flutter or not, but you can try looking on go-flutter's example on dragable borderless window here. It is implemented by using GLFW plugin.

Related