google / flutter-desktop-embedding

Experimental plugins for Flutter for Desktop
Apache License 2.0
7.1k stars 604 forks source link

Window size is not correct when i first lunch the app unless i drag it #888

Closed shareef-dweikat closed 3 years ago

shareef-dweikat commented 3 years ago

Is this a bug in one of the plugins in this project?

Which plugin is this bug report about?

window_size

Describe the bug

I have this bug on windows When i first lunch the app, window does not get max and min unless i click on it and move it using the mouse.

void main() { WidgetsFlutterBinding.ensureInitialized(); if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { setWindowTitle('App title'); setWindowMinSize(Size(360, 640)); setWindowMaxSize(Size(360, 640)); } runApp(MyApp()); }

Flutter doctor

C:\Users\Shareef\Documents\test3\flutter_wormhole_gui\build>flutter doctor -v
[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19042.1165], locale en-US)
    • Flutter version 2.2.2 at C:\src\flutter
    • Framework revision d79295af24 (2 months ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\Shareef\AppData\Local\Android\Sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = C:\Users\Shareef\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Java\jdk1.8.0_211\bin\java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.1)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31613.86
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] VS Code (version 1.59.1)
    • VS Code at C:\Users\Shareef\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19042.1165]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 92.0.4515.159
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 92.0.902.78

! Doctor found issues in 1 category.
stuartmorgan commented 3 years ago

You aren't setting the size, only the minimum and maximum for user resize events. Not resizing is the correct behavior in that case.

If you want to set the window's size, you need to call the API for that.

shareef-dweikat commented 3 years ago

@stuartmorgan What is the correct API? I can't find it. Is it setWindowFrame? if so, it is not working.

stuartmorgan commented 3 years ago

Is it setWindowFrame?

Yes.

if so, it is not working.

Please file an issue, with details.