Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

UserScrollNotification in flutter

NotificationListener<ScrollNotification>(
  onNotification: (ScrollNotification notification) {
    if (notification is UserScrollNotification) {
      if (notification.direction == ScrollDirection.forward) {
        // Handle scroll down.
      } else if (notification.direction == ScrollDirection.reverse) {
        // Handle scroll up.
      }
    }

    // Returning null (or false) to
    // "allow the notification to continue to be dispatched to further ancestors".
    return null;
  },
  child: ListView(..), // Or whatever scroll view you use.
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #UserScrollNotification #flutter
ADD COMMENT
Topic
Name
3+5 =