flutter_local_notification_plus 0.0.1 copy "flutter_local_notification_plus: ^0.0.1" to clipboard
flutter_local_notification_plus: ^0.0.1 copied to clipboard

Enhanced local notifications with rich media, actions, and scheduling for Flutter

flutter_local_notification_plus #

Enhanced local notifications with rich media, actions, and scheduling for Flutter.

Features #

  • 🎯 Rich Media Support: Display images, videos, and audio in notifications
  • Advanced Actions: Custom notification actions and responses
  • 📅 Flexible Scheduling: Schedule notifications with precise timing
  • 🔔 Cross-Platform: Works on iOS, Android, macOS, Windows, and Linux
  • 🎨 Customizable: Extensive styling and appearance options
  • 🛡️ Permission Handling: Built-in permission management
  • 📱 Badge Management: App badge support and management

Getting Started #

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_local_notification_plus: ^0.0.1

Basic Usage #

import 'package:flutter_local_notification_plus/flutter_local_notification_plus.dart';

// Initialize the plugin
await FlutterLocalNotificationPlus.initialize();

// Show a simple notification
await FlutterLocalNotificationPlus.showNotification(
  id: 1,
  title: 'Hello!',
  body: 'This is a notification',
);

// Schedule a notification
await FlutterLocalNotificationPlus.scheduleNotification(
  id: 2,
  title: 'Scheduled',
  body: 'This notification was scheduled',
  scheduledDate: DateTime.now().add(Duration(minutes: 5)),
);

Advanced Features #

Rich Media Notifications #

final notificationDetails = NotificationDetails(
  android: AndroidNotificationDetails(
    'rich_media_channel',
    'Rich Media',
    channelDescription: 'Notifications with rich media content',
    styleInformation: BigPictureStyleInformation(
      DrawableResourceAndroidBitmap('@drawable/notification_image'),
    ),
  ),
);

await FlutterLocalNotificationPlus.showNotification(
  id: 3,
  title: 'Rich Media',
  body: 'Check out this image!',
  notificationDetails: notificationDetails,
);

Custom Actions #

final notificationDetails = NotificationDetails(
  android: AndroidNotificationDetails(
    'actions_channel',
    'Actions',
    channelDescription: 'Notifications with custom actions',
    actions: [
      AndroidNotificationAction('accept', 'Accept'),
      AndroidNotificationAction('decline', 'Decline'),
    ],
  ),
);

Scheduling Options #

// Schedule for specific time
await FlutterLocalNotificationPlus.scheduleNotification(
  id: 4,
  title: 'Meeting Reminder',
  body: 'Team meeting in 30 minutes',
  scheduledDate: DateTime.now().add(Duration(minutes: 30)),
);

// Schedule for specific date and time
final scheduledDate = DateTime(2024, 12, 25, 9, 0); // Christmas morning
await FlutterLocalNotificationPlus.scheduleNotification(
  id: 5,
  title: 'Christmas!',
  body: 'Merry Christmas!',
  scheduledDate: scheduledDate,
);

Platform Support #

Platform Status Notes
Android ✅ Full Support All features available
iOS ✅ Full Support All features available
macOS ✅ Full Support All features available
Windows ✅ Full Support All features available
Linux ✅ Full Support All features available

Configuration #

Android #

Add the following permissions to your android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>

iOS #

Add the following to your ios/Runner/Info.plist:

<key>UIBackgroundModes</key>
<array>
    <string>fetch</string>
    <string>remote-notification</string>
</array>

API Reference #

Core Methods #

  • initialize() - Initialize the notification plugin
  • showNotification() - Display a notification immediately
  • scheduleNotification() - Schedule a notification for later
  • cancelNotification() - Cancel a specific notification
  • cancelAllNotifications() - Cancel all notifications
  • getPendingNotifications() - Get list of pending notifications
  • areNotificationsEnabled() - Check if notifications are enabled
  • requestPermissions() - Request notification permissions

Notification Details #

  • AndroidNotificationDetails - Android-specific settings
  • DarwinNotificationDetails - iOS/macOS-specific settings
  • LinuxNotificationDetails - Linux-specific settings
  • WindowsNotificationDetails - Windows-specific settings

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

Support #

If you encounter any issues or have questions, please:

  1. Check the documentation
  2. Search existing issues
  3. Create a new issue with detailed information

Changelog #

See CHANGELOG.md for a list of changes and version history.

2
likes
0
points
118
downloads

Publisher

verified publisherbechattaoui.dev

Weekly Downloads

Enhanced local notifications with rich media, actions, and scheduling for Flutter

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins

More

Packages that depend on flutter_local_notification_plus

Packages that implement flutter_local_notification_plus