PastebinClient class abstract

Dart API for connecting with Pastebin API. All methods are asynchronous so they return a Future and the results are instances of Either monad so that no errors are thrown.




hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


apiUserKey({required String username, required String password}) Future<Either<RequestError, String>>
Generates a new Pastebin API user key. This key is used to identify a Pastebin user and is required to retrieve pastes of a user, delete a user paste, retrieve the information and settings of a user or retrieve the raw paste of a user.
delete({required String pasteKey, required String userKey}) Future<Either<RequestError, void>>
Deletes a user paste.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
paste({required String pasteText, PasteOptions? options}) Future<Either<RequestError, Uri>>
Publishes a paste in Pastebin. By default only the text (pasteText) of the paste to publish is required, which means that the paste will not have a title, author or expiration date. These pastes are also public and in the text format.
pastes({required String userKey, int limit = 50}) Future<Either<RequestError, List<Paste>>>
Retrieves the pastes of a user as a List of Paste. By default the number of pastes to retrieve is limited to 50, but another values greater than 0 can be passed.
rawPaste({required String pasteKey, required Visibility visibility, String? userKey}) Future<Either<RequestError, String>>
Retrieves a UTF-8 string with the raw text of a paste. To retrieve a private or unlisted paste, userKey needs to be included with the user identifier and visibility set to Visibility.private or Visibility.unlisted.
toString() String
A string representation of this object.
userInfo({required String userKey}) Future<Either<RequestError, UserInfo>>
Retrieves information of a user identified by userKey.


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