resolveController method

T resolveController(
  1. void onDirty(
    1. Type type
    )
)

Implementation

T resolveController(void Function(Type type) onDirty) {
  final existing = _controller;
  if (existing != null) return existing;

  final created = _controllerBuilder?.call();
  if (created == null) {
    throw BindError(controller: T, tag: _bind.tag);
  }
  _controller = created;
  _subscribeToController(onDirty);
  if (_bind.global && (_isCreator || _bind.assignId)) {
    _ownedDependency = Sint.captureInstanceLifecycle<T>(tag: _bind.tag);
  }
  return created;
}