Skip to content

A comprehensive Flutter example for implementing rich, interactive notifications using the Awesome Notifications package. Features include basic and scheduled notifications, big picture layouts, notification actions, and background tasks.

License

Notifications You must be signed in to change notification settings

mahmoodhamdi/awesome_notifications_guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Awesome Notifications Guide ๐Ÿ””

A comprehensive Flutter example demonstrating how to implement and use the Awesome Notifications package for creating rich, interactive notifications in your Flutter applications.

๐ŸŒŸ Features

  • ๐Ÿ“ฑ 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

๐Ÿš€ Getting Started

Prerequisites

  • Flutter SDK
  • Android Studio / VS Code
  • Basic understanding of Flutter development

Installation

1- Add the following dependency to your pubspec.yaml

dependencies:
  awesome_notifications: ^[latest_version]

2- Run:

flutter pub get

โš™๏ธ Configuration

๐Ÿค– Configuring Android for Awesome Notifications

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>

๐Ÿ’ก Usage

Initialization

await AwesomeNotificationsHelper.initializeLocalNotifications();
await AwesomeNotificationsHelper.initializeIsolateReceivePort();

Creating a Basic Notification

await AwesomeNotificationsHelper.createNewNotification();

Scheduling a Notification

await AwesomeNotificationsHelper.scheduleNewNotification();

Scheduling Repeating Notifications

await AwesomeNotificationsHelper.scheduleMinuteNotifications();

Managing Notifications

// Reset badge counter
await AwesomeNotificationsHelper.resetBadgeCounter();

// Cancel all notifications
await AwesomeNotificationsHelper.cancelNotifications();

๐Ÿ—๏ธ Project Structure

lib/
โ”œโ”€โ”€ app.dart
โ”œโ”€โ”€ main.dart
โ”œโ”€โ”€ home_page.dart
โ”œโ”€โ”€ notification_page.dart
โ”œโ”€โ”€ awesome_notifications_helper.dart
โ””โ”€โ”€ schedule_notification_dialog.dart

๐Ÿ› ๏ธ Core Components

AwesomeNotificationsHelper

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

ScheduleNotificationDialog

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

NotificationPage

A dedicated page for displaying notification details, including:

  • Title and body
  • Large icons
  • Big pictures
  • Custom layouts

๐Ÿ“ License

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

๐Ÿค Contributing

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

โœจ Acknowledgments

  • Special thanks to the Awesome Notifications package maintainers

Quote

" ู…ูŽู† ู‚ุงู„ูŽ: ู„ุง ุฅู„ูŽู‡ูŽ ุฅู„ูŽู‘ุง ุงู„ู„ูŽู‘ู‡ูุŒ ูˆุญู’ุฏูŽู‡ู ู„ุง ุดูŽุฑููŠูƒูŽ ู„ู‡ุŒ ู„ู‡ ุงู„ู…ูู„ู’ูƒู ูˆู„ู‡ ุงู„ุญูŽู…ู’ุฏูุŒ ูˆู‡ูˆ ุนู„ูŽู‰ ูƒูู„ูู‘ ุดูŽูŠุกู ู‚ูŽุฏููŠุฑูŒุŒ ููŠ ูŠูŽูˆู…ู ู…ูุฆูŽุฉูŽ ู…ูŽุฑูŽู‘ุฉูุ› ูƒุงู†ูŽุชู’ ู„ู‡ ุนูŽุฏู’ู„ูŽ ุนูŽุดู’ุฑู ุฑูู‚ุงุจูุŒ ูˆูƒูุชูุจูŽุชู’ ู„ู‡ ู…ูุฆูŽุฉู ุญูŽุณูŽู†ูŽุฉูุŒ ูˆู…ูุญููŠูŽุชู’ ุนู†ู’ู‡ ู…ูุฆูŽุฉู ุณูŽูŠูู‘ุฆูŽุฉูุŒ ูˆูƒุงู†ูŽุชู’ ู„ู‡ ุญูุฑู’ุฒู‹ุง ู…ูู†ูŽ ุงู„ุดูŽู‘ูŠู’ุทุงู†ู ูŠูŽูˆู…ูŽู‡ู ุฐู„ูƒูŽ ุญุชูŽู‘ู‰ ูŠูู…ู’ุณููŠูŽุŒ ูˆู„ูŽู…ู’ ูŠูŽุฃู’ุชู ุฃุญูŽุฏูŒ ุจุฃูŽูู’ุถูŽู„ูŽ ู…ู…ูŽู‘ุง ุฌุงุกูŽ ุจู‡ุŒ ุฅู„ูŽู‘ุง ุฃุญูŽุฏูŒ ุนูŽู…ูู„ูŽ ุฃูƒู’ุซูŽุฑูŽ ู…ูู† ุฐู„ูƒูŽ "

ุตุญูŠุญ ุงู„ุจุฎุงุฑูŠ

About

A comprehensive Flutter example for implementing rich, interactive notifications using the Awesome Notifications package. Features include basic and scheduled notifications, big picture layouts, notification actions, and background tasks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published