This pull request addresses an issue that was occurring in the Beacon project. The issue was identified in the local_notification.dart file. When creating a hike, an exception was thrown with the message: Exception: Invalid argument (scheduledDate): Must be a date in the future: Instance of 'TZDateTime'.
The root cause of this issue was that the scheduledDate argument was not properly validated to ensure it was a future date. This resulted in an invalid argument exception when the scheduledDate was not in the future.
In this pull request, I have implemented a fix for this issue. The solution involves checking the difference between the current time and the beaconStart time. If the beaconStart time is less than an hour from the current time, a message is printed: "Beacon start time must be at least an hour from now", and the function returns early.
Changes:
Added a check to ensure the beaconStart time is at least an hour in the future.
Updated the error messaging to inform the user when the beaconStart time is too soon.
This fix improves the user experience by providing a more informative and understandable error message. It also prevents the application from crashing due to an unhandled exception.
Please review and provide any feedback. Thank you!
Fixes #192
Description:
This pull request addresses an issue that was occurring in the Beacon project. The issue was identified in the
local_notification.dart
file. When creating a hike, an exception was thrown with the message:Exception: Invalid argument (scheduledDate): Must be a date in the future: Instance of 'TZDateTime'
.The root cause of this issue was that the
scheduledDate
argument was not properly validated to ensure it was a future date. This resulted in an invalid argument exception when thescheduledDate
was not in the future.In this pull request, I have implemented a fix for this issue. The solution involves checking the difference between the current time and the
beaconStart
time. If thebeaconStart
time is less than an hour from the current time, a message is printed: "Beacon start time must be at least an hour from now", and the function returns early.Changes:
beaconStart
time is at least an hour in the future.beaconStart
time is too soon.This fix improves the user experience by providing a more informative and understandable error message. It also prevents the application from crashing due to an unhandled exception.
Please review and provide any feedback. Thank you!
https://github.com/CCExtractor/beacon/assets/143318563/75622ffb-e00d-46d4-904c-3eeb0501f312