Client class

The principal class for interacting with the Ruqqus API

Constructors

Client({required String clientId, required String clientSecret, required String refreshToken, String userAgent = 'Project utilizing ruqqus.dart', bool quietMode = false})
clientId - The ID of your approved application

Properties

accessToken String?
Stored token that allows the client to access Ruqqus' endpoints
getter/setter pair
api API
Handler for HTTP calls to the API, as well as specific endpoints
latefinal
hashCode int
The hash code for this object.
no setterinherited
isActive bool
Keeps track of whether the client had already previously obtained an access token for when it needs to be refreshed
getter/setter pair
log → Sprint
final
recurrentEvents Map<String, List<Function>>
Mapping of events to a list of event handlers
finalinherited
refreshData Map<String, String>
Data required for refreshing the access token every hour
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
singleEvents Map<String, List<Function>>
Mapping of events to a list of one-time event handlers
finalinherited

Methods

clearListeners() → void
This function attempt to remove all handlers from the event.
inherited
emit(String event, [List arguments = const []]) → void
This function triggers all the handlers currently listening to event and passes them data
inherited
listenForSubmissions<Submission extends Primary>({Duration listeningDelay = minimumReadInterval, List<String> accumulatedIds = const []}) Stream<Primary>
Begins listening for submissions at with a delay listeningDelay
login() Future
Ruqqus: "Access tokens expire one hour after they are issued. To maintain ongoing access, you will need to use the refresh token to obtain a new access token."
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on(String event, Function handler) → void
This function binds the handler as a listener to the event
inherited
once(String event, Function handler) → void
This function binds the handler as listener to the first occurrence of the event. When handler is called once, it is removed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

obtainAuthURL({required String clientId, required String redirectUri, String state = 'ruqqus', required List<String> scopes, required bool isPermanent}) String
Constructs an authentication link

Constants

minimumReadInterval → const Duration
Minimum interval between read requests
minimumWriteInterval → const Duration
Minimum interval between write requests