toMap method

Map<String, dynamic> toMap()

Converts this object into a map for the platform channel.

Implementation

Map<String, dynamic> toMap() {
  final Map<String, dynamic> map = {};
  // Common properties
  if (path != null) map['path'] = path;
  if (transports != null) map['transports'] = transports;
  if (reconnection != null) map['reconnection'] = reconnection;
  if (reconnectionAttempts != null) map['reconnectionAttempts'] = reconnectionAttempts;
  if (reconnectionDelay != null) map['reconnectionDelay'] = reconnectionDelay;
  if (reconnectionDelayMax != null) map['reconnectionDelayMax'] = reconnectionDelayMax;
  if (randomizationFactor != null) map['randomizationFactor'] = randomizationFactor;
  if (timeout != null) map['timeout'] = timeout;
  if (query != null) map['query'] = query;
  if (auth != null) map['auth'] = auth;
  if (secure != null) map['secure'] = secure;
  if (forceNew != null) map['forceNew'] = forceNew;
  // Platform-specific configs are nested
  if (extraIOSConfig != null) map['extraIOSConfig'] = extraIOSConfig!.toMap();
  if (androidConfig != null) map['androidConfig'] = androidConfig!.toMap();
  return map;
}