Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set desktop Flutter to run in maximized size at startup

Tags:

window

flutter

How can one set the initial size of the Flutter desktop app to maximized in desktop platforms (Windows, macOS, Linux)?

I know there are window size plugins and we can set size manually, but is there any simple way, like for example Window.startupSize=WindowSize.Maximized

There are old issues in Flutter community (https://github.com/flutter/flutter/issues/39556) but I want to know what is latest update?

like image 560
AVEbrahimi Avatar asked Jan 26 '26 22:01

AVEbrahimi


1 Answers

For future reference to anyone still facing this issue you can locate this code in the file:

windows/runner/win32_window.cpp

bool Win32Window::Show() {
   return ShowWindow(window_handle_, SW_SHOWMAXIMIZED);
}

its in line 152 and you can replace SW_SHOWNORMAL with SW_SHOWMAXIMIZED

like image 169
Jack Siro Avatar answered Jan 28 '26 11:01

Jack Siro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!