Flutter: Create a new user

Creates a new user.

Parameters

Examples

Sign up with an email and password

final AuthResponse res = await supabase.auth.signUp(
  email: 'example@email.com',
  password: 'example-password',
);
final Session? session = res.session;
final User? user = res.user;

Sign up with a phone number and password (SMS)

final AuthResponse res = await supabase.auth.signUp(
  phone: '123456789',
  password: 'example-password',
  channel: OtpChannel.sms,
);

Sign up with additional metadata

final AuthResponse res = await supabase.auth.signUp(
  email: 'example@email.com',
  password: 'example-password',
  data: \{'username': 'my_user_name'\},
);
final Session? session = res.session;
final User? user = res.user;

Sign up with redirect URL

final AuthResponse res = await supabase.auth.signUp(
  email: 'example@email.com',
  password: 'example-password',
  emailRedirectTo: 'com.supabase.myapp://callback',
);
final Session? session = res.session;
final User? user = res.user;