From d09d98d7bcdf873886c00f7e25ddd7e730a43ab1 Mon Sep 17 00:00:00 2001 From: Geeky Mon2 Date: Sat, 1 Jun 2024 20:37:57 +1000 Subject: [PATCH] update --- lib/app.dart | 1 - lib/redux/middleware/middleware.dart | 4 +++- lib/redux/reducers/dndreducer.dart | 12 +++++++----- pubspec.yaml | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/app.dart b/lib/app.dart index ecef64e..319b09d 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -57,7 +57,6 @@ class NitnemApp extends StatelessWidget { List _getRoutes() { final List routes = [ - // Demos AppRoute( routeName: '/home', buildRoute: (BuildContext context) => HomeScreen( diff --git a/lib/redux/middleware/middleware.dart b/lib/redux/middleware/middleware.dart index b3482c0..cc524ee 100644 --- a/lib/redux/middleware/middleware.dart +++ b/lib/redux/middleware/middleware.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart' show rootBundle; +//import 'package:flutter_dnd/flutter_dnd.dart'; import 'package:nitnem/common/printmessage.dart'; import 'package:nitnem/constants/appconstants.dart'; import 'package:nitnem/models/language.dart'; @@ -126,7 +127,8 @@ Future loadOptionsFromPrefs() async { bool hasNPAccess = false; AppOptions options = AppOptions.initial(); if (defaultTargetPlatform == TargetPlatform.android) { - // hasNPAccess = (await FlutterDnd.isNotificationPolicyAccessGranted)!; + //TODO: need to fix DND + //hasNPAccess = (await FlutterDnd.isNotificationPolicyAccessGranted)!; } SharedPreferences preferences = await SharedPreferences.getInstance(); var stateString = preferences.getString(AppConstants.OPTIONS_SHAREDPREF_KEY); diff --git a/lib/redux/reducers/dndreducer.dart b/lib/redux/reducers/dndreducer.dart index 23957fa..005c07c 100644 --- a/lib/redux/reducers/dndreducer.dart +++ b/lib/redux/reducers/dndreducer.dart @@ -1,4 +1,4 @@ -// import 'package:flutter_dnd/flutter_dnd.dart'; +//import 'package:flutter_dnd/flutter_dnd.dart'; import 'package:nitnem/redux/actions/actions.dart'; import 'package:redux/redux.dart'; @@ -9,14 +9,16 @@ final dndReducer = combineReducers([ bool _activeDNDReducer(bool isDND, ToggleDNDAction action) { if (action.isDnd) { if (action.hasNPAccess) { - // FlutterDnd.setInterruptionFilter( - // FlutterDnd.INTERRUPTION_FILTER_NONE); //Supress All Notifications + // TODO: Need to fix DND + + // FlutterDnd.setInterruptionFilter( + // FlutterDnd.INTERRUPTION_FILTER_NONE); //Supress All Notifications } else { // FlutterDnd.gotoPolicySettings(); } } else { - // FlutterDnd.setInterruptionFilter( - // FlutterDnd.INTERRUPTION_FILTER_ALL); //No notifications are supressed + //FlutterDnd.setInterruptionFilter( + // FlutterDnd.INTERRUPTION_FILTER_ALL); //No notifications are supressed } return action.isDnd; diff --git a/pubspec.yaml b/pubspec.yaml index 712be90..883a0c4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,6 +33,7 @@ dependencies: provider: ^6.1.2 cupertino_icons: ^1.0.2 wakelock_plus: ^1.2.5 + # flutter_dnd: ^0.1.4+1 dev_dependencies: flutter_launcher_icons: ^0.13.1