easy_in_app_notify 2.3.1
easy_in_app_notify: ^2.3.1 copied to clipboard
Beautiful Flutter in-app notifications with smooth animations, auto-dismiss, progress bars, and customizable styling.
Changelog #
All notable changes to the Easy In-App Notify package will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.3.1 - 2025-09-22 #
π§ Fixed #
- onTap Callback: Fixed critical issue where
onTap
callback was not being properly forwarded fromEasyInAppView
to_NotifyContainer
- Screenshot Display: Updated GitHub raw URLs to point to correct branch for proper image display in documentation
π Improved #
- Package Description: Optimized package description for search engines (reduced to 118 characters within recommended 60-180 range)
- Documentation: Enhanced README with new Samsung Galaxy A14 screenshot showcasing v2.3.1 features
- Visual Layout: Updated to professional three-column screenshot layout in README
ποΈ Technical Details #
- Property Migration: Completed migration of
showProgressBar
andswipeToDismiss
fromEasyInAppNotifyOption
toEasyInAppNotifyTheme
- Example Updates: Updated example app to demonstrate new theme configuration structure
- URL Management: Fixed screenshot URLs to ensure proper display across different Git branches
2.3.0 - 2025-09-22 #
β¨ Added #
Enhanced Architecture
- Centralized Auto-Dismiss System: Universal timer management for all notification types
- Universal Dismiss Support:
EasyInAppNotify.dismiss()
now works with any widget type (Card, Container, custom widgets, etc.) - Duration Validation: Added assertion to ensure duration > 0 for reliable auto-dismiss behavior
- Enhanced Code Organization: Refactored main class with logical method grouping and comprehensive documentation
Developer Experience Improvements
- Comprehensive Documentation: Added detailed class and method documentation with examples
- Better Error Messages: Improved assertion messages for clearer debugging
- Code Comments: Enhanced inline comments explaining complex logic and design decisions
- Structured Codebase: Organized imports, methods, and functionality into logical sections
π§ Changed #
API Improvements
- Simplified Architecture: Removed CustomViewWrapper complexity while maintaining functionality
- Unified Timer Management: All notifications now use the same centralized auto-dismiss system
- Better Method Organization: Grouped related functionality for improved maintainability
- Enhanced Type Safety: Improved parameter validation and error handling
Performance Optimizations
- Memory Management: Improved timer cleanup and resource management
- Reduced Complexity: Simplified internal architecture while preserving all features
- Better Separation of Concerns: Clear separation between public API and internal implementation
π οΈ Technical Details #
Refactored Components
- EasyInAppNotify Class: Complete reorganization with logical method sections
- Timer Management: Centralized auto-dismiss logic for consistency across all notification types
- Documentation: Added comprehensive examples and usage patterns
- Code Quality: Improved readability and maintainability throughout
Breaking Changes
- Duration Requirement:
EasyInAppNotifyOption(duration: 0)
now throws assertion error- Migration: Use
duration: 1
or higher for auto-dismiss notifications - Reason: Ensures consistent behavior and prevents notifications that never dismiss
- Migration: Use
π Migration Guide #
// β Old (will now fail)
EasyInAppNotifyOption(duration: 0)
// β
New (minimum duration)
EasyInAppNotifyOption(duration: 1)
2.2.0 - 2025-01-09 #
2.1.0 - 2025-01-09 #
β¨ Added #
New Methods
showCustom()
Method: Display completely custom widgets as notificationsEasyInAppNotify.showCustom(context, YourCustomWidget());
- Perfect for complex notification layouts
- Full control over notification appearance
- Integrates with existing auto-dismiss system
Enhanced Callback Support
onDismissed
Callback: Execute code when notification is dismissedEasyInAppNotify.show( context, content: content, onDismissed: () => print('Notification dismissed'), );
onTap
Callback: Handle notification tap eventsEasyInAppNotify.show( context, content: content, onTap: () => Navigator.push(context, MyRoute()), );
Comprehensive Documentation
- 5 Complete Usage Patterns: Detailed implementations for context-less usage
- Pass Context as Parameter Pattern: Clean service method design
- Callback Pattern: Decoupled service notifications with callbacks
- Navigator Key Pattern: Global notification access throughout the app
- Service Locator Pattern: Dependency injection compatible design
- Firebase Cloud Messaging (FCM) Integration: Complete FCM setup with examples
- Production-Ready Code Examples: Copy-paste ready implementations
- Real-World Scenarios: API services, background tasks, FCM integration
π§ Enhanced #
Improved Sound System
- Platform-Specific Sound Types: Optimized for each platform
- Desktop (macOS/Windows/Linux):
SystemSoundType.alert
for proper notification sounds - Mobile (iOS/Android):
SystemSoundType.click
for brief interaction feedback - Web:
SystemSoundType.click
with graceful fallback when unsupported
- Desktop (macOS/Windows/Linux):
- Enhanced Error Handling: Better handling of silent mode and disabled system sounds
- Comprehensive Platform Support: Consistent behavior across all Flutter platforms
- Debug Information: Improved error logging for troubleshooting sound issues
Better Error Handling
- Context-Aware Error Messages: Clear guidance when overlay is not available
- Improved Debugging: Better error messages for common integration issues
- Graceful Fallbacks: Notifications continue to work even when sounds fail
Enhanced Visual Design
- Animated Blur Background Effect: Beautiful backdrop blur with smooth fade transitions
- Modern iOS-style appearance with
BackdropFilter
andFadeTransition
- 300ms fade-in animation when notification appears
- Synchronized fade-out when notification dismisses
- Smooth
easeInOut
animation curves for professional polish - Creates depth and visual hierarchy
- Maintains background context while focusing attention on notification
- Automatic full-screen coverage with coordinated animations
- Modern iOS-style appearance with
Documentation Improvements
- Complete API Documentation: All methods include comprehensive examples
- Integration Guides: Step-by-step guides for complex scenarios
- Platform Compatibility Notes: Clear documentation of platform-specific behaviors
- Error Troubleshooting: Common issues and their solutions
π― Code Examples #
Custom Widget Notifications
// Display any custom widget as a notification
EasyInAppNotify.showCustom(
context,
Container(
margin: EdgeInsets.all(16),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(12),
),
child: Row(
children: [
Icon(Icons.error, color: Colors.white),
SizedBox(width: 12),
Expanded(
child: Text(
'Custom styled error notification',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
),
],
),
),
);
Enhanced Callbacks
// Handle notification interactions
EasyInAppNotify.show(
context,
content: EasyInAppNotifyContent(
title: "New Message",
message: "Tap to view conversation",
icon: Icons.message,
),
onTap: () {
// Navigate to chat screen
Navigator.pushNamed(context, '/chat');
},
onDismissed: () {
// Log dismissal for analytics
analytics.logEvent('notification_dismissed');
},
);
FCM Integration (Complete Setup)
class FCMService {
static final GlobalKey<NavigatorState> navigatorKey =
GlobalKey<NavigatorState>();
static void initialize() {
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
_showFCMNotification(message);
});
}
static void _showFCMNotification(RemoteMessage message) {
final context = navigatorKey.currentContext;
if (context != null && message.notification != null) {
EasyInAppNotify.show(
context,
content: EasyInAppNotifyContent(
title: message.notification!.title ?? 'Notification',
message: message.notification!.body ?? '',
icon: Icons.notifications,
),
theme: EasyInAppNotifyTheme(color: Colors.blue),
onTap: () {
// Handle FCM notification tap
final data = message.data;
if (data['route'] != null) {
navigatorKey.currentState?.pushNamed(data['route']);
}
},
);
}
}
}
π Migration from v2.0.x #
No breaking changes! All existing v2.0.x code continues to work unchanged.
Optional Enhancements:
- Add
onTap
andonDismissed
callbacks where needed - Use
showCustom()
for completely custom notification designs - Review sound behavior on your target platforms
π± Platform Support #
- β Android (with optimized click sound)
- β iOS (with optimized click sound)
- β Web (graceful sound fallback)
- β macOS (with proper alert sound)
- β Windows (with proper alert sound)
- β Linux (with proper alert sound)
2.0.0 - 2025-01-09 #
π¨ BREAKING CHANGES #
This release introduces significant API changes that simplify usage but require code updates.
Removed Methods and Requirements
- REMOVED:
EasyInAppNotify.init()
method - No longer needed! - REMOVED:
navigatorKey
requirement in MaterialApp - No longer needed! - REMOVED: All initialization steps and setup requirements
- REMOVED:
flutter_ringtone_player
dependency - Replaced with built-in Flutter SystemSound
API Changes
- CHANGED:
EasyInAppNotify.show()
now requiresBuildContext
as first parameter - CHANGED: Simplified from 2-step setup to direct usage
- CHANGED: Error handling updated to reflect no setup needed
β¨ Added #
Zero Configuration API
- Direct Usage: Call
EasyInAppNotify.show(context, ...)
immediately without setup - Simplified Integration: No MaterialApp modifications required
- Zero Dependencies: No navigator keys or initialization needed
Comprehensive Documentation
- Context-less Usage Patterns: 5 detailed patterns for using without direct BuildContext access
- Pass Context as Parameter pattern
- Callback Pattern for service decoupling
- Navigator Key Pattern for global access
- Service Locator Pattern for dependency injection
- Provider/State Management integration
- Firebase Cloud Messaging (FCM) Integration: Complete FCM documentation and examples
- Background message handling
- Foreground notification display
- Custom message type routing
- Advanced FCM scenarios with real-world examples
New Examples
- FCM Integration Example (
example/lib/fcm_example.dart
): Interactive FCM simulation- Chat message notifications
- Order update notifications
- Promotional offer notifications
- System alert notifications
- Integration Code Snippets: Copy-paste ready code for various scenarios
- Interactive Demos: Hands-on testing environment for all patterns
π§ Changed #
API Simplification
// OLD (v1.x) - Required setup
MaterialApp(
builder: EasyInAppNotify.init(),
home: MyHomePage(),
)
EasyInAppNotify.show(content: ...);
// NEW (v2.0) - Direct usage
MaterialApp(
home: MyHomePage(),
)
EasyInAppNotify.show(context, content: ...);
Enhanced Error Handling
- Updated Error Messages: Now focus on context availability rather than setup issues
- Clearer Guidance: Better error messages for troubleshooting
- Context Validation: Improved overlay context detection
Dependency Reduction
- Removed External Dependencies: Replaced
flutter_ringtone_player
with Flutter's built-inSystemSound
- Platform-Optimized Sounds: Smart platform detection for best sound compatibility (based on Flutter's official platform support)
- Desktop (macOS/Windows/Linux): Uses
SystemSoundType.alert
(proper notification sound) - Mobile (iOS/Android): Uses
SystemSoundType.click
(brief button press sound) - Web: Attempts
SystemSoundType.click
(may work in some browsers, gracefully ignored if not supported)
- Desktop (macOS/Windows/Linux): Uses
- Universal Platform Support: System sounds now work consistently across all Flutter platforms
- Enhanced Error Handling: Better handling of silent mode and disabled system sounds
- Reduced Package Size: Fewer dependencies mean smaller app bundle size
- Better Reliability: Built-in system sounds are more stable and consistent
Documentation Overhaul
- Simplified Setup Instructions: Reduced from multi-step to single-call usage
- Real-world Patterns: Production-ready code examples for complex scenarios
- Platform Integration: Detailed guides for FCM, services, and background tasks
- Complete API Documentation: All code examples updated to include context parameter
- Sound Implementation Details: Comprehensive platform-specific sound behavior documentation
ποΈ Architecture Improvements #
Streamlined Initialization
- Removed Static State: Eliminated global navigator key management
- Context-based Access: Direct overlay access through BuildContext
- Simplified Lifecycle: No initialization or disposal requirements
Enhanced Flexibility
- Multiple Usage Patterns: Support for various architectural approaches
- Service Integration: Patterns for API services, background tasks, and event handlers
- State Management: Integration examples for Provider, Riverpod, and others
π Updated Examples #
Example App Enhancements
- New FCM Section: Added fourth example category for Firebase integration
- Interactive Simulations: Real-time FCM message simulation with different types
- Updated Navigation: Enhanced example app with FCM integration showcase
Documentation Updates
- All Code Examples: Updated to use new v2.0 API
- README Overhaul: Comprehensive usage patterns and integration guides
- Example README: Added FCM integration section and updated setup instructions
π― Migration Guide #
From v1.x to v2.0
1. Remove Setup Code
// REMOVE these lines from MaterialApp
builder: EasyInAppNotify.init(),
navigatorKey: EasyInAppNotify.navigatorKey,
2. Update Show Calls
// OLD
EasyInAppNotify.show(content: ...);
// NEW
EasyInAppNotify.show(context, content: ...);
3. For Service Classes Choose from 5 documented patterns based on your architecture:
- Pass context as parameter (recommended for most cases)
- Use callbacks for clean separation
- Navigator key pattern for global access
- Service locator for dependency injection
- State management integration
π± Platform Support #
- β Android
- β iOS
- β Web
- β macOS
- β Windows
- β Linux
1.0.1 2024-01-XX #
β¨ Added #
- Screenshots: Added visual examples to README showcasing notification UI
- Documentation: Enhanced README with side-by-side screenshot layout
π₯ Removed #
- Firebase Dependencies: Removed Firebase-specific code and dependencies
- Platform Lock-in: Eliminated Firebase-only focus for broader compatibility
π§ Changed #
- Package Scope: Transformed from Firebase-specific to generic notification package
- Topics: Updated package topics from Firebase-focused to general notifications
- Examples: Converted Firebase examples to generic remote notification examples
- Code Style: Improved formatting and consistency across example files
- Dependencies: Updated example to use published package instead of git dependency
π Documentation #
- README: Completely updated to be platform-agnostic
- CHANGELOG: Updated use cases to reflect generic notification support
- Examples: Renamed
firebase_example.dart
toremote_example.dart
1.0.0 2024-01-XX #
π First Stable Release #
This is the first release of Easy In-App Notify, providing a complete solution for beautiful in-app notifications in Flutter applications.
β¨ Added #
Core Features
- In-App Overlays: Perfect for any notification system integration
- Foreground Notifications: Show notifications when app is active/foreground
- Overlay Notifications: Non-blocking notifications that appear over app content
- Auto-Dismiss: Configurable duration with automatic dismissal
- Manual Dismiss: Swipe-to-dismiss functionality for user control
- Sound Support: Built-in notification sound playback
- Single Notification Policy: Ensures only one notification is shown at a time
Animation System
- Smooth Slide Animation: Notifications slide in from the top with easing curves
- Progress Animation: Visual countdown with linear progress indicator
- Coordinated Timing: Synchronized animations for professional appearance
Customization Options
- Content Configuration: Title, message, icon, and trailing text
- Behavioral Options: Duration, progress bar visibility, swipe dismissal
- Visual Theming: Colors, spacing, dimensions, elevation, and border radius
- Material Design: Automatic integration with app's Material theme
User Experience
- Safe Area Awareness: Respects device safe areas and notches
- RTL Support: Full right-to-left language support
- Responsive Design: Adapts to different screen sizes and orientations
- Accessibility: Follows Flutter accessibility guidelines
Technical Implementation
- Provider Pattern: Efficient state management and data distribution
- Part Files: Clean modular architecture for maintainability
- Resource Management: Proper disposal of animations and timers
- Memory Optimization: Prevents memory leaks with careful cleanup
ποΈ Architecture #
Data Models
EasyInAppNotifyContent
: Notification content configurationEasyInAppNotifyOption
: Behavior and interaction settingsEasyInAppNotifyTheme
: Visual styling and appearance
View Components
_NotifyView
: Root notification widget with lifecycle management_NotifyContainer
: Positioning, animations, and user interactions_NotifyCard
: Material card structure and layout_NotificationContent
: Text content and icon display_NotificationIcon
: Styled icon with background container_NotifyProgress
: Animated progress bar indicator
Controllers
_AnimManger
: Animation coordination and timing managementEasyInAppNotify
: Global notification controller and API
π¦ Dependencies #
- flutter: SDK framework (>=1.17.0)
- provider: State management (^6.1.5+1)
flutter_ringtone_player: Notification sounds (^4.0.0+4)Removed in v2.0.0
π§ Requirements #
- Dart: ^3.9.0
- Flutter: >=1.17.0
π± Platform Support #
- β Android
- β iOS
- β Web
- β macOS
- β Windows
- β Linux
π API Reference #
Main API
// Initialize notification service (call in initState)
EasyInAppNotify.init(BuildContext context)
// Show notification
EasyInAppNotify.show({
required EasyInAppNotifyContent content,
EasyInAppNotifyOption? option,
EasyInAppNotifyTheme? theme,
})
Initialization Pattern
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(), // StatefulWidget AFTER MaterialApp
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
super.initState();
// Initialize AFTER MaterialApp is built
WidgetsBinding.instance.addPostFrameCallback((_) {
EasyInAppNotify.init(context);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(/* your content */);
}
}
Content Configuration
EasyInAppNotifyContent({
required String title,
required String message,
IconData? icon,
String? trailingText,
})
Options Configuration
EasyInAppNotifyOption({
int duration = 5,
bool showProgressBar = true,
bool swipeToDismiss = true,
})
Theme Configuration
EasyInAppNotifyTheme({
Color? color,
double margin = 5,
double padding = 10,
double radius = 10,
double elevation = 5,
double iconSize = 20,
})
π― Use Cases #
Perfect for displaying:
- π Remote notifications from any service
- π¬ Chat messages from messaging systems
- π’ Push notifications when app is foreground
- ποΈ Promotional messages from marketing services
- β οΈ Alert notifications from any backend
- β Success confirmations
- β Error messages
- βΉοΈ Information updates
- π± Status notifications
- π Event announcements
- π― Achievement unlocks
π Performance #
- Lightweight: Minimal memory footprint
- Efficient: Optimized animations and rendering
- Responsive: Smooth 60fps animations
- Resource-Aware: Proper cleanup prevents memory leaks
Future Releases #
Planned Features for v0.1.0 #
- Custom animation curves
- Multiple notification queue support
- Tap-to-action callbacks
- Custom widget content support
- Position configuration options
Roadmap #
- v0.2.0: Enhanced customization and interaction options
- v0.3.0: Advanced animation effects and transitions
- v1.0.0: Stable API with comprehensive testing
This changelog follows the Keep a Changelog format.