A comprehensive Flutter example demonstrating how to implement and use the Awesome Notifications package for creating rich, interactive notifications in your Flutter applications.
- 📱 Create basic notifications with title and body
- 🖼️ Display notifications with large icons and big pictures
- ⏰ Schedule notifications
- 🕑 Schedule notifications using a custom dialog
- 🎯 Handle notification actions and responses
- 🔄 Background task execution
- 🎨 Customizable notification layouts
- 🔔 Badge counter management
- Flutter SDK
- Android Studio / VS Code
- Basic understanding of Flutter development
1- Add the following dependency to your pubspec.yaml
dependencies:
awesome_notifications: ^[latest_version]
2- Run:
flutter pub get
1- Configure minimum Android SDK requirements in android/app/build.gradle
android {
compileSdkVersion 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 34
}
}
2- Add required permissions in android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application>
...
</application>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
</manifest>
3- Export activities in AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application>
<activity
android:name=".MainActivity"
android:exported="true">
...
</activity>
</application>
</manifest>
await AwesomeNotificationsHelper.initializeLocalNotifications();
await AwesomeNotificationsHelper.initializeIsolateReceivePort();
await AwesomeNotificationsHelper.createNewNotification();
await AwesomeNotificationsHelper.scheduleNewNotification();
await AwesomeNotificationsHelper.scheduleMinuteNotifications();
// Reset badge counter
await AwesomeNotificationsHelper.resetBadgeCounter();
// Cancel all notifications
await AwesomeNotificationsHelper.cancelNotifications();
lib/
├── app.dart
├── main.dart
├── home_page.dart
├── notification_page.dart
├── awesome_notifications_helper.dart
└── schedule_notification_dialog.dart
A utility class that handles:
- Notification initialization
- Creation of notifications
- Scheduling notifications
- Scheduling notifications (including minute-based schedules)
- Permission management
- Action handling
- Background task execution
A dedicated widget to allow users to:
- Pick a date and time for the notification
- Toggle repeat notifications
- Return the selected options to schedule notifications accordingly
A dedicated page for displaying notification details, including:
- Title and body
- Large icons
- Big pictures
- Custom layouts
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Special thanks to the Awesome Notifications package maintainers
" مَن قالَ: لا إلَهَ إلَّا اللَّهُ، وحْدَهُ لا شَرِيكَ له، له المُلْكُ وله الحَمْدُ، وهو علَى كُلِّ شَيءٍ قَدِيرٌ، في يَومٍ مِئَةَ مَرَّةٍ؛ كانَتْ له عَدْلَ عَشْرِ رِقابٍ، وكُتِبَتْ له مِئَةُ حَسَنَةٍ، ومُحِيَتْ عنْه مِئَةُ سَيِّئَةٍ، وكانَتْ له حِرْزًا مِنَ الشَّيْطانِ يَومَهُ ذلكَ حتَّى يُمْسِيَ، ولَمْ يَأْتِ أحَدٌ بأَفْضَلَ ممَّا جاءَ به، إلَّا أحَدٌ عَمِلَ أكْثَرَ مِن ذلكَ "
صحيح البخاري