FLUTTER ECOSYSTEM

flutter_window_close

Let your Flutter app has a chance to confirm if the user wants to close your app.

flutter_window_close cover
Latest version
1.3.0
30-day downloads
15.2K
Likes
98
Pub points
160

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

The flutter_window_close package enables Flutter applications on desktop platforms to intercept window close events and prompt users for confirmation before exiting. This is particularly useful for apps that need to save unsaved data or prevent accidental closure. It provides a simple API to register a callback that runs when the user attempts to close the window, allowing developers to show custom dialogs or perform cleanup tasks. The package supports macOS, Windows, Linux, and Web, making it ideal for cross-platform desktop applications requiring graceful shutdown handling.

Use cases
  • Preventing accidental app closure
  • Saving unsaved data before exit
  • Displaying confirmation dialogs
  • Graceful shutdown on desktop
  • Custom exit logic
  • Web and desktop compatibility
Key features
  • Intercepts window close events
  • Supports multiple desktop platforms
  • Simple callback API
  • Cross-platform desktop support
  • Optional confirmation dialog
  • Web and native integration
Suitable for
  • Desktop Flutter apps
  • Apps with unsaved data
  • User-facing desktop applications
  • Developers needing exit control
  • Applications requiring confirmation prompts
  • Cross-platform desktop projects
Considerations
  • Not applicable on mobile platforms
  • Requires platform-specific setup
  • May conflict with system-level close behavior
  • Limited to desktop and web
  • Does not handle app termination from task manager
  • User experience depends on implementation
Supported platformsWebmacOSWindowsLinux

Install package

flutter pub add flutter_window_close

Categories

Dependencies

Dependency list 1 items

Source repository

Related projects