2

Is it possible to run the Flutter Windows app in full screen mode all the time? Window resizing causes the application to break by causing the elements to not render properly. To prevent the user from resizing the screen, I want to disable it. Is there a way to keep the application open in full screen all of the time on windows??

1
  • in addition to the accepter answer, here's the official package that helped me pub.dev/packages/window_manager Commented Nov 28, 2022 at 17:31

1 Answer 1

2

Add this line of code in pubspec.yaml

dependencies:
  window_size:
     git:
#       url: git://github.com/google/flutter-desktop-embedding.git
       url: https://github.com/google/flutter-desktop-embedding
       path: plugins/window_size

then add this code in main.dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:window_size/window_size.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  if (Platform.isWindows) {
    setWindowMaxSize(Size(1100, 710));
    setWindowMinSize(const Size(1100, 710));
    Future<Null>.delayed(Duration(seconds: 0), () {
      setWindowFrame(
          Rect.fromCenter(center: Offset(650, 350), width: 1000, height: 710));
    });
  }
  runApp(
    (MySplashApp()),
  );
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.