ApiHelper class

Constructors

ApiHelper({required Map<String, String> environments, String currentEnvironment = 'production', Map<String, String> defaultHeaders = const {'Content-Type' : 'application/json'}, Duration timeout = const Duration(seconds: 15)})

Properties

currentEnvironment String
getter/setter pair
defaultHeaders Map<String, String>
final
environments Map<String, String>
final
hashCode int
The hash code for this object.
no setterinherited
rootApi String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
final

Methods

addInterceptor(dynamic interceptor(Uri, Map<String, String>)) → void
deleteData(String endpoint) Future<bool>
editData(String endpoint, Map<String, dynamic> data) Future<Map<String, dynamic>>
fetchAllData(String endpoint) Future<List>
fetchDataWithQuery(String endpoint, Map<String, String> queryParams) Future<Map<String, dynamic>>
fetchPaginatedData(String endpoint, int limit, int offset) Future<List>
generateHierarchyMap(String endpoint) Future<String>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAuthToken(String token) → void
toString() String
A string representation of this object.
inherited

Operators

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