toggle method

Future<void> toggle({
  1. bool animated = true,
})

Toggles between expanded and collapsed states.

Implementation

Future<void> toggle({bool animated = true}) async {
  if (_isExpanded) {
    await collapse(animated: animated);
  } else {
    await expand(animated: animated);
  }
}