Rownd bindings for Flutter
rownd_flutter_plugin
and provider
in your pubspec.yaml
:
targetSdkVersion
to 32 or higher in your app’s build.gradle
file.
minSdkVersion
to 26 or higher in your app’s build.gradle
file. Rownd currently does not support an API version lower than 26.
MainActivity
) subclass FlutterFragmentActivity
instead of FlutterActivity
. If you’re using the default MainActivity
generated by Flutter, you can simply change the superclass to FlutterFragmentActivity
like this:
rowndPlugin.configure(RowndConfig(appKey: 'YOUR_APP_KEY'));
within your application wherever you do most of your app’s initialization.
Now you’re ready to use Rownd in your app. The plugin provides a RowndCubit
class that can be used to manage the Rownd state.
A basic sign-in example might look like this:
home
for the BlocProvider is determined by the RowndCubit
’s authentication state. If the user is authenticated, the MyHomePage
widget is displayed. If the user is not authenticated, the LoginPage
widget is displayed.
There are many ways to define the UI based on the authentication state, but this is a simple and effective approach.
To learn more about Bloc and Cubit, see the flutter_bloc documentation.
RowndCubit
class is a Cubit
that manages the Rownd state. It provides a simple interface for checking the current user’s authentication status, signing in and out, and getting the current user’s profile.
signIn(RowndSignInOptions? options)
options
parameter is optional and can be used to specify additional options for the sign-in process.
RowndSignInOptions
Property | Type | Description |
---|---|---|
postSignInRedirect (not recommended) | String | If you’ve followed the steps to enable Android App Links, the redirect will be handled automatically. When the user completes the authentication challenge via email or SMS, they’ll be redirected to the URL set for postSignInRedirect. If this is an Android App Link, it will redirect the user back to your app. |
intent | String | This option applies only when you have opted to split the sign-up/sign-in flow via the Rownd dashboard. Valid values are .SignIn or .SignUp . If you don’t set this value, the user will be presented with the unified sign-in/sign-up flow. Please reach out to support@rownd.io to enable. |
signOut()
isAuthenticated()
manageAccount()
registerPasskey()
user
Map<String, dynamic>
.