notification_cleaner

A Flutter plugin to clear all notifications, supporting modern platform implementations with proper permission handling.

🚀 Maintained and updated fork of clear_all_notifications


✨ Features

  • Clear all notifications from the notification tray
  • Supports modern Android versions (including Android 13+)
  • Works with iOS (subject to platform limitations)
  • Simple and minimal API
  • Lightweight and fast

📦 Installation

Add this to your pubspec.yaml:

dependencies:
  notification_cleaner: ^0.0.4

Then run:

flutter pub get

⚙️ Setup

Android

Add permission in android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

Request permission at runtime (Android 13+):

import 'package:permission_handler/permission_handler.dart';

await Permission.notification.request();

iOS

No additional setup is required.

⚠️ Note: iOS has system limitations on managing notifications. Behavior may vary compared to Android.


🚀 Usage

import 'package:notification_cleaner/notification_cleaner.dart';

await NotificationCleaner.clearAllNotifications();

📱 Example

ElevatedButton(
  onPressed: () async {
    await NotificationCleaner.clearAllNotifications();
  },
  child: const Text("Clear Notifications"),
)

📚 API

clearAllNotifications()

Clears all notifications from the device notification tray.

Future<void> clearAllNotifications()

📝 Notes

  • Behavior may differ between Android and iOS due to platform restrictions
  • On Android 13+, notification permission is required
  • Some device manufacturers may restrict background notification access

🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.



📄 License

This project is licensed under the MIT License.


❤️ Acknowledgements

This package is a maintained fork of clear_all_notifications. Thanks to the original authors for their work.