screen-locker/stronglift_replacement/workout_app/lib/services/run_notification.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

24 lines
852 B
Dart

/// The two lines of the ongoing run notification (numbers only, textgate).
library;
import 'package:workout_app/services/pace_band.dart';
import 'package:workout_app/services/run_format.dart';
/// Distance as the title; moving time and average pace as the body, plus the
/// current pace (to the nearest [kPaceStep], so GPS jitter does not redraw it
/// every fix) when a pace target is on.
({String title, String body}) runNotificationCopy({
required double metres,
required int movingSeconds,
double? currentPace,
}) {
final average = formatPace(seconds: movingSeconds, distanceM: metres);
final current = currentPace == null
? ''
: ' ${formatPaceSeconds((currentPace / kPaceStep).round() * kPaceStep)}';
return (
title: formatDistanceKm(metres),
body: '${formatDuration(movingSeconds)} $average$current',
);
}