flutter_exit_app 2.0.0 copy "flutter_exit_app: ^2.0.0" to clipboard
flutter_exit_app: ^2.0.0 copied to clipboard

A Flutter plugin that provides a platform-specific way to exit the app without calling exit(0) in Dart code.

2.0.0 #

Major modernization update with breaking changes

Breaking Changes #

  • BREAKING: Minimum Flutter version is now 3.10.0
  • BREAKING: Minimum Dart version is now 3.0.0
  • BREAKING: Minimum Android API level is now 21 (Android 5.0)
  • BREAKING: Minimum iOS version is now 12.0
  • BREAKING: Return type changed from Future<bool?> to Future<bool>

Android Improvements #

  • MIGRATION: Migrated from Java to Kotlin for better performance and maintainability
  • Updated Android Gradle Plugin to 8.1.0
  • Updated Gradle to 8.4
  • Updated compileSdk to 34
  • Added namespace declaration for AGP 8.x compatibility
  • Improved error handling with null-safety
  • Better activity lifecycle management
  • Cleaner, more idiomatic Kotlin code

iOS Improvements #

  • Refactored iOS implementation to follow Apple best practices
  • Added proper app lifecycle notification handling (willResignActiveNotification, didEnterBackgroundNotification)
  • Improved graceful exit: app moves to background and suspends (iOS recommended behavior)
  • Force-kill mode now includes 0.5s cleanup delay for proper state saving
  • Better memory management with weak self references
  • iOS 12+ compatibility with fallback for deprecated APIs
  • Comprehensive documentation about App Store compliance

Dart API Improvements #

  • Made constructor private to prevent unnecessary instantiation
  • Added @visibleForTesting annotation for better testability
  • Made MethodChannel const for performance
  • Improved error handling with specific exception types
  • Enhanced documentation with detailed examples and use cases
  • Better null-safety handling

Testing & Quality #

  • Replaced mockito with Flutter's built-in TestDefaultBinaryMessengerBinding
  • No more code generation required for tests
  • Added 6 comprehensive unit tests covering all scenarios
  • Tests now verify both method calls and arguments
  • All tests pass with zero warnings

Documentation #

  • Completely rewrote README with clear examples and API reference
  • Added migration guide from 1.x to 2.0
  • Updated to use flutter_lints for better code quality
  • Added platform support table
  • Comprehensive inline code documentation
  • Updated CLAUDE.md with modernization details

Example App Updates #

  • Fixed AGP 8.x compatibility issues
  • Updated Gradle wrapper to 8.4
  • Added namespace declaration
  • Added kotlinOptions configuration
  • Example app now builds successfully on latest Flutter SDK

Dependencies #

  • Updated to flutter_lints: ^5.0.0 (replaced lints)
  • Removed mockito, build_runner, and test dependencies
  • Cleaner dependency tree

1.1.4 #

  • Fix an issue #2

1.1.3 #

  • Update version
  • Add Test case
  • Update example
  • Update native code
  • Fix an issue #1

1.1.2 #

  • add iosForceExit parameter for exitApp method

1.1.1 #

  • breaking: remove exit(0) for ios

1.1.0 #

  • Fix kill ios process
  • Add time wait for exit

1.0.5 #

  • fix kill app in background when 1 sec

1.0.3 #

  • fix docs
  • android exit when 2000 msec

1.0.0 #

  • Implement native android exit app
  • Implement native ios exit app
  • Add License
54
likes
150
points
15.6k
downloads

Publisher

verified publisherlaoitdev.com

Weekly Downloads

A Flutter plugin that provides a platform-specific way to exit the app without calling exit(0) in Dart code.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_exit_app

Packages that implement flutter_exit_app