mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
use TickerMode.getValuesNotifier
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -87,7 +87,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
late final _tween = Matrix4Tween();
|
||||
late final _animatable = _tween.chain(CurveTween(curve: Curves.easeOut));
|
||||
|
||||
late final _horizontalDragGestureRecognizer;
|
||||
late final ImageHorizontalDragGestureRecognizer _horizontalDragGestureRecognizer;
|
||||
|
||||
late Offset _doubleTapLocalPosition;
|
||||
|
||||
|
||||
@@ -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