31.41 Flutter Desktop Size MacOS
20230805
See Section 31.43 to set the window
size of a desktop application through the window_manager
package.
Alternatively we observe that the flutter MacOS native desktop
application size is set in
macos/Runner/Base.lproj/MainMenu.xib
. There we find the default
desktop window size which is set to be 800 by 770 by default.
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
...
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
To change the default window width and height on startup to have dimensions more like a mobile app, we can change the settings here:
perl -pi.bak -e 's|width="800" height="600"|width="450" height="700"|' macos/Runner/Base.lproj/MainMenu.xib
The appropriate line in the file will be updated:
<rect key="contentRect" x="335" y="390" width="450" height="700"/>
...
<rect key="frame" x="0.0" y="0.0" width="450" height="700"/>
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0