findOtherController<T extends FindXController> method

  1. @protected
T findOtherController<T extends FindXController>({
  1. String? id,
})

Implementation

@protected
T findOtherController<T extends FindXController>({String? id}) {
  var name = (id == null) ? T.toString() : T.toString() + id;

  if(_controllers == null)
    throw "Can't find controller $name from ${this.runtimeType} because ${this.runtimeType} is not allowed to find other controllers.";

  final controller = _controllers![name];

  if (controller == null)
    throw "Can't find controller $name, did you create it and put it in the tree?";

  return _controllers![name] as T;
}