PostgrestClient constructor

PostgrestClient(
  1. String url, {
  2. Map<String, String>? headers,
  3. String? schema,
  4. Client? httpClient,
})

To create a PostgrestClient, you need to provide an url endpoint.

You can also provide options with headers and schema key-value if needed

PostgrestClient(REST_URL)
PostgrestClient(REST_URL, headers: {'apikey': 'foo'})

httpClient is optional and can be used to provide a custom http client

Implementation

PostgrestClient(
  this.url, {
  Map<String, String>? headers,
  this.schema,
  this.httpClient,
}) : headers = {...defaultHeaders, if (headers != null) ...headers};