withConverter<U> method

PostgrestBuilder<U, U, R> withConverter<U>(
  1. PostgrestConverter<U, R> converter
)

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

List<User> users = await postgrest
    .from('users')
    .select()
    .withConverter(
      (users) => users.map(User.fromJson).toList(),
    );

Implementation

PostgrestBuilder<U, U, R> withConverter<U>(
    PostgrestConverter<U, R> converter) {
  return PostgrestBuilder(
    url: _url,
    headers: _headers,
    schema: _schema,
    method: _method,
    body: _body,
    isolate: _isolate,
    httpClient: _httpClient,
    count: _count,
    maybeSingle: _maybeSingle,
    converter: converter,
  );
}