handleStatusBarTap method

  1. @override
void handleStatusBarTap()
override

Called when the user taps the status bar on iOS, to scroll a scroll view to the top.

This event should usually only be handled by at most one scroll view, so implementer(s) of this callback must coordinate to determine the most suitable scroll view for handling this event.

This callback is only called on iOS. The default implementation provided by WidgetsBindingObserver does nothing.

See also:

Implementation

@override
void handleStatusBarTap() {
  super.handleStatusBarTap();
  assert(widget.primary);
  final ScrollController? primaryScrollController = PrimaryScrollController.maybeOf(context);
  if (primaryScrollController != null && primaryScrollController.hasClients) {
    primaryScrollController.animateTo(
      0.0,
      duration: const Duration(milliseconds: 1000),
      curve: Curves.easeOutCirc,
    );
  }
}