getContext

T? getContext<T>(

  1. Request req,
  2. String key
)

Gets a value from the request context.

Implementation

T? getContext<T>(Request req, String key) {
  final ctx = (req as JSObject)[_contextKey];
  if (ctx == null) return null;
  final value = (ctx as JSObject)[key];
  return value?.dartify() as T?;
}