getAfterMiddleware<T> function
Runs the second middleware after the main
Example:
getAfterMiddleware(
sendSecureData,
clearSecurityData
);
Implementation
Middleware<T> getAfterMiddleware<T>(
Middleware<T> middleware,
Middleware<T> afterMiddleware,
// ignore: prefer_expression_function_bodies
) {
return (context, next) async {
final called = await wrapMiddlewareNextCall(context, middleware);
if (called) {
return afterMiddleware(context, next);
}
};
}