nearby stations in search#8
Open
frephs wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a "Nearby Stations" feature, allowing users to see train stations closest to their current location. It includes new location permissions, a on-device station database with server sync and caching, UI integration in the station picker dialog, and all supporting utilities.
Nearby stations feature and infrastructure:
NearbyStationsServicefor fetching, caching, and syncing station data with the server, including fallback to bundled JSON and on-device distance calculation using the Haversine formula (lib/utils/nearby_stations_service.dart,lib/utils/endpoint.dart,lib/utils/shared_preference.dart) [1] [2] [3] [4].LocationServicefor requesting and checking location permissions and retrieving the user's position (lib/utils/location_service.dart).AndroidManifest.xmland updated dependencies to includegeolocator(android/app/src/main/AndroidManifest.xml,pubspec.yaml) [1] [2].State management and UI integration:
NearbyStationsCubitand related states for managing nearby stations loading and error handling (lib/cubit/nearby_stations.dart).NearbyStationsListwidget and logic to display it when the search field is empty (lib/view/components/dialog/station_picker.dart,lib/view/components/stations/nearby_stations_list.dart) [1] [2] [3] [4].Other changes and improvements:
lib/view/components/stations/saved_stations_list.dart).Strikemodel (lib/model/Strike.dart).lib/main.dart) [1] [2].These changes together provide users with a seamless way to quickly select nearby stations, with robust handling for offline use and location permissions.