How to disable window resize on Flutter Desktop Windows?

Viewed 1986

When our Flutter desktop app running on Windows, if we resize the window or max the window, there will be a black area in the app. How to disable window resize on Flutter desktop windows?

I have tired

  ws.setWindowMaxSize(Size(width * 0.9, height * 0.9));
  ws.setWindowMinSize(Size(width * 0.9, height * 0.9));

But it does not work. There is no code to deal with the code 'setWindowMaxSize' and 'setWindowMinSize' in flutter-desktop-embedding\plugins\window_size\windows\window_size_plugin.cpp .

If it is difficult, is there any good idea to make the Flutter desktop app looks better when resizing? Maybe show a 'Loading' message? Thanks.

1 Answers

did you add this to your pubspec?

window_size:
    git:
      url: git://github.com/google/flutter-desktop-embedding.git
      path: plugins/window_size
Related