closeHeaderSecondary method

Future closeHeaderSecondary({
  1. Duration? duration = const Duration(milliseconds: 200),
  2. Curve curve = Curves.linear,
  3. ScrollController? scrollController,
})

Close header secondary. duration See ScrollPosition.animateTo. curve See ScrollPosition.animateTo. scrollController When position is not ScrollPosition, you can use ScrollController.

Implementation

Future closeHeaderSecondary({
  Duration? duration = const Duration(milliseconds: 200),
  Curve curve = Curves.linear,
  ScrollController? scrollController,
}) async {
  if (_state == null) {
    return;
  }
  if (_state!._header.secondaryTriggerOffset != null) {
    final headerNotifier = _state!._headerNotifier;
    if (headerNotifier.mode != IndicatorMode.secondaryOpen) {
      return;
    }
    await headerNotifier.animateToOffset(
      offset: 0,
      mode: IndicatorMode.inactive,
      jumpToEdge: false,
      duration: duration,
      curve: curve,
      scrollController: scrollController ?? _state?.widget.scrollController,
    );
  }
}