Flutter-desktop Frameless window support

Solution 1:

For Windows:

To do a frameless window in Flutter, you need to change window properties from the Project Directory/windows/runner/win32_window.cpp file.

First, go find the section on creating a window. Here is a built-in code by Flutter:

     HWND window = CreateWindow(
       window_class, title.c_str(), WS_OVERLAPPEDWINDOW | 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);

You only need to change the WS_OVERLAPPEDWINDOW value to WS_POPUPWINDOW to make a frameless window.

Our final code will be look like this:

     HWND window = CreateWindow(
       window_class, title.c_str(), WS_POPUPWINDOW | 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);

Remember if you do this you will lose the ability to drag the window. But there are some solutions to it.

EDIT (01/03/2022): You can use WS_THICKFRAME instead of WS_POPUPWINDOW This is more dynamic for window management.

For macOS:

I found this article that can be helpful -> Medium: Hide title bar on macOS with Flutter

Solution 2:

You can use package bitsdojo_window