Api class

Constructors

Api()

Properties

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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

baseUrl → dynamic
no setter
expireDate DateTime?
Return Authorization token
no setter
isTokenExpire bool
Check token for expire
no setter
refreshToken String?
Return refresh token
no setter
token String?
Return Authorization token
no setter

Static Methods

clearRefreshToken() → void
Clear Token
clearToken() → void
Clear Token
dataFromStorage(String path) String
Help to get url to resource in server storage
delete({required String method, bool isAuth = false, bool testMode = false, Map<String, dynamic>? query}) Future<Map<String, dynamic>>
Sends an HTTP DELETE request.
get({required String method, bool isAuth = false, bool testMode = false, Map<String, dynamic>? query}) Future<Map<String, dynamic>>
Sends an HTTP GET request.
init({required String baseUrl, bool globalTestMode = false, bool bearerToken = true, dynamic disableAllTestMode = false, bool enableUtf8Decoding = false, bool loadTokenFromMemory = true, String? authTitle, String? storageUrl}) Future<void>
Initialization API class
patch({required String method, bool isAuth = false, bool testMode = false, required Map<String, dynamic> body}) Future<Map<String, dynamic>>
Sends an HTTP PATCH request.
post({required String method, bool isAuth = false, bool testMode = false, required Map<String, dynamic> body}) Future<Map<String, dynamic>>
Sends an HTTP POST request.
put({required String method, bool isAuth = false, bool testMode = false, required Map<String, dynamic> body}) Future<Map<String, dynamic>>
Sends an HTTP PUT request.
rawDelete({required String url, Map<String, String> headers = const {"Content-type" : 'application/json'}, bool testMode = false, Map<String, dynamic>? query}) Future<Map<String, dynamic>>
Sends an HTTP DELETE request.
rawGet({required String url, Map<String, String> headers = const {"Content-type" : 'application/json'}, bool testMode = false, Map<String, dynamic>? query}) Future<Map<String, dynamic>>
Sends an HTTP GET request.
rawPatch({required String url, Map<String, String> headers = const {"Content-type" : 'application/json'}, bool testMode = false, required Map<String, dynamic> body}) Future<Map<String, dynamic>>
Sends an HTTP PUT request.
rawPost({required String url, Map<String, String> headers = const {"Content-type" : 'application/json'}, bool testMode = false, required Object body}) Future<Map<String, dynamic>>
Sends an HTTP POST request.
rawPut({required String url, Map<String, String> headers = const {"Content-type" : 'application/json'}, bool testMode = false, required Map<String, dynamic> body}) Future<Map<String, dynamic>>
Sends an HTTP PUT request.
refreshTokenIsEmpty() bool
Checks token storage for emptiness
refreshTokenIsNotEmpty() bool
Checks token storage for emptiness
setExpire({required int seconds}) → void
Set refresh token expire in seconds. Fro check you can use Api.isRefreshTokenExpire
setHeaders(Map<String, String> headers) → void
Set headers. Default is only "Content-type": application/json
setRefreshToken(String token) → void
Set refresh token
setToken(String token) → void
Set Authorization token
tokenIsEmpty() bool
Checks token storage for emptiness
tokenIsNotEmpty() bool
Checks token storage for emptiness