Cotter class

Constructors

Cotter({required String apiKeyID})
Initialize Cotter with specified API Key ID.

Properties

apiKeyID String
getter/setter pair
approveRequestStrings ↔ ApproveRequestStrings
getter/setter pair
authRequestStrings ↔ AuthRequestStrings
getter/setter pair
colors ↔ CotterColors
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAccessToken() Future<CotterAccessToken?>
Get access token that is currently stored in the storage
getIDToken() Future<CotterIDToken?>
Get ID token that is currently stored in the storage
getRefreshToken() Future<String?>
Get refresh token that is currently stored in the storage
getUser() Future<User>
Returns currently logged in user
getUserByIdentifier(String identifier) Future<User>
Fetches user from Cotter using a specific identifier(email or phone num)
logOut() Future<void>
Logout user from the system. This is done by removing all authentication token stored in system storage
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
signInWithDevice({required String identifier, required BuildContext context}) Future<Event>
Sign up with this device, identifier can be user's email, phone, or any string to identify your user
signInWithEmailOTP({required String redirectURL, required String email}) Future<User>
Sign in with email allows existing user to authenticate by email verification. This method will CREATE A NEW USER if one doesn't exist with this email
signInWithPhoneOTP({required String redirectURL, List<PhoneChannel>? channels}) Future<User>
Sign in with phone allows existing user to authenticate by phone verification. This method will allow the user to enter the phone number inside THE IN-APP BROWSER channels will show the options for the user to pick, can be SMS or WHATSAPP This method will CREATE A NEW USER if one doesn't exist with this email
signInWithPhoneOTPViaSMS({required String redirectURL, required String phone}) Future<User>
Sign in with phone via SMS allows existing users to authenticate by phone verification using SMS. This method will CREATE A NEW USER if one doesn't exist with this phone number
signInWithPhoneOTPViaWhatsApp({required String redirectURL, required String phone}) Future<User>
Sign in with phone via WhatsApp allows existing users to authenticate by phone verification using WhatsApp. This method will CREATE A NEW USER if one doesn't exist with this phone number
signUpWithDevice({required String identifier}) Future<User>
Sign up with this device, identifier can be user's email, phone, or any string to identify your user
signUpWithEmailOTP({required String redirectURL, String? email}) Future<User>
Verify user's email, then create a user if email verification is successful
signUpWithPhoneOTP({required String redirectURL, List<PhoneChannel>? channels}) Future<User>
Verify user's phone number, then create a user if phone verification is successful This method will allow the user to enter the phone number inside THE IN-APP BROWSER channels will show the options for the user to pick, can be SMS or WHATSAPP
signUpWithPhoneOTPViaSMS({required String redirectURL, required String phone}) Future<User>
Verify user's phone number, then create a user if phone verification is successful This method will allow the user to enter the phone number inside YOUR APP and automatically send verification code via SMS
signUpWithPhoneOTPViaWhatsApp({required String redirectURL, required String phone}) Future<User>
Verify user's phone number, then create a user if phone verification is successful This method will allow the user to enter the phone number inside YOUR APP and automatically send verification code via WhatsApp
toString() String
A string representation of this object.
inherited
withApproveRequestStrings(ApproveRequestStrings approveRequestStrings) Cotter
Localization setting for approval request on trusted device
withAuthRequestStrings(AuthRequestStrings authRequestStrings) Cotter
Localization setting for authentication requests on trusted device
withTheme({required Color primaryColor, bool darkTheme = false}) Cotter
Sets Color theme

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

baseURL String
getter/setter pair
jsBaseURL String
getter/setter pair
jwtKid String
no getter
kid String
getter/setter pair
url String
Sets base url for Cotter's SDK
no getter