Search packages, repositories and app categories

Package detailsv0.1.4+1

flutter_dnd

A Flutter plugin to manage Do Not Disturb settings on Android.

Android
30-day downloads
17
Likes
27
Pub points
160

Install package

flutter pub add flutter_dnd

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter plugin that enables management of Do Not Disturb (DND) settings on Android devices. It allows apps to programmatically check, enable, or modify DND modes, including priority rules and time schedules. Designed for developers building apps that need to respect user focus modes or integrate with system-level notification controls. The plugin provides a simple interface to interact with Android's DND APIs without requiring native code knowledge. It is platform-specific, supporting only Android.

Use cases

  • Managing notification interruptions in productivity apps
  • Respecting user focus modes during scheduled times
  • Integrating with alarm or reminder systems
  • Enabling silent mode during specific events
  • Checking current DND status programmatically

Key features

  • Check and modify Do Not Disturb status
  • Support for priority rules and time ranges
  • Android-only platform support
  • Simple Dart API
  • No native code required for basic usage

Suitable for

  • Productivity and reminder apps
  • Alarm and sleep tracking tools
  • Apps needing silent mode integration
  • Developers targeting Android DND features

Considerations

  • Limited to Android platforms
  • Requires runtime permission for DND changes
  • May behave differently across Android versions
  • User must manually grant DND access in some cases
  • Not compatible with iOS

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_dnd

pub package A Flutter plugin to manage Do Not Disturb settings on Android.

Usage

To use this plugin, add flutter_dnd as a dependency in your pubspec.yaml file.

Make sure you add the following permissions to your Android Manifest

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

Example

// Import package
import 'package:flutter_dnd/flutter_dnd.dart';

if (await FlutterDnd.isNotificationPolicyAccessGranted) {
	await FlutterDnd.setInterruptionFilter(FlutterDnd.INTERRUPTION_FILTER_NONE); // Turn on DND - All notifications are suppressed.
} else {
	FlutterDnd.gotoPolicySettings();
}
Other filters
Filter Description
INTERRUPTION_FILTER_ALL No notifications are suppressed.
INTERRUPTION_FILTER_PRIORITY Allow priority notifications.
INTERRUPTION_FILTER_NONE Suppress all notifications.
INTERRUPTION_FILTER_ALARMS Allow alarm notifications.

Categories

Source repository

Projects using this package

No data available yet.