ApiHelper class

Properties

currentToken String?
Get current token
no setter
hashCode int
The hash code for this object.
no setterinherited
responseResolver Response Function(dynamic)?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addPath(ApiHelperPathItem item) → void
get(String key, {Map<String, dynamic>? query, String? token}) Future<Response>
getPathItem(String key) ApiHelperPathItem
init({required String baseUrl, String? token, List<ApiHelperPathItem>? paths, Response resolver(dynamic)?, int timeout = 30000}) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideDio(Dio dio) → void
Inject custom Dio (useful for mocking)
post(String key, {dynamic data, String? token, String? contentType}) Future<Response>
request(ApiHelperPathItem item, {String? token, String? contentType}) Future<Response>
setBaseUrl(String url) → void
Set global base URL
setToken(String? token) → void
Set global token
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance ApiHelper
final