CCExtractor / beacon

Flutter application to share location with a group. (under development)
56 stars 146 forks source link

## Title: Fix for Future Date Validation in Beacon Project #216

Closed vkprogrammer-001 closed 5 months ago

vkprogrammer-001 commented 5 months ago

Fixes #192

Description:

This pull request addresses an issue that was occurring in the Beacon project. Previously, 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. Now, instead of throwing an exception, the application will display a user-friendly error message: "Beacon start time must be at least an hour from now". This message is displayed when the scheduledDate is less than an hour from the current time.

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.

Changes:

Please review and provide any feedback. Thank you!

https://github.com/CCExtractor/beacon/assets/143318563/4d5bb483-4a7e-4e3a-9c39-bc7d8bd2b2f6