TwitterClient class

The default implementation for AbstractTwitterClient.

Requests throw a TimeoutException when a request hasn't returned a response for some time determined by defaultTimeout.

If the received Response.statusCode is not a success (2xx), it is returned as a Future.error. To handle these responses, catch the error and check for the type to be a Response.

Inheritance

Constructors

TwitterClient({required String consumerKey, required String consumerSecret, required String token, required String secret, Duration defaultTimeout = _kDefaultTimeout})

Properties

consumerKey ↔ String
getter/setter pair
consumerSecret ↔ String
getter/setter pair
defaultTimeout → Duration
The time it takes for a request to time out and throw a TimeoutException.
final
hashCode → int
The hash code for this object.
no setterinherited
oauthClient → Client
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secret ↔ String
getter/setter pair
token ↔ String
getter/setter pair

Methods

get(Uri uri, {Map<String, String>? headers, Duration? timeout}) → Future<Response>
override
multipartRequest(Uri uri, {List<MultipartFile>? files, Map<String, String>? headers, String method = 'POST', Duration? timeout}) → Future<Response>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(Uri uri, {Map<String, String>? headers, dynamic body, Encoding? encoding, Duration? timeout}) → Future<Response>
override
toString() → String
A string representation of this object.
inherited

Operators

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