idflow_myid 1.0.1 copy "idflow_myid: ^1.0.1" to clipboard
idflow_myid: ^1.0.1 copied to clipboard

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

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:idflow_myid/idflow_config.dart';
import 'package:idflow_myid/idflow_enums.dart';
import 'package:idflow_myid/idflow_myid.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;
  IDFlowResult? _result;

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

    try {
      final idflowResult = await IDFlowClient.start(
          config: IDFlowConfig(
            entryMode: IDFlowEntryMode.selfieOnly,
            locale: IDFlowLocale.kyrgyz,
          ));

      error = null;
      result = idflowResult;
    } 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('IDFlow Sample'),
        ),
        body: Center(
          child: Column(
            children: [
              MaterialButton(
                onPressed: init,
                child: const Text('Start SDK'),
              ),
              Text(_result?.personalNumber ?? _error ?? 'Failure'),
              Text(_result?.idSeriesNumber ?? _error ?? 'Failure'),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
140
points
22
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

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

Repository
View/report issues

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on idflow_myid

Packages that implement idflow_myid