collapse method

Future<Null> collapse()

Bring the panel to PanelState.collapsed, if this is not a Two-state panel.

Returned future is completed when the panel is collapsed.

(Animates to PanelSize.collapsedHeight).

Implementation

Future<Null> collapse() async => controlling
    ? panel!._metadata.isTwoStatePanel
        ? null
        : _setPanelPosition(panel!,
            duration: currentState == PanelState.closed
                ? _durationCollapsed
                : currentState == PanelState.expanded
                    ? _durationExpanded
                    : _getDuration(
                        from: currentPosition,
                        to: panel!._metadata.collapsedHeight),
            to: panel!._metadata.collapsedHeight)
    : Future.error('Missing Controller');