withValue<T> function

RequestMiddleware withValue<T>({
  1. String? key,
  2. T? value,
})

Implementation

RequestMiddleware withValue<T>({String? key, T? value}) {
  return (Request req) async {
    if (key == null || value == null) return req;
    req.context.trySet(key, value);
    return req;
  };
}