openHeaderSecondary method

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

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

Implementation

Future openHeaderSecondary({
  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.modeLocked ||
        headerNotifier.noMoreLocked ||
        headerNotifier.secondaryLocked ||
        !headerNotifier._canProcess) {
      return;
    }
    await headerNotifier.animateToOffset(
      offset: headerNotifier.secondaryDimension,
      mode: IndicatorMode.secondaryOpen,
      duration: duration,
      curve: curve,
      scrollController: scrollController ?? _state?.widget.scrollController,
    );
  }
}