mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 19:14:42 +08:00
use TickerMode.getValuesNotifier
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -448,7 +448,7 @@ class ContextSingleTicker implements TickerProvider {
|
||||
onTick,
|
||||
debugLabel: kDebugMode ? 'created by ${describeIdentity(this)}' : null,
|
||||
);
|
||||
_tickerModeNotifier = TickerMode.getNotifier(context)
|
||||
_tickerModeNotifier = TickerMode.getValuesNotifier(context)
|
||||
..addListener(updateTicker);
|
||||
updateTicker(); // Sets _ticker.mute correctly.
|
||||
return _ticker!;
|
||||
@@ -467,9 +467,15 @@ class ContextSingleTicker implements TickerProvider {
|
||||
_tickerModeNotifier = null;
|
||||
}
|
||||
|
||||
ValueListenable<bool>? _tickerModeNotifier;
|
||||
ValueListenable<TickerModeData>? _tickerModeNotifier;
|
||||
|
||||
void updateTicker() => _ticker?.muted = !_tickerModeNotifier!.value;
|
||||
void updateTicker() {
|
||||
final TickerModeData values = _tickerModeNotifier!.value;
|
||||
if (_ticker != null) {
|
||||
_ticker!.muted = !values.enabled;
|
||||
_ticker!.forceFrames = values.forceFrames;
|
||||
}
|
||||
}
|
||||
|
||||
set muted(bool value) => _ticker?.muted = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user