Closed pauli2406 closed 1 year ago
Nvm, managed to fix it. The trick is to also add the dependency "window_manager"
Then extend the main widget of the new window with WindowListener
class _MainWidgetState extends State<MainWidget> with WindowListener {
@override
void onWindowClose() async {
// Execute the logic here instead of on dispose
super.onWindowClose();
}
}
Description
I am currently building an application with this package for macOS. In this app, I am using the plugin package:desktop_multi_window which allows me to use multiple windows. It was configured using your CLI.
In the application I am building I make use of the dispose() method to release different controllers onClose of this widget. Unfortunately, it seems that if a user closes a window by clicking the red close button is not trigger this lifecycle.
Is it possible that the close method used with this button is ignoring the flutter lifecycle?
Or am I doing something wrong?