mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-19 06:04:22 +01:00
Give enum-only run files covered members
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZ9CKZsNxtD5Jr9bYD
This commit is contained in:
parent
0ec8cfddec
commit
2998bd5353
@ -16,7 +16,10 @@ enum RunServiceState {
|
||||
failed,
|
||||
|
||||
/// This platform has no foreground services (Linux desktop, tests).
|
||||
unsupported,
|
||||
unsupported;
|
||||
|
||||
/// True while a service is up, notification shown or not.
|
||||
bool get isUp => this == running || this == runningHidden;
|
||||
}
|
||||
|
||||
/// Starting, feeding and stopping the recording's foreground service.
|
||||
|
||||
@ -54,8 +54,7 @@ class RunController extends ChangeNotifier {
|
||||
bool get saving => _saving;
|
||||
|
||||
/// True from start to finish: the screen must not be left meanwhile.
|
||||
bool get active =>
|
||||
recorder.phase == RunPhase.recording || recorder.phase == RunPhase.paused;
|
||||
bool get active => recorder.phase.isActive;
|
||||
|
||||
/// Asks for access, starts the service, begins recording.
|
||||
Future<void> start() async {
|
||||
@ -129,10 +128,7 @@ class RunController extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> _stopService() async {
|
||||
if (_serviceState != RunServiceState.running &&
|
||||
_serviceState != RunServiceState.runningHidden) {
|
||||
return;
|
||||
}
|
||||
if (!_serviceState.isUp) return;
|
||||
await _service.stop();
|
||||
_serviceState = RunServiceState.none;
|
||||
notifyListeners();
|
||||
|
||||
@ -13,7 +13,10 @@ enum RunPhase {
|
||||
paused,
|
||||
|
||||
/// Over; [RunRecorder.finish] has returned the track.
|
||||
finished,
|
||||
finished;
|
||||
|
||||
/// True from start to finish: recording or paused.
|
||||
bool get isActive => this == recording || this == paused;
|
||||
}
|
||||
|
||||
/// What is wrong with the recording right now (shown as an icon, logged).
|
||||
|
||||
@ -117,7 +117,7 @@ class RunRecorder extends ChangeNotifier {
|
||||
/// Ends the recording and returns the track, or null when there were too
|
||||
/// few usable fixes (then [issue] is [RunIssue.tooShort]).
|
||||
Future<RunTrack?> finish() async {
|
||||
if (_phase != RunPhase.recording && _phase != RunPhase.paused) return null;
|
||||
if (!_phase.isActive) return null;
|
||||
await _sub?.cancel();
|
||||
_sub = null;
|
||||
_phase = RunPhase.finished;
|
||||
@ -217,7 +217,7 @@ class RunRecorder extends ChangeNotifier {
|
||||
}
|
||||
|
||||
void _onDone() {
|
||||
if (_phase != RunPhase.recording && _phase != RunPhase.paused) return;
|
||||
if (!_phase.isActive) return;
|
||||
log(
|
||||
'RunRecorder: the location stream ended while still recording; '
|
||||
'finish the run to save what was captured.',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user