Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement