lastChild<T extends Component> method

T? lastChild<T extends Component>()

Returns the last child that matches the given type T.

Implementation

T? lastChild<T extends Component>() {
  final it = children.reversed().whereType<T>().iterator;
  return it.moveNext() ? it.current : null;
}