Skip to content

Instantly share code, notes, and snippets.

@JulianBissekkou
Last active February 17, 2019 19:31
Show Gist options
  • Save JulianBissekkou/f6b0bf5391cb5716616ba55cf22a5132 to your computer and use it in GitHub Desktop.
Save JulianBissekkou/f6b0bf5391cb5716616ba55cf22a5132 to your computer and use it in GitHub Desktop.
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