Service class

Inheritance

Constructors

Service({String? dir, String? file, double timeout = 10, int maxExtra = 10000000, int? newVerbosityLevel, required Map<String, dynamic> tdlibParameters, void onStreamError(dynamic)?, void onReceive(String)?, void onReceiveError(Error)?, void afterReceive(Map<String, dynamic>)?, void beforeSend(Map<String, dynamic>)?, void beforeExecute(Map<String, dynamic>)?, void afterExecute(Map<String, dynamic>)?, dynamic start = true})

Properties

afterExecute ↔ void Function(Map<String, dynamic>)?
The event fired after receiving result object from td json client (via function execute)
getter/setter pair
afterReceive ↔ void Function(Map<String, dynamic>)?
The event fired after service handling receiving td object, including td error object
getter/setter pair
beforeExecute ↔ void Function(Map<String, dynamic>)?
The event fired before sending object to td json client (via function execute)
getter/setter pair
beforeSend ↔ void Function(Map<String, dynamic>)?
The event fired before sending object to td json client (via function send, sendSync)
getter/setter pair
dir String?
finalinherited
file String?
finalinherited
hashCode int
The hash code for this object.
no setterinherited
isRunning bool
no setterinherited
maxExtra int
The maximum random value (0 ~ maxExtra) for td function @extra
getter/setter pair
newVerbosityLevel int?
Initial new_verbosity_level for td function setLogVerbosityLevel
getter/setter pairinherited
onReceive ↔ void Function(String)?
The event fired after service handling receiving raw string result from td json client (via receive stream loop)
getter/setter pairinherited
onReceiveError ↔ void Function(Error)?
The event fired after receiving Error, the error parsed from td json raw string result: {"@type": "error", ...}
getter/setter pair
onStreamError ↔ void Function(dynamic)?
dart Stream(onError) for receive stream loop
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tdlibParameters Map<String, dynamic>
Initial tdlibParameters for td function setTdlibParameters
getter/setter pair
timeout double
Timeout (second) for event loop of receive stream. (td receive), it only works when calling the start fn
getter/setter pairinherited

Methods

execute(Map<String, dynamic> obj) Future<Map<String, dynamic>>
Synchronously execute td function Handled by native td execute function
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(Map<String, dynamic> obj) Future
Asynchronously send td function
sendSync(Map<String, dynamic> obj) Future<Map<String, dynamic>>
Synchronously send td function (it will wait until get the result) This is handled by dart side service, not by native td execute function Because td client doesn't allow some functions executing synchronously
setLogMessageCallback(int max_verbosity_level, NativeCallable<td_log_message_callback> callback) → void
start() Future<void>
Start receiving messages from native td json client
inherited
stop() Future<void>
Stop receiving messages from native td json client, use this wisely
inherited
toString() String
A string representation of this object.
inherited

Operators

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