Skip to content

Commit

Permalink
feat: upgrade project to work with the latest version of flutter (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
brokoli18 authored Feb 17, 2025
1 parent 3482f7b commit 4a50f7d
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 298 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ jobs:
with:
channel: stable
- name: Check Dart Format
run: dart format --set-exit-if-changed .
run: |
flutter pub get
dart format --set-exit-if-changed .
3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "io.vikunja.app"
Expand Down
3 changes: 0 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ allprojects {
}
}

buildscript {
ext.kotlin_version = '1.9.0'
}

rootProject.buildDir = '../build'
subprojects {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jul 03 00:50:12 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 3 additions & 3 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

include ":app"
include ":app"
14 changes: 5 additions & 9 deletions lib/managers/notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ class NotificationClass {
var initializationSettingsAndroid =
notifs.AndroidInitializationSettings('vikunja_logo');
var initializationSettingsIOS = notifs.DarwinInitializationSettings(
requestAlertPermission: false,
requestBadgePermission: false,
requestSoundPermission: false,
onDidReceiveLocalNotification:
(int? id, String? title, String? body, String? payload) async {
didReceiveLocalNotificationSubject.add(NotificationClass(
id: id, title: title, body: body, payload: payload));
});
requestAlertPermission: false,
requestBadgePermission: false,
requestSoundPermission: false,
);
var initializationSettings = notifs.InitializationSettings(
android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
await notificationsPlugin.initialize(initializationSettings,
Expand Down Expand Up @@ -100,7 +96,7 @@ class NotificationClass {
print("scheduled notification for time " + time.toString());
await notifsPlugin.zonedSchedule(
id, title, description, time, platformChannelSpecifics,
androidAllowWhileIdle: true,
androidScheduleMode: notifs.AndroidScheduleMode.exactAllowWhileIdle,
uiLocalNotificationDateInterpretation: notifs
.UILocalNotificationDateInterpretation
.wallClockTime); // This literally schedules the notification
Expand Down
Loading

0 comments on commit 4a50f7d

Please sign in to comment.