udid_plugin 0.0.1 udid_plugin: ^0.0.1 copied to clipboard
udid plugin.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:udid_plugin/udid_plugin.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
Future<Null> startLivenessFlow() async {
Map result = await UdidPlugin.startLivenessFlow({"engineArg": ""});
print(result.toString());
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: ListView(
padding: EdgeInsets.fromLTRB(20, 40, 20, 20),
children: <Widget>[
new RaisedButton(
padding: EdgeInsets.only(top: 15, bottom: 15),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
UdidPlugin.startOCRFlow({"": ""});
},
child: Center(
// height: 44,
child: Text("OCR"),
),
),
new Padding(
padding: EdgeInsets.only(top: 10),
),
new RaisedButton(
padding: EdgeInsets.only(top: 15, bottom: 15),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
startLivenessFlow();
},
child: Center(
// height: 44,
child: Text("活体检测"),
),
),
new Padding(
padding: EdgeInsets.only(top: 10),
),
new RaisedButton(
padding: EdgeInsets.only(top: 15, bottom: 15),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
UdidPlugin.startIDAuthFlow({"engineArg": ""});
},
child: Center(
// height: 44,
child: Text("身份认证"),
),
),
new Padding(
padding: EdgeInsets.only(top: 10),
),
new RaisedButton(
padding: EdgeInsets.only(top: 15, bottom: 15),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
UdidPlugin.startCompareFlow({"engineArg": ""});
},
child: Center(
// height: 44,
child: Text("人脸比对"),
),
),
new Padding(
padding: EdgeInsets.only(top: 10),
),
new RaisedButton(
padding: EdgeInsets.only(top: 15, bottom: 15),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
UdidPlugin.startVideoFlow({"engineArg": ""});
},
child: Center(
// height: 44,
child: Text("视频存证"),
),
),
new Padding(
padding: EdgeInsets.only(top: 10),
),
new RaisedButton(
padding: EdgeInsets.only(top: 15, bottom: 15),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
UdidPlugin.startCustomFlow({"engineArg": ""});
},
child: Center(
// height: 44,
child: Text("组合流程(身份认证+活体+比对)"),
),
),
new Padding(
padding: EdgeInsets.only(top: 10),
),
new RaisedButton(
padding: EdgeInsets.only(top: 15, bottom: 15),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {},
child: Center(
// height: 44,
child: Text("拍照"),
),
),
],
),
),
);
}
}