FlowinFadePage constructor
- required Listenable listenable,
- required ValueGetter<
double> positionOf, - required int index,
- required Widget child,
- Key? key,
Cross-fades one page in place against a scrolling position.
The scroller still owns the motion — listenable drives rebuilds and positionOf reports the continuous page position — but the page counter-translates by exactly its slide offset, so it holds still and only its opacity follows. A page mid-fade ignores pointers, since the counter-translation overlaps it with its neighbour.
Works with any position-carrying scroller: a PageView page passes its
PageController as listenable and reads controller.page in
positionOf; a TabBarView page passes the TabController's animation
and reads its value. The slide offset to cancel is the width the page is
laid out at, which both lay out at viewport width, so it is measured here
with a LayoutBuilder rather than asked of the controller.
Implementation
const FlowinFadePage({
required this.listenable,
required this.positionOf,
required this.index,
required this.child,
super.key,
});