TdlibNative class

Cheatset

Tdlib tg = Tdlib(
 pathTdl: "libtdjson.so",
 clientOption: {
  "api_id": 121315,
  "api_hash": "saskaspasad"
 },
);
tg.on("update", (UpdateTd update) async {
  print(update.raw);
});
tg.initIsolate();
Inheritance

Constructors

TdlibNative({TelegramClientLibraryTdlibOptionParameter? clientOption, Duration? delayInvoke, Duration? delayUpdate, EventEmitter? eventEmitter, String event_invoke = "invoke", String event_update = "update", Duration? invokeTimeOut, bool isAutoGetChat = false, bool isInvokeThrowOnError = true, FutureOr<String> on_generate_extra_invoke(int client_id, TdlibBase libTdJson)?, FutureOr<Map> on_get_invoke_data(String extra, int client_id, TdlibBase libTdJson)?, FutureOr<void> on_receive_update(dynamic update, TdlibBase libTdJson)?, String? pathTdl, int task_max_count = 10000, int task_min_cooldown = 10, double timeOutUpdate = 1.0})

Properties

client_option TelegramClientLibraryTdlibOptionParameter
finalinherited
clients Map<int, TdlibClient>
finalinherited
delay_invoke Duration
getter/setter pairinherited
delay_update Duration?
getter/setter pairinherited
event_emitter ↔ EventEmitter
latefinalinherited
event_invoke String
finalinherited
event_update String
finalinherited
first_client_id int
no setterinherited
getFormatLibrary String
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
invoke_time_out Duration
getter/setter pairinherited
is_auto_get_chat bool
getter/setter pairinherited
is_init_isolate bool
getter/setter pairinherited
is_invoke_throw_on_error bool
getter/setter pairinherited
isolate Isolate
getter/setter pairinherited
on_generate_extra_invoke FutureOr<String> Function(int client_id, TdlibBase libTdJson)?
getter/setter pairinherited
on_get_invoke_data FutureOr<Map> Function(String extra, int client_id, TdlibBase libTdJson)?
getter/setter pairinherited
on_receive_update FutureOr<void> Function(dynamic update, TdlibBase libTdJson)?
getter/setter pairinherited
path_tdlib String
getter/setter pairinherited
receivePort ReceivePort
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
task_count int
getter/setter pairinherited
task_max_count int
getter/setter pairinherited
task_min_cooldown int
getter/setter pairinherited
timeOutUpdate double
getter/setter pairinherited

Methods

createclient({required int clientId, int clientUserId = 0, TelegramClientLibraryTdlibOptionParameter? clientOption, bool isBot = false, bool isVoid = false, bool isAutoSetOptionIfEmpty = true}) Future<Map>
add this for multithread on flutter apps
inherited
ensureInitialized() Future<void>
inherited
existClientId(int clientId) bool
ahis for handle update api add this for handle update api
inherited
exitClientById(int clientId, {bool isClose = false, String? extra, bool isInvokeThrowOnError = true}) Future<bool>
inherited
getAllClientIds() List<int>
get all client id
inherited
getClientById(int clientId) TdlibClient?
inherited
getClientByUserId(int clientUserId) TdlibClient?
inherited
init() Future<void>
inherited
invoke(String method, {Map? parameters, required int clientId, Duration? functionTimeOut, bool isVoid = false, Duration? delayDuration, Duration? invokeTimeOut, bool? isUseCache = false, Duration? durationCacheExpire, String? extra, bool? isAutoGetChat, bool? isInvokeThrowOnError, FutureOr<String> onGenerateExtraInvoke(int client_id, TdlibBase libTdJson)?, FutureOr<Map> onGetInvokeData(String extra, int client_id, TdlibBase libTdJson)?}) Future<Map>
call api latest Tdlib-Methods example:
inherited
invokeRaw({required Map parameters, required int clientId, required bool isVoid, required Duration delayDuration, required Duration invokeTimeOut, required Duration functionTimeOut, required bool isUseCache, required Duration durationCacheExpire, required String extra, required bool isAutoGetChat, required bool isInvokeThrowOnError, required FutureOr<String> onGenerateExtraInvoke(int client_id, TdlibBase libTdJson)?, required FutureOr<Map> onGetInvokeData(String extra, int client_id, TdlibBase libTdJson)?}) Future<Map>
call api latest Tdlib-Methods example:
inherited
invokeSync({required Map parameters, bool isThrowOnError = true}) Map
call api latest Tdlib-Methods example:
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on(String type_update, FutureOr callback(UpdateTd update), {Map? stateData, void onError(Object data)?}) → EventEmitterListener
receive all update data
inherited
platformType() String
create client id for multi client
override
request(String method, {Map? parameters, required int clientId, bool isVoid = false, Duration? delayDuration, Duration? invokeTimeOut, String? extra, bool? isUseCache, Duration? durationCacheExpire, bool? isAutoGetChat, FutureOr<String> onGenerateExtraInvoke(int client_id, TdlibBase libTdJson)?, FutureOr<Map> onGetInvokeData(String extra, int client_id, TdlibBase libTdJson)?, bool? isInvokeThrowOnError}) Future<Map>
inherited
task_decrease() → void
inherited
task_increase() → void
inherited
td_create_client_id() int
Returns an opaque identifier of a new TDLib instance. The TDLib instance will not send updates until the first request is sent to it.
override
td_execute(Map parameters) Map<String, dynamic>
client_execute
override
td_send(int clientId, Map parameters) → void
td_send
override
toString() String
A string representation of this object.
inherited
updateClientById(int clientId, {required TdlibClient newTdlibClient, String? extra, bool isInvokeThrowOnError = true}) Future<bool>
inherited

Operators

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

Static Properties

is_open_tdlib bool
getter/setter pair
td_execute_native_function TdExecuteNative
latefinal
td_pointer_native_function TdCreateClientIdDart
latefinal
td_receive_function TdReceiveDart
latefinal
td_send_function TdSendDart
latefinal
tdLib DynamicLibrary
getter/setter pair

Static Methods

opentdLib({required String pathTdlib}) → void
override
td_receive_static({double timeout = 1.0}) Map<String, dynamic>?
fetch update
override