Last active
May 7, 2020 04:39
-
-
Save JulianBissekkou/8df81cf7f792c1c0aeca2864af4b6f46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double _calculateScrollProgress(ScrollNotification notification) { | |
var containerExtent = notification.metrics.viewportDimension; | |
if (notification is ScrollUpdateNotification) { | |
_dragOffset -= notification.scrollDelta; | |
} | |
if (notification is OverscrollNotification) { | |
_dragOffset -= notification.overscroll; | |
} | |
var percent = _dragOffset / (containerExtent * widget.dragExtentPercentage); | |
return percent.clamp(0.0, 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment