screen-locker/stronglift_replacement/workout_app/test/fake_geolocator.dart
Krzysztof kuhy Rudnicki 48d21bfafc One-mode run, pace target, idle map
Remove the run/walk toggle: every recording uses the 25 km/h running
filter and writes a Running TCX; decodeTcx still reads walking files.
Add the optional pace target (stepper, 30 s current pace, band,
throttled cues, persisted). The idle map follows the user's fix; refused
location shows only the red icon, no map and no start.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWZ9CKZsNxtD5Jr9bYD
2026-11-10 18:47:53 +01:00

28 lines
859 B
Dart

/// A geolocator platform that answers from fields, for tests that build the
/// real run controller (and so the real position source) without a device.
library;
import 'package:geolocator/geolocator.dart';
/// Location on, permission granted, no positions.
class FakeGeolocator extends GeolocatorPlatform {
/// Whether the device's location switch is on.
bool serviceOn = true;
/// The permission [checkPermission] reports.
LocationPermission permission = LocationPermission.whileInUse;
@override
Future<bool> isLocationServiceEnabled() async => serviceOn;
@override
Future<LocationPermission> checkPermission() async => permission;
@override
Future<LocationPermission> requestPermission() async => permission;
@override
Stream<Position> getPositionStream({LocationSettings? locationSettings}) =>
const Stream.empty();
}