persistent_window_manager 3.1.0
persistent_window_manager: ^3.1.0 copied to clipboard
Saves and restores desktop window position, size, maximized and full-screen state between app launches on Desktop platforms.
3.1.0 #
- Architecture: Replaced
WindowListener-based event callbacks with a 750 ms polling loop (Timer.periodic).PersistentWindowWrapperno longer implementsWindowListener; it usesWidgetsBindingObserver.didChangeMetrics()instead. - State simplification: Removed
positionScaleFactorfromPersistentWindowManagerState; scale handling is now an internal detail ofPersistentWindowManagerCubit. - Bug fix: Fixed an issue when closing the window while minimized and then reopening it, it would restore to a broken size and position.
3.0.1 #
- Updated README.
3.0.0 #
- BREAKING CHANGE: Replaced
PeWiMaWrapperwithrunAppPersistentWindowManager, a drop-in replacement forrunAppthat performs window setup before Flutter renders its first frame, achieving true zero-flicker restoration. - BREAKING CHANGE: Removed
PeWiMaWrapperfrom the public API. ReplacerunApp(PeWiMaWrapper(child, windowOptions: options))withawait runAppPersistentWindowManager(child, windowOptions: options). - New Feature: Added a
dart run persistent_window_manager:setupcommand (--dry-runsupported) that patches the consuming app's native desktop runner —windows/runner/win32_window.cpp,windows/runner/flutter_window.cpp,linux/my_application.cc,macos/Runner/MainFlutterWindow.swift— so the window is never shown by the OS/engine beforewindowManager.show()is called. Without this step,runAppPersistentWindowManager's zero-flicker restoration only takes full effect once the runner itself also defers showing the window; see the README's "Native runner setup" section, including a manual fallback for unrecognized templates. - Bug fix:
setPositionScaleFactoris now explicitly awaited before reading window state, preventing a race condition where positions could be normalised against an uninitialised scale factor. - Bug fix:
_changeWindowPositionnow skips saving position while the window is maximized or in full screen, preventing transitional off-screen coordinates from being persisted during the unmaximize animation. - Removed:
PWMUtilsinternal class.
2.0.0 #
- BREAKING CHANGE: Replaced the two-step
activatePersistentWindowManager()+PersistentWindowWrapperAPI with the new unifiedPeWiMaWrapperwidget. - BREAKING CHANGE: Removed
activatePersistentWindowManagerandPersistentWindowWrapperfrom public exports. UsePeWiMaWrapperinstead. - New Feature: Introduced
PeWiMaWrapper- a single, simplified widget that handles window manager activation and wrapping in one step. - Enhanced Platform Support: Better cross-platform handling with automatic no-op on web and mobile platforms.
- Better Code Organization: Refactored internal structure into logical modules (
models/,utils/,widgets/,cubit/).
1.0.1 #
- Made
windowOptionsparameter optional inactivatePersistentWindowManager.
1.0.0 #
- Initial release of the
persistent_window_managerpackage.