ClientIO constructor
ClientIO(
{ - String endPoint = 'https://HOSTNAME/v1',
- bool selfSigned = false,
})
Implementation
ClientIO({
String endPoint = 'https://HOSTNAME/v1',
this.selfSigned = false,
}) : _endPoint = endPoint {
_nativeClient = HttpClient()
..badCertificateCallback =
((X509Certificate cert, String host, int port) => selfSigned);
_httpClient = IOClient(_nativeClient);
_endPointRealtime = endPoint
.replaceFirst('https://', 'wss://')
.replaceFirst('http://', 'ws://');
_headers = {
'content-type': 'application/json',
'x-sdk-name': 'Flutter',
'x-sdk-platform': 'client',
'x-sdk-language': 'flutter',
'x-sdk-version': '9.0.1',
'X-Appwrite-Response-Format': '1.0.0',
};
config = {};
assert(_endPoint.startsWith(RegExp("http://|https://")),
"endPoint $_endPoint must start with 'http'");
init();
}