setBouncing method

  1. @override
double setBouncing(
  1. double available,
  2. AppBarPosition appBar,
  3. NestedScrollPosition scroll
)
override

Updates the appbar during bouncing (overscroll) situations Returns any remaining scroll offset that was not consumed.

Implementation

@override
double setBouncing(
  double available,
  AppBarPosition appBar,
  NestedScrollPosition scroll,
) {
  if (bouncing && scroll.totalPixels + available <= 0) {
    appBar.lentPixels += available;
    return available;
  }

  return 0;
}