ClientBrowser constructor

ClientBrowser({
  1. String endPoint = 'https://cloud.appwrite.io/v1',
  2. bool selfSigned = false,
})

Implementation

ClientBrowser({
  String endPoint = 'https://cloud.appwrite.io/v1',
  bool selfSigned = false,
}) : _endPoint = endPoint {
  _httpClient = BrowserClient();
  _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': '12.0.4',
    'X-Appwrite-Response-Format': '1.5.0',
  };

  config = {};

  assert(_endPoint.startsWith(RegExp("http://|https://")),
      "endPoint $_endPoint must start with 'http'");
  init();
}