HubApiClient constructor

HubApiClient(
  1. Uri baseUrl, {
  2. String? token,
  3. String? principal,
  4. ApiTransport? transport,
})

Creates a client for baseUrl.

transport defaults to the platform's own: HttpClient on the VM, fetch in a browser. Inject one to reach a Hub over TLS with a private CA (IoApiTransport(securityContext: …), VM only), or to drive the client against a fake Hub in tests.

Implementation

HubApiClient(
  this.baseUrl, {
  this.token,
  this.principal,
  ApiTransport? transport,
}) : _transport = transport ?? defaultApiTransport();