V3-04: live map on the recording screen

Feeds RideMap from watchPointsForTrip/watchSegmentsForTrip via autoDispose.family providers. RecordingEngine stays map-free (enforced by architecture_test.dart). RideMap gained lifecycle-aware tile teardown and follow-mode, both shared with the trip-detail map.
This commit is contained in:
2026-08-17 14:45:37 -05:00
parent 0267d0108c
commit f3c7e2d6b4
8 changed files with 239 additions and 13 deletions

View File

@@ -110,3 +110,14 @@ final mapEnabledProvider = StateProvider<bool>(
final unitSystemProvider = StateProvider<UnitSystem>(
(ref) => ref.watch(configProvider)?.unitSystem ?? UnitSystem.metric,
);
/// Live path for the recording screen's map (V3-04). `.family` + `autoDispose` so the
/// stream tears down the moment the record screen stops watching it — no leftover
/// subscription ticking away once a ride ends or the map toggle goes off.
final livePointsProvider = StreamProvider.autoDispose.family<List<TrackPoint>, int>(
(ref, tripId) => ref.watch(databaseProvider).watchPointsForTrip(tripId),
);
final liveSegmentsProvider = StreamProvider.autoDispose.family<List<Segment>, int>(
(ref, tripId) => ref.watch(databaseProvider).watchSegmentsForTrip(tripId),
);