toggleFold method

void toggleFold()

Implementation

void toggleFold() {
  if (_isExpanded) {
    if (widget.skipAnimation == true) {
      _animationController.value = 0;
    } else {
      _animationController.reverse();
    }
  } else {
    if (widget.skipAnimation == true) {
      _animationController.value = 1;
    } else {
      _animationController.forward();
    }
  }
  _isExpanded = !_isExpanded;
}