Response class

A response to the server.

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

Constructors

Response(String id, int requestTime, {RequestError? error, Map<String, Object?>? result})
Initialize a newly created instance to represent a response to a request with the given id. If result is provided, it will be used as the result; otherwise an empty result will be used. If an error is provided then the response will represent an error condition.
Response.fromJson(Map<String, Object?> json)
Initialize a newly created instance based on the given JSON data.
factory

Properties

error RequestError?
The error that was caused by attempting to handle the request, or null if there was no error.
final
hashCode int
The hash code for this object.
no setterinherited
id String
The unique identifier used to identify the request that this response is associated with.
final
requestTime int
The time at which the request was handled by the plugin.
final
result Map<String, Object?>?
A table mapping the names of result fields to their values. Should be null if there is no result to send.
getter/setter pair
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.
inherited

Constants

ERROR → const String
The name of the JSON attribute containing the error message.
ID → const String
The name of the JSON attribute containing the id of the request for which this is a response.
REQUEST_TIME → const String
The name of the JSON attribute containing the time at which the request was handled by the plugin.
RESULT → const String
The name of the JSON attribute containing the result values.