diff --git a/android/app/build.gradle b/android/app/build.gradle
index b94b7a5e..cafe7f90 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -35,9 +35,10 @@ if (keystorePropertiesFile.exists()) {
android {
- compileSdkVersion flutter.compileSdkVersion
+ compileSdkVersion 33
compileOptions {
+ coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
@@ -83,4 +84,7 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:29.2.1')
+ coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
+ implementation 'androidx.window:window:1.0.0'
+ implementation 'androidx.window:window-java:1.0.0'
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 9e68f23b..02ece270 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -1,10 +1,12 @@
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/app/src/main/res/drawable/ic_launcher.png b/android/app/src/main/res/drawable/ic_launcher.png
new file mode 100644
index 00000000..cf7d7d3b
Binary files /dev/null and b/android/app/src/main/res/drawable/ic_launcher.png differ
diff --git a/lib/core/dependency_injection/injection_container.dart b/lib/core/dependency_injection/injection_container.dart
index 6af5dac6..13a4b50a 100644
--- a/lib/core/dependency_injection/injection_container.dart
+++ b/lib/core/dependency_injection/injection_container.dart
@@ -18,7 +18,9 @@ import 'package:dairy_app/features/auth/presentation/bloc/user_config/user_confi
import 'package:dairy_app/features/notes/data/datasources/local%20data%20sources/local_data_source.dart';
import 'package:dairy_app/features/notes/data/datasources/local%20data%20sources/local_data_source_template.dart';
import 'package:dairy_app/features/notes/data/repositories/notes_repository.dart';
+import 'package:dairy_app/features/notes/data/repositories/notifications_repository.dart';
import 'package:dairy_app/features/notes/domain/repositories/notes_repository.dart';
+import 'package:dairy_app/features/notes/domain/repositories/notifications_repository.dart';
import 'package:dairy_app/features/notes/presentation/bloc/notes/notes_bloc.dart';
import 'package:dairy_app/features/notes/presentation/bloc/notes_fetch/notes_fetch_cubit.dart';
import 'package:dairy_app/features/notes/presentation/bloc/selectable_list/selectable_list_cubit.dart';
@@ -29,6 +31,7 @@ import 'package:dairy_app/features/sync/data/datasources/temeplates/key_value_da
import 'package:dairy_app/features/sync/data/repositories/sync_repository.dart';
import 'package:dairy_app/features/sync/domain/repositories/sync_repository_template.dart';
import 'package:dairy_app/features/sync/presentation/bloc/notes_sync/notesync_cubit.dart';
+import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:get_it/get_it.dart';
import 'package:internet_connection_checker/internet_connection_checker.dart';
@@ -119,6 +122,21 @@ Future init() async {
sl.registerSingleton(
NotesRepository(notesLocalDataSource: sl(), authSessionBloc: sl()));
+ sl.registerSingletonAsync(() async {
+ final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
+ const AndroidInitializationSettings initializationSettingsAndroid =
+ AndroidInitializationSettings('@mipmap/ic_launcher');
+
+ const InitializationSettings initializationSettings =
+ InitializationSettings(
+ android: initializationSettingsAndroid,
+ );
+
+ await flutterLocalNotificationsPlugin.initialize(initializationSettings);
+ return NotificationsRepository(
+ flutterLocalNotificationsPlugin: flutterLocalNotificationsPlugin);
+ });
+
//* Blocs
sl.registerLazySingleton(() => NotesBloc(notesRepository: sl()));
sl.registerLazySingleton(() => NotesFetchCubit(
diff --git a/lib/core/pages/settings_page.dart b/lib/core/pages/settings_page.dart
index 26efd93d..9e5c2bd6 100644
--- a/lib/core/pages/settings_page.dart
+++ b/lib/core/pages/settings_page.dart
@@ -10,6 +10,7 @@ import 'package:dairy_app/core/widgets/version_number.dart';
import 'package:dairy_app/features/auth/presentation/bloc/auth_session/auth_session_bloc.dart';
import 'package:dairy_app/features/auth/presentation/widgets/security_settings.dart';
import 'package:dairy_app/features/auth/presentation/widgets/setup_account.dart';
+import 'package:dairy_app/features/notes/presentation/widgets/daily_reminders.dart';
import 'package:dairy_app/features/sync/presentation/widgets/sync_settings.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -127,6 +128,8 @@ class _SettingsPageState extends State {
const SizedBox(height: 15),
const AutoSaveToggleButton(),
const SizedBox(height: 10),
+ const DailyReminders(),
+ const SizedBox(height: 10),
const ThemeDropdown(),
const SizedBox(height: 15),
const SendFeedBack(),
diff --git a/lib/features/auth/core/constants.dart b/lib/features/auth/core/constants.dart
index 168ef4c1..b0b082fb 100644
--- a/lib/features/auth/core/constants.dart
+++ b/lib/features/auth/core/constants.dart
@@ -10,6 +10,8 @@ class UserConfigConstants {
static String isAutoSyncEnabled = "is_auto_sync_enabled";
static String isFingerPrintLoginEnabled = "is_finger_print_log_enabled";
static String isAutoSaveEnabled = "is_auto_save_enabled";
+ static String isDailyReminderEnabled = "is_daily_reminder_enabled";
+ static String reminderTime = "reminder_time";
}
class SyncConstants {
diff --git a/lib/features/auth/data/models/user_config_model.dart b/lib/features/auth/data/models/user_config_model.dart
index 8342c841..0762c1de 100644
--- a/lib/features/auth/data/models/user_config_model.dart
+++ b/lib/features/auth/data/models/user_config_model.dart
@@ -1,5 +1,6 @@
import 'package:dairy_app/features/auth/core/constants.dart';
import 'package:equatable/equatable.dart';
+import 'package:flutter/material.dart';
/// class to store non-critical properties of user
/// it is stored apart from user table, which stores critical properties of user
@@ -13,17 +14,22 @@ class UserConfigModel extends Equatable {
final bool? isAutoSyncEnabled;
final bool? isFingerPrintLoginEnabled;
final bool? isAutoSaveEnabled;
+ final bool? isDailyReminderEnabled;
+ final TimeOfDay? reminderTime;
- const UserConfigModel(
- {required this.userId,
- this.preferredSyncOption,
- this.lastGoogleDriveSync,
- this.lastDropboxSync,
- this.googleDriveUserInfo,
- this.dropBoxUserInfo,
- this.isAutoSyncEnabled,
- this.isFingerPrintLoginEnabled,
- this.isAutoSaveEnabled});
+ const UserConfigModel({
+ required this.userId,
+ this.preferredSyncOption,
+ this.lastGoogleDriveSync,
+ this.lastDropboxSync,
+ this.googleDriveUserInfo,
+ this.dropBoxUserInfo,
+ this.isAutoSyncEnabled,
+ this.isFingerPrintLoginEnabled,
+ this.isAutoSaveEnabled,
+ this.isDailyReminderEnabled,
+ this.reminderTime,
+ });
@override
List