FB-05: closed-loop routes in Route Planner

Add an isClosedLoop toggle to route plans (schema v3 -> v4 migration),
threaded through the domain model, repository distance recomputation,
the overflow menu, and the drawn polyline, so a route can loop back to
its first waypoint.
This commit is contained in:
2026-08-24 16:22:51 -05:00
parent 57bc3c9233
commit 9ac0be6ee5
9 changed files with 359 additions and 8 deletions

View File

@@ -241,6 +241,7 @@ class RoutePlan {
this.distanceM = 0.0,
this.estimatedMillis,
this.geometry,
this.isClosedLoop = false,
});
final int id;
@@ -256,6 +257,9 @@ class RoutePlan {
/// never stored -- it is fully derived from them, so there is nothing to persist.
final String? geometry;
/// Whether the route loops back to its first waypoint after the last one.
final bool isClosedLoop;
RoutePlan copyWith({
int? id,
String? name,
@@ -264,6 +268,7 @@ class RoutePlan {
double? distanceM,
int? estimatedMillis,
String? geometry,
bool? isClosedLoop,
}) => RoutePlan(
id: id ?? this.id,
name: name ?? this.name,
@@ -272,6 +277,7 @@ class RoutePlan {
distanceM: distanceM ?? this.distanceM,
estimatedMillis: estimatedMillis ?? this.estimatedMillis,
geometry: geometry ?? this.geometry,
isClosedLoop: isClosedLoop ?? this.isClosedLoop,
);
}