SocketManager class

Constructors

SocketManager.instance({required BuildContext context, void onSuccess(BuildContext context, SMResponse result)?, void onFailed(BuildContext context, SMResponse result)?, required void onDataReceived(String data), Function? onStart, Function? onEnd, Duration? timeout, bool showFailedDialog = true, bool callDefaults = true, bool callCheckers = true})
factory

Properties

callCheckers bool?
getter/setter pair
callDefaults bool?
check to call default functions each step
getter/setter pair
connectSocket Future<Socket?> Function()
no setter
context BuildContext?
getter/setter pair
disconnectSocket Function
no setter
endRules ↔ (bool Function(dynamic responseJson)?)
getter/setter pair
errorMsgExtractor ↔ (String Function(dynamic error)?)
a function to extract error as string
getter/setter pair
failedDialog ↔ (Future Function(BuildContext context, String title, String body)?)
getter/setter pair
failedRules ↔ (bool Function(dynamic responseJson)?)
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
onDataReceived ↔ (void Function(String data)?)
getter/setter pair
onEnd Function
called on end this instance of Network Manager request
getter/setter pair
onEndDefault Function?
called on End every request
getter/setter pair
onFailed ↔ void Function(BuildContext context, SMResponse responseJson)
called on failed this instance of Network Manager request
getter/setter pair
onFailedDefault Function?
called on Failed every request
getter/setter pair
onStart Function
called on start this instance of Network Manager request
getter/setter pair
onStartDefault Function?
getter/setter pair
onSuccess ↔ void Function(BuildContext context, SMResponse responseJson)
called on success this instance of Network Manager request
getter/setter pair
onSuccessDefault Function?
called on Success every request
getter/setter pair
onTokenExpire ↔ (void Function(void retryFunctoin())?)
called on token expire
getter/setter pair
port int?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendDataToSocket → dynamic Function(String data, {Duration? waitForResponse})
no setter
showFailedDialog bool?
check to show dialog when when request is success
getter/setter pair
showSuccessDialog bool?
check to show dialog when when request is failed
getter/setter pair
successDialog ↔ (Future Function(BuildContext context, String title, String body)?)
getter/setter pair
successMsgExtractor ↔ (String Function(dynamic msg)?)
getter/setter pair
successRules ↔ (bool Function(dynamic responseJson)?)
other rules for check beside result code 200 should be a function return bool value
getter/setter pair
tcpAddress String?
getter/setter pair
timeOutSeconds Duration?
getter/setter pair
tokenExpireRules ↔ (bool Function(dynamic responseJson)?)
conditions where token expires
getter/setter pair
useFancyDialog bool?
getter/setter pair

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