MessageBusFrontend class

Mixed in types

Constructors

MessageBusFrontend()

Properties

backendSendPort SendPort
no setterinherited
errorsHandlers Map<MessageBusEvent, ErrorHandler>
Functions (handlers), which will executed, when error was thrown in backend after sending corresponding message with eventId from frontend each handler can have a one dynamic argument - then in that handlers will pass a error
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tasks Map<MessageBusEvent, Function>
Functions (tasks), which will executed by frontend on accordingly to events from backend
no setteroverride

Methods

addIsolateSendPort(Packet2<String, SendPort> packet) → void
getMessageBusSendPort() SendPort
init() Future<void>
initBackend<TDataType>(Creator<TDataType> creator, {required Type backendType, TDataType? data, ErrorHandler? errorHandler, String uniqueId = '', bool isMessageBus = false}) Future<void>
Method for creating backend of this frontend state
inherited
killBackend() → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onBackendResponse() → void
Hook on every data, passed from backend to frontend
inherited
onError(dynamic error) Future<void>
Hook on every error
inherited
onEvent(MessageBusEvent event, Function func) → void
Method for creating disposable, single-use subscriptions
inherited
removeIsolateSendPort(String isolateId) → void
runBackendMethod<TVal extends Object, TResponse extends Object>(MessageBusEvent eventId, [TVal? value]) Future<TResponse>
Method for sending event with any data to backend
inherited
send(MessageBusEvent eventId, [Object? value]) → void
Method for sending event with any data to backend
inherited
toString() String
A string representation of this object.
inherited

Operators

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