OptionBuilder class

Option Builder to help developer to construct an options map.

Constructors

OptionBuilder()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build() Map<String, dynamic>
Build the options map.
disableAddTrailingSlash() OptionBuilder
Disable the trailing slash which was added by default
disableAutoConnect() OptionBuilder
Disable auto connect.
disableForceNew() OptionBuilder
Whether to disable to create a new Manager instance.
disableForceNewConnection() OptionBuilder
disableMultiplex() OptionBuilder
Whether to disable multiplexing.
disableReconnection() OptionBuilder
Whether reconnection is disabled.
enableAddTrailingSlash() OptionBuilder
Enable the trailing slash which was added by default
enableAutoConnect() OptionBuilder
Enable auto connect. The default is true.
enableForceNew() OptionBuilder
Whether to enable to create a new Manager instance. The default is false
enableForceNewConnection() OptionBuilder
enableMultiplex() OptionBuilder
The opposite of forceNew: whether to reuse an existing Manager instance. The default is true.
enableReconnection() OptionBuilder
Whether to reconnect automatically. The default is true.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAckTimeout(int timeout) OptionBuilder
The default timeout in milliseconds used when waiting for an acknowledgement (not to be mixed up with the already existing timeout option, which is used by the Manager during the connection)
setAuth(Map auth) OptionBuilder
setAuthFn(void authFn(void callback(Map auth))) OptionBuilder
setExtraHeaders(Map<String, dynamic> headers) OptionBuilder
Additional headers to be sent during the handshake.
setForceBase64(bool forceBase64) OptionBuilder
Whether to force base 64 encoding for transport. The default is false.
setParser(ParserOptions parserOptions) OptionBuilder
The parser used to marshall/unmarshall packets for transport.
setPath(String path) OptionBuilder
It is the name of the path that is captured on the server side. The default is "/socket.io/".
setProtocols(List<String> protocols) OptionBuilder
Either a single protocol string or an array of protocol strings. These strings are used to indicate sub-protocols, so that a single server can implement multiple WebSocket sub-protocols
setQuery(Map query) OptionBuilder
Additional query parameters
setRandomizationFactor(num factor) OptionBuilder
The randomization factor used to compute the actual reconnection The default is 0.5.
setReconnectionAttempts(num attempts) OptionBuilder
The number of reconnection attempts before giving up. The default is Infinity.
setReconnectionDelay(int delay) OptionBuilder
The initial delay before reconnection in milliseconds (affected by the randomizationFactor value). The default is 1000 (1 second).
setReconnectionDelayMax(int delayMax) OptionBuilder
The maximum delay between two reconnection attempts. Each attempt increases the reconnection delay by 2x. The default is 5000 (5 seconds).
setRememberUpgrade(bool rememberUpgrade) OptionBuilder
If true and if the previous WebSocket connection to the server succeeded, the connection attempt will bypass the normal upgrade process and will initially try WebSocket. A connection attempt following a transport error will use the normal upgrade process. It is recommended you turn this on only when using SSL/TLS connections, or if you know that your network does not block websockets. The default is false.
setRetries(int retries) OptionBuilder
The maximum number of retries. Above the limit, the packet will be discarded.
setTimeout(int timeout) OptionBuilder
The timeout in milliseconds for each connection attempt. The default is 20000 (20 seconds).
setTimestampParam(String timestampParam) OptionBuilder
The name of the query parameter to use as our timestamp key. The default is "t".
setTimestampRequests(bool timestampRequests) OptionBuilder
Whether to add the timestamp query param to each request The default is true.
setTransportOptions(Map<String, dynamic> transportOptions) OptionBuilder
Transport-specific options.
setTransports(List<String> transports) OptionBuilder
The low-level connection to the Socket.IO server can either be established with: Default value: "polling", "websocket", "webtransport" Note: "webtransport" is not supported in dart yet.
setUpgrade(bool upgrade) OptionBuilder
Whether the client should try to upgrade the transport from HTTP long-polling to something better. The default is true.
toString() String
A string representation of this object.
inherited

Operators

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