component<T> method

T? component<T>(
  1. String name
)

Find a component of a specific type with a specific name.

Implementation

T? component<T>(String name) {
  for (final component in _components) {
    if (component is T && component.name == name) {
      return component as T;
    }
  }
  return null;
}