getForkMiddleware<T> function
Runs the middleware at the next event loop and force call next()
Example:
getForkMiddleware((context) {
statisticsMiddlewares(context);
});
Implementation
// ignore: prefer_expression_function_bodies
Middleware<T> getForkMiddleware<T>(Middleware<T> middleware) {
return (context, next) async {
await Future<dynamic>.sync(() => middleware(context, noopNext));
return next();
};
}