expand method

void expand()

Expands the ExpansionTile that was built with this controller;

Normally the tile is expanded automatically when the user taps on the header. It is sometimes useful to trigger the expansion programmatically due to external changes.

If the tile is already in the expanded state (see isExpanded), calling this method has no effect.

Calling this method may cause the ExpansionTile to rebuild, so it may not be called from a build method.

Calling this method will trigger an ExpansionTile.onExpansionChanged callback.

See also:

Implementation

void expand() {
  assert(_state != null);
  if (!isExpanded) {
    _state!._toggleExpansion();
  }
}