signUp method
Signs up a new user with email and password.
Optionally, data
can be provided to store additional user metadata.
Example:
try {
final response = await authManager.signUp(
email: 'newuser@example.com',
password: 'securepassword123',
data: {'username': 'newbie'},
);
if (response.user != null) {
print('Sign-up successful for user: \${response.user!.id}');
} else {
print('Sign-up successful, but user object is null. Check email verification settings.');
}
} on AuthException catch (e) {
print('Sign-up error: \${e.message}');
}
Implementation
Future<AuthResponse> signUp({
required String email,
required String password,
Map<String, dynamic>? data,
}) {
return _supabaseClient.auth.signUp(
email: email,
password: password,
data: data,
);
}