mirror of
https://github.com/Myzel394/quid_faciam_hodie.git
synced 2025-06-19 23:55:26 +02:00
36 lines
774 B
Dart
36 lines
774 B
Dart
import 'package:property_change_notifier/property_change_notifier.dart';
|
|
|
|
enum TimelineState {
|
|
loading,
|
|
paused,
|
|
playing,
|
|
completed,
|
|
}
|
|
|
|
class TimelineOverlay extends PropertyChangeNotifier<String> {
|
|
bool _showOverlay = true;
|
|
TimelineState _state = TimelineState.loading;
|
|
|
|
bool get showOverlay => _showOverlay;
|
|
TimelineState get state => _state;
|
|
|
|
void hideOverlay() => setShowOverlay(false);
|
|
void restoreOverlay() => setShowOverlay(true);
|
|
|
|
void setShowOverlay(bool showOverlay) {
|
|
_showOverlay = showOverlay;
|
|
notifyListeners('showOverlay');
|
|
}
|
|
|
|
void setState(TimelineState state) {
|
|
_state = state;
|
|
notifyListeners('state');
|
|
}
|
|
|
|
void reset() {
|
|
_showOverlay = true;
|
|
_state = TimelineState.loading;
|
|
notifyListeners();
|
|
}
|
|
}
|