RequestScope class
Per-request state container that lives in the current Zone.
Constructors
- RequestScope(HttpRequest request)
Properties
- abandoned ↔ bool
-
Set once the request has been answered without its handler — by
REQUEST_TIMEOUT. The handler cannot be stopped, but whatever it goes on to write or save is dropped: the client has its answer.getter/setter pair -
attributes
→ Map<
Object, Object?> -
Open bag for extension packages that need per-request state without
core having to know about them.
final
- csrfToken ↔ String
-
CSRF token currently attached to this session, if any.
getter/setter pair
- currentRoute ↔ String
-
Route-history state used by
Response.back().getter/setter pair -
flashSessions
→ Map<
String, dynamic> -
Flash messages set via
Response.back(key, msg)orsession().final -
formData
→ Map<
String, dynamic> -
Old-input map used for form repopulation. Written by the request
handler right after body extraction.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- previousRoute ↔ String
-
getter/setter pair
- request → HttpRequest
-
final
- responding ↔ bool
-
Set when the handler starts writing its response. From then on
REQUEST_TIMEOUTleaves the request alone: it limits how long the app takes to answer, not how long a stream or a download runs.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sessionData
↔ Map<
String, dynamic> -
Session snapshot for the current request. Populated by
SessionManager.sessionStartand read by the session helpers.getter/setter pair -
sessionErrors
→ Map<
String, dynamic> -
Flash-style validation errors surfaced by the current request's
validators; consumed by the view engine when rendering.
final
- sessionId ↔ String?
-
Session id resolved from the request cookie. Cached so we don't
re-scan
request.cookieson every session helper call.getter/setter pair - sessionLoaded ↔ bool
-
Whether sessionData has been read from the session store.
getter/setter pair
Methods
-
beforeResponse(
Future< void> task()) → void -
Registers
taskto finish before this request's response is written. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
runBeforeResponse(
) → Future< void> ? - Runs the tasks registered with beforeResponse, each once.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited