mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-21 21:42:18 +01:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZ9CKZsNxtD5Jr9bYD
29 lines
798 B
Dart
29 lines
798 B
Dart
/// A queue whose state the test sets by hand.
|
|
library;
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:workout_app/services/run_uploader.dart';
|
|
|
|
/// Stands in for [RunUploader] where a widget only reads its state.
|
|
class FakeRunUploader extends RunUploader {
|
|
/// Creates a fake queue at [initial].
|
|
FakeRunUploader([
|
|
RunUploadStatus initial = const RunUploadStatus(UploadHealth.idle, 0),
|
|
]) : state = ValueNotifier(initial);
|
|
|
|
/// The state the badge listens to; assign `.value` to change it.
|
|
final ValueNotifier<RunUploadStatus> state;
|
|
|
|
/// How many times a pass was requested.
|
|
int passes = 0;
|
|
|
|
@override
|
|
ValueListenable<RunUploadStatus> get status => state;
|
|
|
|
@override
|
|
Future<RunUploadStatus> uploadPending() async {
|
|
passes++;
|
|
return state.value;
|
|
}
|
|
}
|