passbase_flutter 3.2.1 copy "passbase_flutter: ^3.2.1" to clipboard
passbase_flutter: ^3.2.1 copied to clipboard

discontinued
PlatformAndroidiOS

Official Flutter wrapper for Passbase SDK. For more info please visit https://docs.passbase.com/flutter

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:passbase_flutter/passbase_flutter.dart';

void main() => runApp(PassbaseFlutterDemoApp());

class PassbaseFlutterDemoApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    PassbaseSDK.prefillUserEmail = "testuser@mail.com";
    PassbaseSDK.initialize(publishableApiKey: "YOUR_PUBLISHABLE_API_KEY", customerPayload: "CUSTOMER_PAYLOAD");
    return MaterialApp(
      home: PassbaseDemoHomePage(),
    );
  }
}

class PassbaseDemoHomePage extends StatefulWidget {
  @override
  _PassbaseDemoHomePageState createState() {
    return _PassbaseDemoHomePageState();
  }
}

class _PassbaseDemoHomePageState extends State<PassbaseDemoHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color.fromARGB(255, 50, 107, 236),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Padding(
              padding: EdgeInsets.only(top: 80),
              child: Image.asset(
                'lib/assets/shield-icon.png',
                width: 50,
                height: 50,
              ),
            ),
            Container(
              padding: EdgeInsets.symmetric(horizontal: 45),
              child: Column(
                children: <Widget>[
                  Text(
                    'Welcome to Passbase',
                    style: TextStyle(fontSize: 25, color: Colors.white, fontFamily: 'Exo', fontWeight: FontWeight.w600),
                  ),
                  SizedBox(
                    height: 25,
                  ),
                  Text(
                    'Start your first verification by clicking on the button below.',
                    style: TextStyle(
                      fontSize: 15,
                      color: Colors.white,
                      fontFamily: 'Exo',
                    ),
                    textAlign: TextAlign.center,
                  ),
                ],
              ),
            ),
            Padding(
              padding: EdgeInsets.only(bottom: 70),
              child: PassbaseButton(
                onFinish: () {
                  // do stuff in case of verification success
                  print("finish");
                },
                onError: () {
                  // do stuff in case of verification cancel
                  print("error");
                },
                onStart: () {
                  // do stuff in case of verification start
                  print("start");
                },
                onSubmitted: () {
                  // do stuff in case of verification submitted
                  print("submitted");
                },
                width: 300,
                height: 60,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
6
likes
130
pub points
41%
popularity

Publisher

verified publisherpassbase.com

Official Flutter wrapper for Passbase SDK. For more info please visit https://docs.passbase.com/flutter

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on passbase_flutter