swift_alert 2.0.0
swift_alert: ^2.0.0 copied to clipboard
Beautiful, customizable notification banners for Flutter. Show alerts anywhere without context after one-time initialization.
2.0.0 #
Breaking Changes:
- Added new
SwiftAlert.initialize()method that must be called at app startup with aGlobalKey<NavigatorState> - Introduced new
SwiftAlert.show()method that doesn't require context parameter - Deprecated
SwiftAlert.display()method (still works for backward compatibility)
New Features:
- No context required after initialization - show alerts from anywhere in your app
- Perfect for use in state management layers, services, and business logic
- Initialize once at app startup and use throughout your app
- Improved error messages when SwiftAlert is not properly initialized
Documentation:
- Comprehensive README with migration guide
- Updated example app demonstrating new API
- Added troubleshooting section
- Detailed API reference
Migration Guide: To migrate from v1.x to v2.0.0:
- Create a global navigator key:
final navigatorKey = GlobalKey<NavigatorState>() - Initialize SwiftAlert in main():
SwiftAlert.initialize(navigatorKey: navigatorKey) - Pass the key to MaterialApp:
MaterialApp(navigatorKey: navigatorKey, ...) - Replace
SwiftAlert.display(context, ...)withSwiftAlert.show(...)
1.0.0 #
- Initial stable release of SwiftAlert.
- Display beautiful, animated notification banners at the top of the screen.
- Supports multiple notification types: success, error, info, warning.
- Customizable appearance, icons, and colors.
- Easy integration with any Flutter app.
- Includes example app and screenshots.
- BSD 3-Clause License.