FLUTTER ECOSYSTEM

sathish76/flutter_dnd

Android에서 방해 금지 설정을 관리하기 위한 플러터 플러그인입니다.

flutter_dnd 프로젝트 이미지
Stars
7
Forks
14
최근 푸시(UTC)
2021. 11. 13.
프로젝트 상태
활성
Sathish GitHub avatar
GITHUB User

Sathish ↗

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

Chennai
언어DartJavaRubyObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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.