AuthService class
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
getAccessToken ()
→ Future <String ? >
Gets a valid access token, automatically handling refresh
This should be used for all external API calls
getAccessTokenWithAuth (BuildContext context , {String ? email , String ? referralCode , bool forceWebView = false })
→ Future <String ? >
Gets a valid access token with automatic re-authentication
This version requires BuildContext for UI navigation
getStoredEmail ()
→ Future <String ? >
Gets the stored email address of the current user
Returns null if no user is authenticated
getStoredUserId ()
→ Future <String ? >
Gets the stored user ID of the current user
Returns null if no user is authenticated
isIndiaKycCompleted ()
→ Future <bool >
Checks if Indian KYC documents have been added by the user
Returns true if Indian KYC is completed, false otherwise
isUsKycCompleted ()
→ Future <bool >
Checks if US KYC documents have been added by the user
Returns true if US KYC is completed, false otherwise
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openRemit2anyFullSite (BuildContext context , {String ? tenant })
→ Future <Map <String , dynamic > ? >
Convenience function to open the complete Remit2Any webview
tenant - Optional tenant string to append to the default user agent
email - Optional email to pre-fill in the authentication form
context - The build context
Returns: A Future that completes when the webview is closed
openWebViewPage (BuildContext context , String url , String title )
→ Future <Map <String , dynamic > ? >
Opens a WebView page with the specified URL
payWithRemit2Any (BuildContext context , {required String sessionId })
→ Future <Map <String , dynamic > ? >
Opens the Pay with Remit2Any flow using a payment session ID
Returns event data when webview closes.
refreshTokens ()
→ Future <void >
Gets user information using automatic token management
Returns null if token is invalid and refresh fails
Gets user information with automatic re-authentication
This version requires BuildContext for UI navigation if needed
signIn (BuildContext context , {String ? email , String ? referralCode , bool forceWebView = false })
→ Future <Map <String , dynamic > ? >
signInWithNativeAuth (String provider )
→ Future <Map <String , dynamic > >
Sign in with a native provider (Google or Apple) using Amplify Hosted UI.
provider must be "google" or "apple".
signOut (BuildContext context , {bool redirectToLogin = false })
→ Future <void >
Signs out the current user and clears all stored tokens and Cognito session
signOutWithNativeAuth (BuildContext ? context , {bool redirectToLogin = false })
→ Future <void >
Sign out from Amplify/Cognito (local session only) so the next Hosted UI sign-in
can use a different account. Does not open a browser.
startTokenRefreshLoop ()
→ void
toString ()
→ String
A string representation of this object.
inherited