NakamaWebsocketClient.init constructor
NakamaWebsocketClient.init({})
Implementation
factory NakamaWebsocketClient.init({
String key = 'default',
required String host,
int port = 7350,
required bool ssl,
required String token,
Function()? onDone,
Function(dynamic error)? onError,
}) {
// Has the client already been initialized? Then return it.
if (_clients.containsKey(key)) {
return instanceFor(key: key);
}
// Create new and return instance of this.
return _clients[key] = NakamaWebsocketClient._(
host: host,
port: port,
ssl: ssl,
token: token,
onDone: onDone,
onError: onError,
);
}