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:
@@ -2,6 +2,7 @@ import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'motion.dart';
|
||||
import 'surface_visibility.dart';
|
||||
|
||||
/// Keeps every child mounted while fading between two indexed pages.
|
||||
///
|
||||
@@ -155,19 +156,23 @@ class _FadeThroughStackState extends State<FadeThroughStack>
|
||||
offstage: !shown,
|
||||
child: TickerMode(
|
||||
enabled: active,
|
||||
child: IgnorePointer(
|
||||
ignoring: !active,
|
||||
child: ExcludeFocus(
|
||||
excluding: !active,
|
||||
child: ExcludeSemantics(
|
||||
child: SurfaceVisibility(
|
||||
shown: shown,
|
||||
current: active,
|
||||
child: IgnorePointer(
|
||||
ignoring: !active,
|
||||
child: ExcludeFocus(
|
||||
excluding: !active,
|
||||
child: Transform.scale(
|
||||
scale: scale,
|
||||
child: Opacity(
|
||||
opacity: opacity,
|
||||
child: !widget.lazy || _visited.contains(index)
|
||||
? widget.children[index]
|
||||
: const SizedBox.shrink(),
|
||||
child: ExcludeSemantics(
|
||||
excluding: !active,
|
||||
child: Transform.scale(
|
||||
scale: scale,
|
||||
child: Opacity(
|
||||
opacity: opacity,
|
||||
child: !widget.lazy || _visited.contains(index)
|
||||
? widget.children[index]
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user