AppNetworkManager class

Implemented types

Properties

hashCode int
The hash code for this object.
no setterinherited
initializeCompleter Completer<void>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
waitForManagerInitialization Future<void>
Waits for the network manager to initialize by waiting for the initializeCompleter to complete.
no setteroverride

Methods

addAuthorizationHeader(String token) Future<void>
Adds an authorization header to the network manager with the specified token.
override
changeLangHeader(String langCode) Future<void>
Changes the language header of the network manager to the specified langCode.
override
downloadFile(String urlPath, {void onReceiveProgress(int, int)?, Map<String, dynamic>? queryParameters, void onReceiveProgressPercentage(double)?, CancelToken? cancelToken}) Future<File>
Downloads a file from the network using the _manager's downloadFile method. It requires a urlPath to specify the file URL. Other optional parameters can be provided for customization.
override
fetch<T extends BaseEntity<T>, R>(String path, {required T parserModel, required HttpTypes type, String contentType = Headers.jsonContentType, ResponseType responseType = ResponseType.json, dynamic data, Map<String, dynamic>? queryParameters, CancelToken? cancelToken, void onSendProgress(int, int)?, CachePolicy cachePolicy = CachePolicy.noCache, Duration? maxStale, bool ignoreEntityKey = false, String? insideEntityKey}) Future<ResponseModel>
Fetches data from the network using the _manager's fetch method. It requires a path to specify the API endpoint and a parserModel to parse the response. Other optional parameters can be provided for customization.
override
fetchPrimitive<T, R>(String path, {required HttpTypes type, String contentType = Headers.jsonContentType, ResponseType responseType = ResponseType.json, dynamic data, Map<String, dynamic>? queryParameters, CancelToken? cancelToken, void onSendProgress(int, int)?, CachePolicy cachePolicy = CachePolicy.noCache, Duration? maxStale, bool ignoreEntityKey = false, String? insideEntityKey}) Future<ResponseModel>
Fetches primitive data from the network using the _manager's fetchPrimitive method. It requires a path to specify the API endpoint. Other optional parameters can be provided for customization.
override
init() Future<void>
Initializes the network manager by calling the _manager's initialize method. It sets the network configuration, response model, and entity key.
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

instance AppNetworkManager
no setter