updateExpanded method
Adopts the host's controlled value; null hands control back and keeps the last controlled value.
Implementation
void updateExpanded(bool? expanded) {
final before = this.expanded;
final controlled = _controlled;
if (controlled != null && expanded == null) _uncontrolled = controlled;
_controlled = expanded;
if (this.expanded != before) notifyListeners();
}