ApiManager class

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

convertOrderBy(Map<String, dynamic> input) Map<String, dynamic>
convertSearchBy(Map<String, dynamic> body) Map<String, dynamic>
getAuthBearerToken(BuildContext context) String?
getCurrentTenantId(BuildContext context) String?
initHeader(Map<String, dynamic> headers, dynamic needAuth, dynamic needTenant, BuildContext context) Future<Map<String, dynamic>>
makeApiCall({required String apiUrl, required BuildContext context, required ApiCallType callType, Map<String, dynamic> headers = const {}, Map<String, dynamic> params = const {}, String? body, BodyType? bodyType = BodyType.JSON, bool returnBody = true, bool encodeBodyUtf8 = false, bool decodeUtf8 = false, bool needAuth = false, bool needTenant = false, bool showSuccessMessage = false, bool showErrorMessage = true, String? successMessage, bool replaceApiUrl = false, String? completeApiUrl}) Future<ApiCallResponse>
makeApiCallWithConfig({required String apiUrl, required ApiCallType callType, BuildContext? context, Map<String, dynamic> headers = const {}, Map<String, dynamic> params = const {}, String? body, BodyType? bodyType = BodyType.JSON, bool returnBody = true, bool encodeBodyUtf8 = false, bool decodeUtf8 = false, bool needAuth = false, bool? needTenant, bool showSuccessMessage = false, bool showErrorMessage = true, String? successMessage, bool replaceApiUrl = false, String? completeApiUrl}) Future<ApiCallResponse>
Context-optional variant of makeApiCall.
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

apiVersion String
no setter
baseUrl String
no setter
config ApiConfig?
The currently bound ApiConfig, or null if the legacy configure method was used instead.
no setter
instance ApiManager
no setter

Static Methods

asQueryParams(Map<String, dynamic> map) String
configure({required String baseUrl, String apiVersion = ''}) → void
createBody(Map<String, dynamic> headers, Map<String, dynamic>? params, String? body, BodyType? bodyType, bool encodeBodyUtf8) → dynamic
fromConfig(ApiConfig config) ApiManager
Configures the singleton from a structured ApiConfig object.
multipartRequest(ApiCallType? type, String apiUrl, Map<String, dynamic> headers, Map<String, dynamic> params, bool returnBody, bool decodeUtf8) Future<ApiCallResponse>
requestWithBody(ApiCallType type, String apiUrl, Map<String, dynamic> headers, Map<String, dynamic> params, String? body, BodyType? bodyType, bool returnBody, bool encodeBodyUtf8, bool decodeUtf8) Future<ApiCallResponse>
toStringMap(Map map) Map<String, String>
urlRequest(ApiCallType callType, String apiUrl, Map<String, dynamic> headers, Map<String, dynamic> params, bool returnBody, bool decodeUtf8) Future<ApiCallResponse>