Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
geekymon2 committed Jun 1, 2024
1 parent 0003f77 commit d09d98d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class NitnemApp extends StatelessWidget {

List<AppRoute> _getRoutes() {
final List<AppRoute> routes = <AppRoute>[
// Demos
AppRoute(
routeName: '/home',
buildRoute: (BuildContext context) => HomeScreen(
Expand Down
4 changes: 3 additions & 1 deletion lib/redux/middleware/middleware.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -126,7 +127,8 @@ Future<AppOptions> 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);
Expand Down
12 changes: 7 additions & 5 deletions lib/redux/reducers/dndreducer.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -9,14 +9,16 @@ final dndReducer = combineReducers<bool>([
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;
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d09d98d

Please sign in to comment.