SyntheticTrackingRoute.stationary constructor
SyntheticTrackingRoute.stationary(
{ - int pointCount = 20,
- DateTime? startedAt,
})
Implementation
factory SyntheticTrackingRoute.stationary({
int pointCount = 20,
DateTime? startedAt,
}) {
final start = (startedAt ?? DateTime.utc(2026)).toUtc();
return SyntheticTrackingRoute(
List<LocationSample>.generate(
pointCount,
(index) => LocationSample(
latitude: (index.isEven ? 1 : -1) * 0.000001,
longitude: (index % 3 - 1) * 0.000001,
horizontalAccuracy: 8,
capturedAt: start.add(Duration(seconds: index * 15)),
provider: 'synthetic',
eventId: 'stationary-$index',
mockDetectionAvailable: false,
),
growable: false,
),
<ActivitySnapshot>[
ActivitySnapshot(
type: TrackingActivityType.stationary,
confidence: 95,
recordedAt: start,
),
],
);
}