get<B extends Object> method

B get<B extends Object>([
  1. Bind<B>? bind
])

Implementation

B get<B extends Object>([Bind<B>? bind]) {
  if (bind == null) {
    return Modular.get<B>(typesInRequestList: typesInRequest);
  } else {
    final candidateId = overrideBinds?.indexWhere(
            (element) => element.runtimeType == bind.runtimeType) ??
        -1;
    if (candidateId == -1) {
      return bind.inject(this);
    } else {
      return overrideBinds![candidateId].inject(this) as B;
    }
  }
}