Request class

A request that was received from the client.

Clients may not extend, implement or mix-in this class.

Constructors

Request(String id, String method, [Map<String, Object?>? params, int? clientRequestTime])
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.

Properties

clientRequestTime int?
The time (milliseconds since epoch) at which the client made the request or null if this information is not provided by the client.
final
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

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 client to represent this response.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(Map<String, Object?> result) Request?
Return a request parsed from the given json, or null if the data is not a valid json representation of a request. The data is expected to have the following format:
fromString(String data) Request?
Return a request parsed from the given data, or null if the data is not a valid json representation of a request. The data is expected to have the following format:

Constants

CLIENT_REQUEST_TIME → const String
The name of the optional JSON attribute indicating the time (milliseconds since epoch) at which the client made the request.
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.