Flutter: Invokes a Supabase Edge Function.

Invokes a Supabase Function. See the guide for details on writing Functions.

Examples

Basic invocation.

final res = await supabase.functions.invoke('hello', body: \{'foo': 'baa'\});
final data = res.data;

Specifying response type.

final res = await supabase.functions.invoke(
  'hello',
  body: \{'foo': 'baa'\},
  responseType: ResponseType.text,
);
final data = res.data;

Parsing custom headers.

final res = await supabase.functions.invoke(
  'hello',
  body: \{'foo': 'baa'\},
  headers: \{
    'Authorization': 'Bearer $\{supabase.auth.currentSession?.accessToken\}'
  \},
);