enableInjection method

TrackedSubject<T, S> enableInjection({
  1. required T? parse(
    1. String raw
    ),
})

Allows the DevTools panel to push values into the wrapped subject.

parse converts the raw text from the panel's input into the subject's value type; returning null causes the panel to surface a parse error without changing the subject. No-op in release builds.

Implementation

TrackedSubject<T, S> enableInjection({
  required T? Function(String raw) parse,
}) {
  final id = identifier;
  if (id == null) return this;

  getIt.get<RegistryService>().enableInjection<T>(_subject, parse, id);
  return this;
}