close method

Future<void> close()

Close the expansion panel with enhanced animations and haptic feedback

Implementation

Future<void> close() async {
  // Provide haptic feedback when closing
  if (widget.hapticFeedback && widget.adaptiveInteraction) {
    HapticFeedback.selectionClick();
  }

  // Animate glass effects out
  _glassAnimationController.reverse();

  setState(() {
    _height = 0.0;
  });

  return Future<void>.delayed(widget.duration, () {
    if (mounted) {
      Navigator.of(context).pop();
    }
  });
}