verisync 0.0.7 verisync: ^0.0.7 copied to clipboard
Verisync is a KYC service that simplifies both client and customers "Know Your Customer " process. This package is intended simplify the integration process in a flutter project. verisync package is s [...]
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:verisync/verisync.dart';
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
var status = await Permission.camera.status;
if (status.isDenied) {
await Permission.camera.request();
} else if (status.isPermanentlyDenied) {
openAppSettings();
}
runApp(const MaterialApp(home: MyApp()));
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Verisync Example'),
),
body: SizedBox(
width: MediaQuery.of(context).size.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () {
showAdaptiveDialog(
context: context,
builder: (BuildContext dialogContext) => VerisyncWidget(
flowId: "<provide your call flowID>",
redirectUrl: "<provide your redirectUrl>",
clientId: "provide your clientID",
email: "provide email",
metadata: const {
"name": "John Doe",
"phone": "1234567890",
},
callbackSuccess: (dialogContext) {
ScaffoldMessenger.of(dialogContext).showSnackBar(
const SnackBar(
content: Text("Verification successful"),
duration: Duration(seconds: 3),
),
);
},
),
);
},
child: const Text('Verify your identity'),
),
],
),
));
}
}