collapse method
Collapses the expanded tile.
Implementation
Future<void> collapse() async {
_isExpanded = false;
widget.onCollapse?.call();
await _controller.reverse();
if (!mounted) return;
widget.onCollapsed?.call();
setState(() {
// Rebuild without widget.children.
});
PageStorage.of(context).writeState(context, _isExpanded);
}