FLUTTER ECOSYSTEM

sathish76/flutter_dnd

Ein Flutter-Plugin zur Verwaltung der Nicht-Stören-Einstellungen unter Android.

Projektcover von flutter_dnd
Stars
7
Forks
14
Letzter Push (UTC)
13.11.2021
Projektstatus
Aktiv
Sathish GitHub avatar
GITHUB User

Sathish ↗

Mobile and Web Developer! Native Android & iOS, Flutter, Vue.js, Node.js

Chennai
SprachenDartJavaRubyObjective-C

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 2 Einträge
  • flutter{"sdk":"flutter"}
  • flutter_testEntwicklung{"sdk":"flutter"}

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Projekt-README ein-/ausklappen

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.