Last active
February 17, 2019 19:31
-
-
Save JulianBissekkou/f6b0bf5391cb5716616ba55cf22a5132 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 _didDragEnd(ScrollNotification notification) { | |
// Whenever dragDetails are null the scrolling happends without the users input | |
// meaning that the user release the finger --> drag has ended. | |
// For Cupertino Scrollables the ScrollEndNotification can not be used | |
// since it will be send after the list scroll has completely ended and | |
// the list is in its initial state | |
if (notification is ScrollUpdateNotification && | |
notification.dragDetails == null) { | |
return true; | |
} | |
// For Material Scrollables we can simply use the ScrollEndNotification | |
if (notification is ScrollEndNotification) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment