Repository navigation
feat(metro): locate nearest station across systems - #114
Open
steventeng2022 wants to merge 1 commit into
Open
steventeng2022 wants to merge 1 commit into
steventeng2022 wants to merge 1 commit into
Conversation
Av1anJay
requested changes
Nov 3, 2026
Av1anJay
left a comment
Collaborator
There was a problem hiding this comment.
Code review: changes requested
lib/screens/metro_dashboard_screen.dart:262-263— Incomplete system data is reported as complete. A system is counted as available whenever its three requests return successfully, even if its stations or station-of-line list is empty, or all its stations have invalid coordinates / no matching line. For example, if KRTC returns HTTP 200 with an empty station list while TRTC has data, a user in Kaohsiung will be told that a Taipei station is the nearest with no incomplete-coverage warning._getJsonListalso converts a non-list HTTP 200 response to an empty list, so this can occur without an exception. Detect systems without usable candidate stations as incomplete, and add a widget regression test with one unusable and one usable system.
Checks: GitHub CI Verify passed (Flutter analyze, full Flutter tests, web route test, Node runtime tests); Android, iOS, Linux, macOS, Windows, Wear OS and Web builds passed. Locally, git diff --check passed and the Node runtime tests passed on Node 22.23.4 (3 tests). Flutter SDK is not installed locally, so Flutter checks were not rerun here. Inspected live metro API responses and reproduced the incomplete-coverage condition with an empty KRTC station list.
This branch has not been deployed
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.
Adds a Find nearest station / 定位最近的車站 button to the metro dashboard. For example, a rider in Kaohsiung with Taipei Metro selected can locate once to switch to the nearest station's system and serving line, open its map, and load its arrival information.
station-of-line, including stations whoseline_idis empty. Ignore invalid coordinates and unavailable lines; prefer the current line at an interchange when distances tie.Closes #55.
Validation with Flutter 3.47.6 / Dart 3.13.5:
nearest_metro_station_test.dart,metro_nearest_station_test.dart,user_location_test.dart,metro_direction_test.dart, andmetro_direction_selector_test.dart.git diff --check: passed.The repository-wide analyzer reports six pre-existing
unawaited_return_in_try_blockwarnings inapp_controller.dart,app_update_service.dart, andbus_repository.dartwith this newer local SDK. The repository's CI uses Flutter 3.41.6; no dependency or SDK versions are changed by this PR. Physical-device GPS and the full test suite were not exercised locally.