Flutter
Pre-Built UI
Leverage our Pre-Built UI for rapid integration and customization of authentication flows in your application. This setup allows you to adjust appearance and functionality through the OTPLESS dashboard with minimal coding.
Step 1: Install OTPLESS SDK Dependency
Install the OTPLESS SDK dependency by running the following command in your terminal at the root of your Flutter project:
Step 2: Platform-specific Integrations
Requirements
- The compileSdk version should be 35.
- The minimum SDK version supported by the SDK is 21.
- The kotlin version should be 1.9.0 and above.
- The gradle version should be 8.3.1 and above.
- Add intent filter inside your
android/app/src/main/AndroidManifest.xml
file into your Main activity code block:
Replace YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.
- Add Network Security Config inside your
android/app/src/main/AndroidManifest.xml
file into your<application>
code block (Only required if you are using the SNA feature):
- Change your activity launchMode to singleTop and exported true for your Main Activity:
Requirements
- The compileSdk version should be 35.
- The minimum SDK version supported by the SDK is 21.
- The kotlin version should be 1.9.0 and above.
- The gradle version should be 8.3.1 and above.
- Add intent filter inside your
android/app/src/main/AndroidManifest.xml
file into your Main activity code block:
Replace YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.
- Add Network Security Config inside your
android/app/src/main/AndroidManifest.xml
file into your<application>
code block (Only required if you are using the SNA feature):
- Change your activity launchMode to singleTop and exported true for your Main Activity:
- Add the following block to your
ios/Runner/info.plist
file:
info.plist
Replace YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.
- Add the following block to your
ios/Runner/info.plist
file (Only required if you are using the SNA feature):
info.plist
- Import the OTPLESS SDK in your respective
ios/Runner/AppDelegate.swift
file to handle redirection.
AppDelegate.swift
Step 3: Configure Sign up/Sign in
- Import the OTPLESS
package
on your login page.
login_page.dart
- Add OTPLESS instance and declare the variable with
YOUR_APP_ID
login_page.dart
Replace YOUR_APP_ID
with your actual App
ID provided in
your OTPLESS dashboard.
- Show the Otpless Login Page:
login_page.dart
- When user successfully logs in or your login screen is destroyed, stop Otpless service:
login_page.dart
Was this page helpful?