SocketManager class Null safety

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?
read / write
callDefaults bool?
check to call default functions each step
read / write
connectSocket Future<Socket?> Function()
read-only
context BuildContext?
read / write
disconnectSocket Function
read-only
endRules ↔ (bool Function?(dynamic responseJson)?)
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
failedRules ↔ (bool Function?(dynamic responseJson)?)
read / write
hashCode int
The hash code for this object.
read-onlyinherited
onDataReceived ↔ (void Function?(String data)?)
read / write
onEnd Function
called on end this instance of Network Manager request
read / write
onEndDefault Function?
called on End every request
read / write
onFailed ↔ void Function(BuildContext context, SMResponse 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, SMResponse 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
port int?
read / write
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
sendDataToSocket → dynamic Function(String data, {Duration? waitForResponse})
read-only
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
tcpAddress String?
read / write
timeOutSeconds Duration?
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