Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Future Date Validation in Beacon Project #218

Closed
wants to merge 7 commits into from
6 changes: 2 additions & 4 deletions lib/services/local_notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ class LocalNotification {
// We have to check if the hike is after 1 hour or not

scheduledDate = await tz.TZDateTime.from(
DateTime.fromMillisecondsSinceEpoch(beacon.startsAt!),
tz.local,
).subtract(Duration(hours: 1));
DateTime.fromMillisecondsSinceEpoch(beacon.startsAt!),tz.local);
await flutterLocalNotificationsPlugin.zonedSchedule(
beacon.id.hashCode,
'Reminder: ' + beacon.title! + ' will start in an hour',
Expand Down Expand Up @@ -109,4 +107,4 @@ class LocalNotification {
payload: beacon.id,
);
}
}
}
Loading