yuz_id 0.0.6-dev.3 copy "yuz_id: ^0.0.6-dev.3" to clipboard
yuz_id: ^0.0.6-dev.3 copied to clipboard

YuzID official library for users

example/lib/main.dart

import 'dart:convert';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:yuz_id/yuz_id.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? photoData;

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

  Future<String?> runYuzID() async {

    try {
      photoData = await YuzID.instance.runYuzID(lang: "uz");
      print("////////////////////////\n$photoData\n////////////////////////");
      setState(() {});
    } catch (e) {
      photoData = "";
      print("Something went wrong: $e");
    }

    return photoData;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisSize: MainAxisSize.max,
            children: [
              if(photoData != null && photoData != "-1") Image.memory(
                height: 200,
                base64Decode(photoData!),
                fit: BoxFit.contain,
              ),
              const SizedBox(height: 20,),
              InkWell(
                onTap: () async {
                  if (kDebugMode) {
                    runYuzID();
                  }
                },
                  child: const Padding(
                    padding: EdgeInsets.all(8.0),
                    child: Text('YuzID'),
                  ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
0
points
101
downloads

Publisher

unverified uploader

Weekly Downloads

YuzID official library for users

Repository
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on yuz_id

Packages that implement yuz_id