Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. bool _handleScrollNotification(ScrollNotification notification) {
  2. if (_didDragStart(notification)) {
  3. _dragOffset = 0;
  4. _pullToReachStarted = true;
  5. }
  6.  
  7. if (_didDragEnd(notification)) {
  8. _dragOffset = 0;
  9. _pullToReachStarted = false;
  10.  
  11. _notifySelectIfNeeded();
  12. }
  13.  
  14. if (_pullToReachStarted) {
  15. _shouldNotifyOnDragEnd = true;
  16. } else {
  17. return false;
  18. }
  19.  
  20. var progress = _calculateScrollProgress(notification);
  21. var index = indexCalculator.getIndexForScrollPercent(progress);
  22.  
  23. if (_itemIndex != index) {
  24. _itemIndex = index;
  25. PullToReachScope.of(context).setFocusIndex(_itemIndex);
  26. }
  27.  
  28. return false;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement