on<C extends Comp<T>> method

Comp<T> on<C extends Comp<T>>(
  1. void callback(
    1. C
    )
)
inherited

Invokes callback with the first top-level component matching type C, if one exists.

Implementation

E on<
  C extends Comp<T>
>(void Function(C) callback) {
  final a = get<C>();
  if (a == null) return self;
  callback(a);
  return self;
}