5kmrun-bg / 5kmrun-bg/fivekmrun-app
XLrun: start/finish location and track (via supplementary Firebase map)
- 主要言語
- Dart
- スター
- 8
- フォーク
- 7
- 平均マージ
- 2日 8時間
- マージ済み PR(30日)
- 30
説明
## Context
Future-enhancement follow-up to #176 (XLrun future events, grouped by day/location). This issue covers adding start/finish location and the route track to XLrun entries in the events list.
## This data does not exist in any current XLrun endpoint
None of the verified `xlrun/*` endpoints (`events`, `results`, `result/`, `user/`) carry start location, finish location, or a track/route — confirmed by inspecting live responses while scoping #176/#177/#178/#179. This isn't something that can be derived or parsed from existing fields (unlike distance, which is at least embedded as text in `n_name`).
## Planned data source: a separate Firebase-backed supplementary map
The plan (per direction from the team) is to maintain a separate map in Firebase that supplies this complementary info **where available**, joined client-side against the XLrun event data from the existing API. This is new: the app currently only depends on `firebase_core`, `firebase_analytics`, `firebase_messaging`, `firebase_crashlytics`, and `firebase_remote_config` (see `pubspec.yaml`) — there is no `cloud_firestore` / `firebase_database` client yet, so sourcing structured per-event data from Firebase means either adding one of those, or repurposing Remote Config (likely awkward for this shape of data, since Remote Config is meant for small config values, not a growing per-event dataset). **Adding a new dependency needs to be confirmed with the user first, per this repo's conventions** — don't add it silently as part of implementing this issue.
## Implementation note: this must be optional / best-effort
**This is not guaranteed data.** Implement it as a lookup that gracefully degrades:
- If the Firebase map has a matching entry for a given XLrun event, show its start location, finish location, and track.
- If there's no match (event not yet in the map, or the map only has partial fields for it), fall back to the card as it renders today **without** those elements — no error state, no empty placeholder rows, no broken layout. The rest of the event card (from #176) must work identically whether or not this data is present.
## Rendering the track
The app already has a working pattern for rendering a route as a static map image from an encoded polyline, used for selfie-run routes: `lib/offline_chart/offline_chart_details_page.dart:20-22` builds a Google Static Maps URL (`https://maps.googleapis.com/maps/api/staticmap?...&path=weight:3|color:...|enc:`) using the existing `googleMapsKey` secret. If the Firebase map stores tracks as encoded polylines, this same approach should work directly; if it stores something else (raw lat/lng list, a pre-rendered image URL, a GPX file, etc.), the rendering approach will need to be adapted — the exact format isn't decided yet since the Firebase map doesn't exist yet either.
## What to build
- Decide the lookup key that joins a Firebase entry to an XLrun event (e.g. `e_id`, or the location id `e_location`, or a stable slug) when the Firebase map is designed.
- Fetch/cache the Firebase supplementary data once (not per-card / not on every rebuild) to avoid excessive reads.
- Merge matched entries into the grouped XL event card (#176) as additional optional rows: start location, finish location, and a track image — rendered only when present, per the fallback principle above.
## Likely files touched
- New Firebase-backed resource (shape TBD, depends on the dependency decision above).
- `lib/state/event_model.dart` — likely a new optional field/wrapper for the joined XL event + supplementary data.
- `lib/events/future_events.dart` (or wherever #176's grouped card widget lands) — conditional rendering of start/finish/track.
## Related
- #176 — XLrun future events (grouping + distance display) — this data decorates that card.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。