ekyc_id_flutter 1.1.1 copy "ekyc_id_flutter: ^1.1.1" to clipboard
ekyc_id_flutter: ^1.1.1 copied to clipboard

A Flutter Plugin to interact with EkycID.

example/lib/main.dart

import 'package:ekyc_id_flutter/ekyc_id_flutter.dart';
import 'package:ekyc_id_flutter_example/test_result.dart';
import 'package:flutter/material.dart';
// import 'package:image_picker/image_picker.dart';
import 'package:permission_handler/permission_handler.dart';
// import 'package:ekyc_id_flutter/src/core/document_detection.dart';
import 'package:ekyc_id_flutter/src/document_scanner/document_scanner_values.dart';
import 'package:ekyc_id_flutter/src/core/models/object_detection_object_type.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  EkycIDServices.initialize(EkycAPI(
    apiKey: "8e0231159713fd625cb31b767ee26bafaccab7b5ba652342e66cd34f856bf96f",
    apiURL: "https://api.ekycsolutions.com",
  ));
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    Permission.camera.request();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatefulWidget {
  const HomeScreen({Key? key}) : super(key: key);
  @override
  State<HomeScreen> createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  LivenessDetectionResult? r;

  Future<void> onLivenessTestCompleted(LivenessDetectionResult res) async {
    setState(() {
      r = res;
    });
  }

  @override
  Widget build(BuildContext context) {
    var options = LivenessDetectionOptions();
    return Scaffold(
      body: Stack(
        children: [
          Positioned.fill(
            child: LivenessDetectionView(
              options: options,
              overlayBuilder: (
                context,
                frameStatus,
                countDown,
                progress,
                activePrompt,
                isFocusing,
              ) {
                return LivenessOverlayMinimal(
                  options: options,
                  frameStatus: frameStatus,
                  progress: progress,
                  promptTimer: countDown,
                  isFocusing: isFocusing,
                  activePrompt: activePrompt,
                );
              },
              onLivenessTestCompleted: onLivenessTestCompleted,
            ),
          ),
          if (r?.frontFace?.image != null)
            Positioned(
              left: 0,
              top: 0,
              child: Container(
                color: Colors.red,
                height: 100,
                width: 100,
                child: Image.memory(r!.frontFace!.image),
              ),
            )
        ],
      ),
    );
  }
}
6
likes
110
points
854
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter Plugin to interact with EkycID.

Homepage
Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

dio, flutter, flutter_font_icons, flutter_spinkit, flutter_web_plugins, http_parser, just_audio, vibration

More

Packages that depend on ekyc_id_flutter