runReflected method
Future
runReflected(
- Function handler,
- RequestContext req,
- ResponseContext res, [
- Container? container,
Runs with DI, and always reflects. Prefer runContained.
Implementation
Future runReflected(Function handler, RequestContext req, ResponseContext res,
[Container? container]) {
container ??=
req.container ?? res.app?.container ?? Container(EmptyReflector());
if (container.reflector is EmptyReflector) {
throw ArgumentError("No `reflector` passed");
}
var h = handleContained(
handler,
_preContained[handler] = preInject(handler, container.reflector),
container);
return Future.sync(() => h(req, res));
// return closureMirror.apply(args).reflectee;
}