NetworkManager class Null safety

Constructors

NetworkManager.instance({required BuildContext context, required String api, dynamic req, Map<String, dynamic>? query, void onSuccess(BuildContext? context, NMResponse result)?, void onFailed(BuildContext? context, NMResponse result)?, Function? onStart, Function? onEnd, int? timeout, CancelToken? cancelToken, Map<String, dynamic>? headers, bool showFailedDialog = true, bool callDefaults = true, bool followRedirect = true, bool validStatus(int?)?, bool showSuccessDialog = false, bool forbidCancelWhenOffline = false})
factory

Properties

api String?
api address you're requesting
read / write
callDefaults bool?
check to call default functions each step
read / write
cancelToken CancelToken?
read / write
context BuildContext?
need context to show dialog or pop and push
read / write
dio Dio?
dio instance for making requests
read / write
dioOption BaseOptions
read / write
errorMsgExtractor ↔ (String Function?(dynamic error)?)
a function to extract error as string
read / write
failedDialog ↔ (Future Function?(BuildContext? context, String title, String body)?)
read / write
forbidCancelWhenOffline bool
read / write
hashCode int
The hash code for this object.
read-onlyinherited
onEnd Function?
called on end this instance of Network Manager request
read / write
onEndDefault Function?
called on End every request
read / write
onFailed ↔ dynamic Function(BuildContext? context, NMResponse responseJson)
called on failed this instance of Network Manager request
read / write
onFailedDefault Function?
called on Failed every request
read / write
onStart Function?
called on start this instance of Network Manager request
read / write
onStartDefault Function?
read / write
onSuccess ↔ void Function(BuildContext? context, NMResponse responseJson)
called on success this instance of Network Manager request
read / write
onSuccessDefault Function?
called on Success every request
read / write
onTokenExpire ↔ (void Function?(void retryFunctoin())?)
called on token expire
read / write
query Map<String, dynamic>?
Map
read / write
req ↔ dynamic
dynamic request data for post methods
read / write
requestGet → dynamic
read-only
requestPost → dynamic
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
showFailedDialog bool?
check to show dialog when when request is success
read / write
showSuccessDialog bool?
check to show dialog when when request is failed
read / write
successDialog ↔ (Future Function?(BuildContext? context, String title, String body)?)
read / write
successMsgExtractor ↔ (String Function?(dynamic msg)?)
read / write
successRules ↔ (bool Function?(dynamic responseJson)?)
other rules for check beside result code 200 should be a function return bool value
read / write
token String?
String token which is used in header
read / write
tokenExpireRules ↔ (bool Function?(dynamic responseJson)?)
conditions where token expires
read / write
useFancyDialog bool?
read / write

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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