withConverter<S> method

PostgrestBuilder<S> withConverter<S>(
  1. PostgrestConverter<S> converter
)

Converts any response that comes from the server into a type-safe response.

postgrest.from('users').select().withConverter((data) => User.fromJson(json.decode(data))).execute();

Implementation

PostgrestBuilder<S> withConverter<S>(PostgrestConverter<S> converter) {
  _converter = converter;
  return PostgrestBuilder<S>(
    url: url,
    headers: headers,
    schema: schema,
    method: method,
    body: body,
  )
    ..maybeEmpty = maybeEmpty
    .._converter = converter;
}