diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fecbea7..53b0a76 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,7 @@ + + + TZDateTime( + local, + currentTime.year, + currentTime.month, + currentTime.day, + item[0], + item[1], + )) + .toList(); + + // For all entries in the past, add 1 day + for (var time in notificationTimes + .where((element) => element.compareTo(currentTime) < 0)) { + time.add(const Duration(days: 1)); + } + + // Sort the array so we can find the closest time + notificationTimes.sort((a, b) => a.compareTo(b)); + + await FlutterLocalNotificationsPlugin().zonedSchedule( + 1, + null, + null, + notificationTimes[0], + details, + uiLocalNotificationDateInterpretation: + UILocalNotificationDateInterpretation.absoluteTime, ); }