FaS eKYC Flutter

pub package

A flutter package from FaS eKYC for connecting to FaS eKYC SDK



On Android you must first set the minSdkVersion in the build.gradle file:

defaultConfig {
   minSdkVersion 18

If at all possible, when registering your application on the OAuth provider try not to use HTTPS as the scheme part of the redirect uri, because in that case your application won't intercept the server redirection, as it will be automatically handled by the system browser (at least on Android). Just use a custom scheme, such as "my.test.app" or any other scheme you want.

If the OAuth2 server allows only HTTPS uri schemes, refer to the FAQ section.

Again on Android, if your application uses the Authorization Code flow, you first need to modify the AndroidManifest.xml file adding the intent filter needed to open the browser window for the authorization workflow. The library relies on the flutter_web_auth package to allow the Authorization Code flow.


<activity android:name="com.linusu.flutter_web_auth.CallbackActivity" >
	<intent-filter android:label="flutter_web_auth">
		<action android:name="android.intent.action.VIEW" />
		<category android:name="android.intent.category.DEFAULT" />
		<category android:name="android.intent.category.BROWSABLE" />
		<data android:scheme="my.test.app" />


On iOS you need to set the platform in the ios/Podfile file:

platform :ios, '11.0'


Add this to pubspec.yaml

  sura_flutter: ^0.3.1


You just call FaSeKYCButton to your widget tree.

Widget _buildLoginButton() {
    return Padding(
      padding: const EdgeInsets.only(left: 24.0, right: 24.0, bottom: 50),
      child: FaSeKYCButton(
        clientId: "your client id",
        clientSecret: "your client secret",
        redirectUri: 'your return url',
        customUriScheme: 'your customer schema uri',
        scopes: scope,
        child: Padding(
          padding: const EdgeInsets.symmetric(vertical: 4.0),
          child: Row(
            children: [
                height: 50,
                width: 50,
                child: Center(
                    child: Image.asset('assets/images/ekyc_white_logo.png')),
                width: 8.0,
                height: 30,
                child: VerticalDivider(
                  color: Colors.white,
                flex: 2,
                child: Center(
                  child: Text(
                    style: TextStyle(
                        color: Colors.white,
                        fontFamily: 'khFont',
                        fontSize: 16.0),
        onSuccess: (personInfoModel) {
        onUserCancel: (String message) {
          showAlertDialog(context, message);

After calling FaSeKYCButton above, you just input your credential of Oauth2.