blusalt_liveness_native 0.0.2 copy "blusalt_liveness_native: ^0.0.2" to clipboard
blusalt_liveness_native: ^0.0.2 copied to clipboard

Liveness SDK for Android and IOS

example/lib/main.dart

import 'package:blusalt_liveness_native/enums.dart';
import 'package:blusalt_liveness_native/liveness.dart';
import 'package:blusalt_liveness_native/model.dart';
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _livenessPlugin = BlusaltLivenessNative();
  final String clientId = "";
  final String appName = "";
  final String apiKey = "";
  final bool isDev = true;

  @override
  void initState() {
    super.initState();

    startSDK();
  }

  Future<BlusaltLivenessResultResponse?> startSDK() async {
    BlusaltLivenessResultResponse? response =
        await _livenessPlugin.startLivenessDetectionOnlySDK(
            apiKey: apiKey, appName: appName, clientId: clientId, isDev: isDev);

    return response;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on'),
        ),
      ),
    );
  }
}