onDetach property

ScrollControllerCallback? onDetach
final

Called when a ScrollPosition is detached from the scroll controller.

This sample shows how to apply a listener to the ScrollPosition.isScrollingNotifier using ScrollController.onAttach & ScrollController.onDetach. This is used to change the AppBar's color when scrolling is occurring.
link

To create a local project with this code sample, run:
flutter create --sample=widgets.ScrollController.onDetach.1 mysample

Implementation

final ScrollControllerCallback? onDetach;