You can do it with the window_manager Package:
https://pub.dev/packages/window_manager
pubspec.yaml:
dependencies:
window_manager: ^0.4.2
main.dart:
import 'package:window_manager/window_manager.dart';
main() async {
if (defaultTargetPlatform == TargetPlatform.linux ||
defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.windows ||
defaultTargetPlatform == TargetPlatform.fuchsia) {
WidgetsFlutterBinding.ensureInitialized();
windowManager.waitUntilReadyToShow(const null, () async => windowManager.maximize());
}
runApp(const AppWidget());
}
With window_manager you can control more things than with desktop_window mentioned earlier, like e.g. the windows title.
You can do it with the window_manager Package:
https://pub.dev/packages/window_manager
pubspec.yaml:
dependencies:
window_manager: ^0.4.2
main.dart:
import 'package:window_manager/window_manager.dart';
main() async {
if (defaultTargetPlatform == TargetPlatform.linux ||
defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.windows ||
defaultTargetPlatform == TargetPlatform.fuchsia) {
WidgetsFlutterBinding.ensureInitialized();
windowManager.waitUntilReadyToShow(const WindowOptions(fullScreen: true));
}
runApp(const AppWidget());
}
To have it just maximized, you have to call:
windowManager.waitUntilReadyToShow(const null, () async => windowManager.maximize());