diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index 1d878aa..9fed0ee 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -14,6 +14,7 @@ android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
+ isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
@@ -22,7 +23,7 @@ android {
defaultConfig {
applicationId = "com.example.shooter_app"
- minSdk = 26 // ✅ From earlier fix
+ minSdk = 26
targetSdk = 33
versionCode = flutter.versionCode
versionName = flutter.versionName
@@ -31,12 +32,18 @@ android {
buildTypes {
release {
signingConfig = signingConfigs.getByName("debug")
+ isMinifyEnabled = false
+ isShrinkResources = false
}
}
}
+dependencies {
+ coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
+}
+
flutter {
source = "../.."
}
diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro
index 494833b..86e922f 100644
--- a/android/app/proguard-rules.pro
+++ b/android/app/proguard-rules.pro
@@ -16,3 +16,13 @@
# Keep your YOLO model loader class if needed
-keep class your.package.name.YOLODetect { *; }
+
+# Flutter Local Notifications
+-keep class com.dexterous.** { *; }
+-dontwarn com.dexterous.**
+
+# Timezone
+-keep class com.jakewharton.threetenabp.** { *; }
+-dontwarn com.jakewharton.threetenabp.**
+-keep class org.threeten.** { *; }
+-dontwarn org.threeten.**
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index ef27da9..c3fadf5 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -5,6 +5,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts
index a439442..11662c3 100644
--- a/android/settings.gradle.kts
+++ b/android/settings.gradle.kts
@@ -19,7 +19,7 @@ pluginManagement {
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.7.0" apply false
- id("org.jetbrains.kotlin.android") version "1.8.22" apply false
+ id("org.jetbrains.kotlin.android") version "2.1.0" apply false
}
include(":app")
diff --git a/lib/main.dart b/lib/main.dart
index 6b7c050..2893833 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,9 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; // Import for SystemChrome
import 'screens/home_screen.dart';
+import 'services/notification_service.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
+ try {
+ await NotificationService().initialize();
+ } catch (_) {}
// Lock orientation to portrait only
await SystemChrome.setPreferredOrientations([
diff --git a/lib/screens/calendar_screen.dart b/lib/screens/calendar_screen.dart
index f09af2c..e25db66 100644
--- a/lib/screens/calendar_screen.dart
+++ b/lib/screens/calendar_screen.dart
@@ -5,6 +5,7 @@ import 'package:intl/date_symbol_data_local.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
import '../services/google_calendar_service.dart';
+import '../services/notification_service.dart';
import '../utils/translations.dart';
import '../utils/target_colors.dart';
@@ -234,6 +235,7 @@ class _CalendarScreenState extends State {
_events = filteredEvents;
});
}
+ NotificationService().scheduleEventNotifications(filteredEvents);
} catch (e) {
if (mounted) {
setState(() {
diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart
index d512163..c6ba113 100644
--- a/lib/screens/home_screen.dart
+++ b/lib/screens/home_screen.dart
@@ -133,7 +133,7 @@ class _HomeScreenState extends State {
padding: const EdgeInsets.only(right: 16.0),
child: Center(
child: Text(
- 'V1.0.3',
+ 'V1.1',
style: TextStyle(
color: Colors.grey[400],
fontSize: 12,
diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart
index bf00e2b..e9995ff 100644
--- a/lib/screens/settings_screen.dart
+++ b/lib/screens/settings_screen.dart
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../utils/translations.dart';
import '../utils/target_colors.dart';
+import '../services/notification_service.dart';
class SettingsScreen extends StatefulWidget {
const SettingsScreen({super.key});
@@ -43,6 +44,13 @@ class _SettingsScreenState extends State {
'Grey',
];
+ int _notificationHours = 1;
+ final List _notificationHourOptions = [1, 2, 3, 6, 12, 24, 48];
+
+ bool _notifyDezuranje = true;
+ bool _notifySestanek = true;
+ bool _notifyTekma = true;
+
String _selectedLanguage = 'English';
final List