lastChild<T extends Component> method

T? lastChild<T extends Component>()
inherited

Returns the last child that matches the given type T, or null if there are no such children.

Implementation

T? lastChild<T extends Component>() {
  return children.reversed().whereType<T>().firstOrNull;
}