Request class
A request that was received from the server.
Clients may not extend, implement or mix-in this class.
Constructors
-
Request(String id, String method, [Map<
String, Object?> ? params, int? serverRequestTime]) -
Initialize a newly created Request to have the given id and method
name. If
params
is supplied, it is used as the "params" map for the request. Otherwise an empty "params" map is allocated. -
Request.fromJson(Map<
String, Object?> result) -
Return a request parsed from the given json, or
null
if thedata
is not a valid json representation of a request. Thedata
is expected to have the following format:factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
The unique identifier used to identify this request.
final
- method → String
-
The method being requested.
final
-
params
→ Map<
String, Object?> -
A table mapping the names of request parameters to their values.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverRequestTime → int?
-
The time (milliseconds since epoch) at which the server made the request,
or
null
if this information is not provided by the server.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object> - Return a table representing the structure of the Json object that will be sent to the server to represent this response.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- ID → const String
- The name of the JSON attribute containing the id of the request.
- METHOD → const String
- The name of the JSON attribute containing the name of the request.
- PARAMS → const String
- The name of the JSON attribute containing the request parameters.
- SERVER_REQUEST_TIME → const String
- The name of the optional JSON attribute indicating the time (milliseconds since epoch) at which the server made the request.