When to use Trustchex Flutter Sdk
Trustchex Flutter SDK brings enterprise‑grade identity verification and biometric authentication to any Flutter application. The package bundles native iOS and Android libraries that can capture passports, driver’s licences, identity cards, and other government‑issued documents, extract MRZ or barcode data, and run on‑device OCR to return structured information. In addition to document handling, the SDK offers real‑time face detection, liveness checks, and optional NFC/eID reading for passports equipped with chips. All results are delivered through a clean, asynchronous Dart API, allowing developers to combine verification steps in a single user flow or split them across multiple screens.
The SDK shines in regulated industries where Know‑Your‑Customer (KYC) or anti‑fraud checks are mandatory. FinTech apps can verify new users in seconds, travel platforms can confirm passport authenticity before boarding, and health‑care portals can ensure that only verified patients gain access to sensitive records. Because the heavy lifting happens on the device, latency is minimal and user experience remains smooth, even on low‑bandwidth connections. The package also supports optional server‑side validation, enabling you to send encrypted verification payloads to your backend for compliance logging.
From an architectural standpoint, Trustchex Flutter SDK is designed to be a thin presentation layer that can be dropped into any state‑management solution. The SDK exposes streams and futures that fit naturally into BLoC, Provider, Riverpod, or GetX patterns, while still being usable with vanilla setState for quick prototypes. It does not dictate a backend; you can forward the verification tokens to any REST, GraphQL, or gRPC endpoint. The SDK also respects platform‑specific permissions, prompting the user for camera, microphone, and NFC access only when required, which aligns well with clean‑architecture approaches that keep UI logic separate from permission handling.
Getting started is straightforward. After adding the package with `flutter pub add trustchex_flutter_sdk`, run `flutter pub get` and follow the platform‑specific setup steps: add the required iOS permissions to `Info.plist`, declare NFC usage in Android's `AndroidManifest.xml`, and ensure that the minimum SDK versions meet the native library requirements (iOS 12+, Android API 21+). The SDK provides a `Trustchex.initialize()` call that loads native resources and returns a future indicating readiness. Once initialized, you can launch the built‑in UI widgets such as `DocumentScanner`, `FaceLivenessView`, or `NfcReaderView`, or embed the lower‑level camera streams into custom widgets for a fully branded experience.
While the SDK is powerful, production deployments should consider a few cautions. First, biometric data never leaves the device unless you explicitly send it to a backend, so you must comply with GDPR, CCPA, or other regional privacy regulations. Second, the SDK relies on device hardware – older phones without NFC or with low‑resolution cameras may experience degraded accuracy, so implement graceful fallbacks. Finally, the package is licensed per verification transaction; monitor usage and handle error codes that indicate quota limits. For beginners, the included `example/` project demonstrates a complete onboarding flow: initialize the SDK, capture a passport, run a liveness check, and send the verification token to a mock server. This pattern can be adapted to any Flutter app that needs secure, on‑device identity proofing.
Pros
- comprehensive identity suite
- cross‑platform native performance
- on‑device processing reduces latency
- flexible integration with any state manager
- supports NFC/eID for passport chips
Watch outs
- requires camera/NFC hardware
- privacy compliance must be handled by developer
- transaction‑based licensing
- no official Google support
Setup notes
1. Add the dependency: `flutter pub add trustchex_flutter_sdk` 2. Run `flutter pub get` 3. iOS: add camera, microphone, and NFC usage descriptions to `Info.plist` 4. Android: add `CAMERA`, `RECORD_AUDIO`, and `NFC` permissions to `AndroidManifest.xml` 5. Ensure min iOS version 12.0 and Android API level 21 or higher 6. Call `await Trustchex.initialize()` before using any widget
Supports Flutter 3.0+ on iOS 12+ and Android API 21+. Requires devices with a camera; NFC features need hardware support. Works with both ARM and x86 simulators, but NFC is unavailable on simulators.
import 'package:flutter/material.dart';
import 'package:trustchex_flutter_sdk/trustchex_flutter_sdk.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Trustchex.initialize();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Trustchex Demo')),
body: Center(
child: ElevatedButton(
onPressed: () async {
final result = await Trustchex.startDocumentScan(
context: context,
documentType: DocumentType.passport,
);
if (result != null) {
// Send result.token to your backend for verification
debugPrint('Verification token: ${result.token}');
}
},
child: const Text('Scan Passport'),
),
),
),
);
}
}