aiyl_myid 1.0.2 copy "aiyl_myid: ^1.0.2" to clipboard
aiyl_myid: ^1.0.2 copied to clipboard

Aiyl SDK plugin for Flutter. Package supports iOS and Android to verify users identity.

example/lib/main.dart

import 'dart:async';

import 'package:aiyl_myid/aiyl_myid_config.dart';
import 'package:aiyl_myid/aiyl_myid.dart';
import 'package:aiyl_myid/aiyl_myid_enums.dart';
import 'package:flutter/material.dart';

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

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

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

class _MyAppState extends State<MyApp> {
  String? _error;
  AiylResult? _result;

  Future<void> init() async {
    String? error;
    AiylResult? result;

    try {
      final aiylResult = await AiylClient.start(
          config: AiylConfig(
        entryMode: AiylEntryMode.selfieOnly,
        locale: AiylLocale.english,
      ));

      error = null;
      result = aiylResult;
    } catch (e) {
      error = e.toString();
      result = null;
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _error = error;
      _result = result;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Aiyl Sample'),
        ),
        body: Center(
          child: Column(
            children: [
              MaterialButton(
                onPressed: init,
                child: const Text('Start SDK'),
              ),
              Text(_result?.videoPath ?? _error ?? 'Failure'),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
140
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

Aiyl SDK plugin for Flutter. Package supports iOS and Android to verify users identity.

Repository

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on aiyl_myid

Packages that implement aiyl_myid