We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle onClose button press on mac?
The text was updated successfully, but these errors were encountered:
Not available at this moment but event handling support is planned (already started working on it).
Sorry, something went wrong.
@hungryemon using flutter AppLifecycleListener#onExitRequested, just like this:
AppLifecycleListener#onExitRequested
class AppPage extends StatefulWidget { const AppPage({super.key}); @override State<AppPage> createState() => _AppPageState(); } class _AppPageState extends State<AppPage> { late AppLifecycleListener _appLifecycleListener; @override void initState() { super.initState(); _appLifecycleListener = AppLifecycleListener( onExitRequested: _onExitRequested, ); } Future<AppExitResponse> _onExitRequested() async { // save some data to disk await SettingsService().updateWindowSize(appWindow.size); await WorkspaceService().saveWorkspace(); return AppExitResponse.exit; } ...
If you don't allow close app, just return AppExitResponse.cancel.
AppExitResponse.cancel
No branches or pull requests
How to handle onClose button press on mac?
The text was updated successfully, but these errors were encountered: