Flutter构建Windows应用如何设置全屏,隐藏工具栏

1、打开windows下的runner目录
2、修改win32_window.cpp文件

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),
      ++size.width, size.height,
      nullptr, nullptr, GetModuleHandle(nullptr), this);
SetWindowLongPtr(window, GWLP_USERDATA,
                     reinterpret_cast<LONG_PTR>(window_struct->lpCreateParams));
++SetWindowLong(window, GWL_STYLE, WS_OVERLAPPED); // +++ disable title bar

3、修改main.cpp文件

FlutterWindow window(project);
--Win32Window::Point origin(10, 10);
--Win32Window::Size size(1080, 720);
++Win32Window::Point origin(0, 0);
++Win32Window::Size size(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));

4、重新运行程序,Windows下的Flutter应用就可以全屏显示了

你可能感兴趣的:(Flutter,windows,flutter)