How to set max/min size app in flutter desktop?

Issue

I am developing a Windows flutter application. By default, the user can make the app too small to overflow the text, or too large to disrupt the design of the app.

How can I solve this issue ?

Solution

Use bitsdojo_window Flutter package .

For set min/max size window try this

void main() {
  runApp(MyApp());

 //After runApp

  doWhenWindowReady(() {
    final initialSize = Size(800, 650);
    final minSize = Size(600, 450);
    final maxSize = Size(1200, 850);
    appWindow.maxSize = maxSize;
    appWindow.minSize = minSize;
    appWindow.size = initialSize; //default size
    appWindow.show();
  });
}

For more information checkout bitsdojo_window

Answered By – MohammadSadra Kafiri

Answer Checked By – Candace Johnson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.