toggleText method

void toggleText()

change the state of _expanded to show/hide text

Implementation

void toggleText() {
  final toggledExpanded = !_expanded;
  setState(() => _expanded = toggledExpanded);
  widget.onExpandedChanged?.call(toggledExpanded);
}