ApiRegistryConfig class

Constructors

ApiRegistryConfig({required String baseUrl, String? statusCodeKey, List statusValues = const [], String? errorMessageKey, dynamic failureParser(Map<String, dynamic> json)?, dynamic unauthorizedFn(BuildContext context)?, Client? client, bool showErrorToast = true, bool showLoadingWidget = true, Widget loadingWidget = const CircularProgressIndicator()})

Properties

baseUrl String
baseUrl is the common prefix of the api url.
final
client → Client?
Http Client
final
errorMessageKey String?
errorMessageKey is the Key used to access the error message of the Failure Json in case when the status code is 200 and the response Json is dynamic and in state of failure
final
failureParser → dynamic Function(Map<String, dynamic> json)?
failureParser is a function used to map the Json in case of failure
final
hashCode int
The hash code for this object.
no setterinherited
loadingWidget Widget
loadingWidget used in state of loading.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showErrorToast bool
apiRegistries is the list of Apis to be registered showErrorToast is used to enable/disable Error Toast
final
showLoadingWidget bool
showLoadingWidget is used to enable/disable loader.
final
statusCodeKey String?
statusValues is the Key that is used in case when the api provides 200 status code as response but there is a dynamic status code in the Json
final
statusValues List
statusValues are the List of values that are checked against the statusValues to get Success Response
final
unauthorizedFn → dynamic Function(BuildContext context)?
unauthorizedFn is a Function that is called if status code is 401.
final

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