faceki_biometric_blaze 1.0.0 copy "faceki_biometric_blaze: ^1.0.0" to clipboard
faceki_biometric_blaze: ^1.0.0 copied to clipboard

FACEKI Biometric Blaze SDK for Flutter

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:faceki_biometric_blaze/faceki_biometric_blaze.dart';
import 'package:fluttertoast/fluttertoast.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'FACEKI Blaze Biometric Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'FACEKI Biometric Blaze SDK Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  void _showToast(String message) {
    Fluttertoast.showToast(
        msg: message,
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
        timeInSecForIosWeb: 5,
        backgroundColor: Colors.black54,
        textColor: Colors.white,
        fontSize: 16.0);
  }

String token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiJlMWExZjE5ZC0zMTI4LTQ1NDYtODIxOC0yNDNhNGUzODZhMzEiLCJhY3Rpb24iOiJMT0dJTiIsImp0aSI6ImE2MGQxOGZlLTQzMzYtNDAyYi05NGEzLTI2MzY0ZGI2MWQ4OSIsImlhdCI6MTc0Mjc0MjkxNiwiZXhwIjoxNzQyNzQzMTE2fQ.2rUZ8O33PLJwW0tOezEnTY_6hKvR_3ik_ltAdO-FtJQ";
 void launchCamera() {
    if (token.isEmpty) {
      _showToast("Please add token first");
      return;
    }

    // CALL REGISTER METHOD
    Faceki_Biometric_Blaze_SDK().launchEKYCFlow(context, token, "LOGIN",
        (value) {
      print(value);
      var face_id = value['result']['face_id'];
      _showToast("Welcome $face_id");

       Navigator.of(context).popUntil((route) => route.isFirst);
    }, "custom_identity");


    // CALL LOGIN METHOD
    //  Faceki_Biometric_Blaze_SDK().launchEKYCFlow(context, token, "LOGIN",
    //     (value) {
    //   print(value);
    //   var face_id = value['result']['face_id'];
    //   _showToast("Welcome $face_id");
    // }, "custom_identity");
  }

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'Add Token and Continue:',
            ),
            ElevatedButton(
              onPressed: launchCamera,
              child: Text('Launch FACEKI SDK'),
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
100
points
38
downloads

Documentation

API reference

Publisher

verified publisherfaceki.com

Weekly Downloads

FACEKI Biometric Blaze SDK for Flutter

Homepage

License

unknown (license)

Dependencies

camerawesome, dio, flutter, fluttertoast, image, path_provider, permission_handler, url_launcher

More

Packages that depend on faceki_biometric_blaze