WebSocketsService<Id, Data> class Null safety

A Service that asynchronously interacts with the server.

Inheritance
Implementers

Constructors

WebSocketsService(WebSocketChannel? socket, BaseWebSocketClient app, String path, {AngelDeserializer<Data>? deserializer})

Properties

app BaseWebSocketClient
The BaseWebSocketClient that spawned this service.
final
deserializer AngelDeserializer<Data>?
Used to deserialize JSON into typed data.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
onAllEvents Stream<WebSocketEvent>
Fired on all events.
read-only
onCreated Stream<Data?>
Fired on created events.
read-only, override
onIndexed Stream<List<Data?>>
Fired on index events.
read-only, override
onModified Stream<Data?>
Fired on modified events.
read-only, override
onRead Stream<Data?>
Fired on read events.
read-only, override
onRemoved Stream<Data?>
Fired on removed events.
read-only, override
onUpdated Stream<Data?>
Fired on updated events.
read-only, override
path String
The service path to listen to.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
socket WebSocketChannel?
The WebSocketChannel to listen to, and send data across.
final

Methods

close() Future
override
create(Data? data, [Map<String, dynamic>? params]) Future<Data?>
Creates a resource.
override
deserialize(dynamic x) → Data?
Deserializes data from a WebSocketEvent.
index([Map<String, dynamic>? params]) Future<List<Data>?>
Retrieves all resources.
override
listen() → void
Starts listening for events.
map<U>(U encoder(Data?), Data? decoder(U)) Service<Id, U>
Creates a Service that wraps over this one, and maps input and output using two converter functions. [...]
inherited
modify(Id id, Data? data, [Map<String, dynamic>? params]) Future<Data?>
Modifies a resource.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
read(Id id, [Map<String, dynamic>? params]) Future<Data?>
Retrieves the desired resource.
override
remove(Id id, [Map<String, dynamic>? params]) Future<Data?>
Removes the given resource.
override
send(WebSocketAction action) → void
Sends the given action on the socket.
serialize(WebSocketAction action) → dynamic
Serializes an action to be sent over a WebSocket.
toString() String
A string representation of this object. [...]
inherited
transformEvent(WebSocketEvent event) WebSocketEvent<Data>
Deserializes the contents of an event.
unwrap() Service
No longer necessary.
update(Id id, Data? data, [Map<String, dynamic>? params]) Future<Data?>
Overwrites a resource.
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited