get<C extends Controller> static method

C get<C extends Controller>({
  1. String? id,
})

Implementation

static C get<C extends Controller>({String? id}) {
  if (id != null) {
    for (dynamic c in _controllers.values) {
      if (c.runtimeType.toString() == id) {
        return c;
      }
    }
  }

  for (dynamic c in _controllers.values) {
    if (c.runtimeType == C) {
      return c;
    }
  }

  dynamic c = BaseController();

  return c;
}