Mtproto class
Cheatset
Mtproto tg = Mtproto(
pathTdl: "Mtproto.so",
clientOption: {
"api_id": 121315,
"api_hash": "saskaspasad"
},
);
tg.on("update", (UpdateMt update) async {
print(update.raw);
});
tg.initIsolate();
Constructors
-
Mtproto({String? pathTdl, Map? clientOption, bool is_cli = false, String event_invoke = "invoke", String event_update = "update", EventEmitter? eventEmitter, Duration? delayUpdate, double timeOutUpdate = 1.0, Duration? delayInvoke, Duration? invokeTimeOut, bool isAutoGetChat = false, FutureOr<
String> on_generate_extra_invoke(int client_id, Mtproto Mtproto)?, FutureOr<Map> on_get_invoke_data(String extra, int client_id, Mtproto Mtproto)?, FutureOr<void> on_receive_update(dynamic update, Mtproto Mtproto)?})
Properties
- client_id ↔ int
-
getter/setter pair
- client_option ↔ Map
-
getter/setter pair
-
clients
↔ List<
MtprotoClient> -
getter/setter pair
- delay_invoke ↔ Duration
-
getter/setter pair
- delay_update ↔ Duration
-
getter/setter pair
- event_emitter ↔ EventEmitter
-
getter/setter pair
- event_invoke ↔ String
-
getter/setter pair
- event_update ↔ String
-
getter/setter pair
- getFormatLibrary → String
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- invoke_time_out ↔ Duration
-
getter/setter pair
- is_android ↔ bool
-
getter/setter pair
- is_auto_get_chat ↔ bool
-
getter/setter pair
- is_cli ↔ bool
-
getter/setter pair
-
on_generate_extra_invoke
↔ FutureOr<
String> Function(int client_id, Mtproto Mtproto)? -
getter/setter pair
-
on_get_invoke_data
↔ FutureOr<
Map> Function(String extra, int client_id, Mtproto Mtproto)? -
getter/setter pair
-
on_receive_update
↔ FutureOr<
void> Function(dynamic update, Mtproto Mtproto)? -
getter/setter pair
- path_tdlib ↔ String
-
getter/setter pair
- receivePort ↔ ReceivePort
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tdLib → dynamic
-
no setter
- timeOutUpdate ↔ double
-
getter/setter pair
Methods
-
client_create(
) → int - create client id for multi client
-
client_destroy(
int clientId) → void - client_destroy
-
client_execute(
int clientId, [Map? parameters]) → Map< String, dynamic> - client_execute
-
client_id_addres(
int clientId) → dynamic -
client_receive(
int clientId, [double timeout = 1.0]) → Map< String, dynamic> ? - fetch update
-
client_send(
int clientId, [Map? parameters]) → void - client_send
-
existClientId(
int clientId) → bool - ahis for handle update api add this for handle update api
-
exitClientById(
int clientId, {bool isClose = false, String? extra}) → Future< bool> -
getAllClientIds(
) → List< int> - get all client id
-
getClientById(
int clientId) → MtprotoClient? -
getClientByUserId(
int clientUserId) → MtprotoClient? -
init(
) → Future< void> -
initIsolate(
{required int clientId, int clientUserId = 0, Map? clientOption}) → Future< void> - add this for multithread on flutter apps
-
initIsolateNewClient(
{required int clientId, required Map clientOption, int clientUserId = 0}) → Future< void> - add this for multithread new client on flutter apps
-
invoke(
String method, {Map< String, dynamic> ? parameters, required int clientId, bool isVoid = false, Duration? delayDuration, Duration? invokeTimeOut, String? extra, bool? iSAutoGetChat, FutureOr<String> onGenerateExtraInvoke(int client_id, Mtproto Mtproto)?, FutureOr<Map> onGetInvokeData(String extra, int client_id, Mtproto Mtproto)?, bool isThrowOnError = true}) → Future<Map> - call api latest Tdlib-Methods example:
-
invokeSync(
String method, {Map< String, dynamic> ? parameters, required int clientId, bool isThrowOnError = true}) → Map - call api latest Tdlib-Methods example:
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on(
String type_update, FutureOr callback(UpdateMt update), {void onError(Object data)?}) → EventEmitterListener - receive all update data
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited