window_manager
0.7.0, released 9 days ago by leanflutter.dev
Flutter desktop window resizing, moving, showing, hiding via nativeapi.
Uses material_ui
What it does
Provides APIs to control window size, position, visibility and decoration on Windows, macOS and Linux. It exposes native window objects and events through the nativeapi core.
AI-written summary of version 0.7.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need frameless or custom title bars
- You want to programmatically resize or reposition windows
- You need multi‑window support in a desktop Flutter app
Skip it when
- You target only mobile or web
- You need a very lightweight dependency and can live without nativeapi
Strengths
- Cross‑platform native window control
- No platform‑specific plugin code, all logic in nativeapi
- Supports custom title bars and multi‑window APIs
Weaknesses
- Requires Flutter 3.50 / Dart 3.14 and nativeapi 0.6.0
- Linux needs GTK3, X11 and Xi dev files
- Legacy API is deprecated and will be removed
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 3
Add window_manager to pubspec, run flutter pub get. On Linux install libgtk-3-dev libx11-dev libxi-dev. No build_runner needed.
import 'package:window_manager/window_manager.dart';
final window = WindowManager.instance.getCurrent()!;
window.title = 'My App';
window.setSize(const Size(1000, 700).toNative(), false);
window.center();
window.show();Alternatives
Packages that do the same job and could replace window_manager.
Works with
Packages commonly used together with window_manager: ones it builds on, ones built on it, and its own family.
- material_uiwindow_manager depends on itOfficial Flutter Material UI library implementing Google’s Material Design system.
- nativeapiwindow_manager depends on itDart bindings to native system APIs across desktop and mobile
- nativeapi_flutterwindow_manager depends on itFlutter integration for nativeapi, adding widgets and type conversions.
- screen_retrieverSame familyRead desktop screen size, work area, scale factor and cursor position on Windows, macOS and Linux.
- tray_managerSame familyDefine system tray icons and context menus in Flutter desktop apps.
- hotkey_managerSame familyRegister system-wide and in-app keyboard shortcuts on desktop and Android
- protocol_handlerSame familyRegister and handle custom protocols and deep links in Flutter apps.
- flutter_single_instanceBuilt on window_managerCheck if your Flutter application is already running and bring it to the foreground.