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:
@@ -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),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user