Service class

Constructors

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

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 receiving object from td json client (via receive stream loop, 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
encryptionKey String
Initial encryption_key for td function checkDatabaseEncryptionKey or new_encryption_key for setDatabaseEncryptionKey
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isRunning bool
no setter
maxExtra int
The maximun random value (0 ~ max) for td function @extra
getter/setter pair
newVerbosityLevel int
Initial new_verbosity_level for td function setLogVerbosityLevel
getter/setter pair
onReceiveError ↔ (void Function(Error)?)
The event fired after receiving Error (parsed from td json error object, {"@type": "error", ...})
getter/setter pair
onStreamError ↔ (void Function(dynamic)?)
dart Stream(onError) for recevie stream loop
getter/setter pair
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)
getter/setter pair

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
start() Future<void>
Start receiving messages from native td json client
stop() Future<void>
Stop receiving messages from native td json client, use this wisely
toString() String
A string representation of this object.
inherited

Operators

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