TdClient class final
One TDLib client (one account / database directory).
Properties
-
The last authorization state TDLib reported, if any.
no setter
-
The current authorization state (if TDLib reported one yet), then every
change. Safe to subscribe late, e.g. from a widget's
initState.no setter -
done
→ Future<
void> -
Completes when this client is closed.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
TDLib client identifier.
final
- isClosed → bool
-
Whether TDLib reported
authorizationStateClosedfor this client.no setter - runtime → TdRuntime
-
The runtime this client belongs to.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
updates
→ Stream<
TdObject> -
Every update for this client, in TDLib's order. (Responses to
invoke and send go to their requests, not here.)
no setter
Methods
-
close(
{Duration timeout = const Duration(seconds: 15)}) → Future< void> -
Asks TDLib to close this client and waits up to
timeoutforauthorizationStateClosed. The client can't be used afterwards; its database stays on disk. -
invoke<
R extends TdObject> (TdFunction< R> request, {Duration? timeout}) → Future<R> -
Sends
requestand completes with TDLib's typed response. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on<
T extends TdObject> () → Stream< T> -
Updates of type
Tonly, e.g.client.on<UpdateNewMessage>(). -
send(
TdFunction< TdObject> request) → void -
Sends
requestwithout waiting for its response (which is dropped). -
setNetworkType(
NetworkType type) → Future< void> - Tells TDLib the current network type, prompting it to reconnect.
-
setOnline(
bool online) → Future< void> -
Sets TDLib's
onlineoption. Set it true while the app is visible and false in the background; TDLib does less work for offline clients. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited