Skip to content

Commit

Permalink
commit ignore wrong locations and go with UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspfahl committed Aug 8, 2024
1 parent 555068a commit f11c723
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/service/LocalNotificationService.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,14 @@ class LocalNotificationService {
InitializationSettings(android: initializationSettingsAndroid);

tz.initializeTimeZones();
final String currentTimeZone = await FlutterTimezone.getLocalTimezone();
debugPrint("currentTimeZone=$currentTimeZone");
tz.setLocalLocation(tz.getLocation(currentTimeZone));
try {
final String currentTimeZone = await FlutterTimezone.getLocalTimezone();
debugPrint("currentTimeZone=$currentTimeZone");
tz.setLocalLocation(tz.getLocation(currentTimeZone));
} catch (e) {
// ignore instead of failing
print(e);
}

await _flutterLocalNotificationsPlugin.initialize(initializationSettings,
onDidReceiveNotificationResponse: (NotificationResponse response) async {
Expand Down

0 comments on commit f11c723

Please sign in to comment.