animationProgress property

double animationProgress

The percentage of scrolling the user has done to complete the animation.

This assumes that the animation should start when the animated box reaches the top of the viewport and complete just before the animated box starts to scroll off the viewport.

This value is inaccurate if the Widget returned by SliverAnimatedBox.builder changes its extent in the scroll axis, in response to scrolling.

Implementation

double get animationProgress => previousBoxExtent == null
    ? 0
    : min(1, scrollOffset / (scrollExtent - previousBoxExtent!));