Add explicit surface visibility signal
Provide composable shown/current visibility for retained surfaces and migrate visibility readers away from TickerMode. This keeps ticker muting separate from painted and current-surface state.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'elapsed_clock.dart';
|
||||
import '../motion/surface_visibility.dart';
|
||||
|
||||
/// Builds a running item's elapsed-time text from the [ElapsedClock], and
|
||||
/// rebuilds only itself as that duration advances.
|
||||
@@ -39,7 +40,7 @@ class _LiveElapsedBuilderState extends State<LiveElapsedBuilder> {
|
||||
_unwatch();
|
||||
_clock = clock;
|
||||
}
|
||||
_shown = TickerMode.valuesOf(context).enabled;
|
||||
_shown = SurfaceVisibility.shownOf(context);
|
||||
_sync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user