Created
February 17, 2019 19:01
-
-
Save JulianBissekkou/b4aa93a69cf357c91505f26bdcb9cb2d 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
bool _handleScrollNotification(ScrollNotification notification) { | |
if (_didDragStart(notification)) { | |
_dragOffset = 0; | |
_pullToReachStarted = true; | |
} | |
if (_didDragEnd(notification)) { | |
_dragOffset = 0; | |
_pullToReachStarted = false; | |
_notifySelectIfNeeded(); | |
} | |
if (_pullToReachStarted) { | |
_shouldNotifyOnDragEnd = true; | |
} else { | |
return false; | |
} | |
var progress = _calculateScrollProgress(notification); | |
var index = indexCalculator.getIndexForScrollPercent(progress); | |
if (_itemIndex != index) { | |
_itemIndex = index; | |
PullToReachScope.of(context).setFocusIndex(_itemIndex); | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment