flutter_tflite_web
A Flutter package for identity validation using TensorFlow Lite with document and face detection. Supports DNI capture and selfie validation for web platforms.
Features
- Document detection (DNI front and back)
- Face detection and selfie capture
- Identity validation through face matching
- TensorFlow Lite integration for web
- BLoC state management for validation flow
Platform Support
| Platform | Supported |
|---|---|
| Web | ✅ |
| Android | ❌ |
| iOS | ❌ |
| macOS | ❌ |
| Windows | ❌ |
| Linux | ❌ |
Installation
Add this to your pubspec.yaml:
dependencies:
flutter_tflite_web: ^2.0.0
Then run:
flutter pub get
Usage
Basic Setup
import 'package:flutter_tflite_web/flutter_tflite_web.dart';
// Initialize the ReconocimientoBloc
BlocProvider<ReconocimientoBloc>(
create: (context) => ReconocimientoBloc(apiRest: apiRest),
child: YourWidget(),
)
Start Validation Process
context.read<ReconocimientoBloc>().add(OnInitReconocimiento());
Listen to Validation State
BlocConsumer<ReconocimientoBloc, ReconocimientoState>(
listener: (context, state) {
if (state.accion == ReconocimientoBloc.onOnFinalizaProcesoReconocimiento) {
// Validation completed
}
},
builder: (context, state) {
return YourUI();
},
)
Assets
The package includes TensorFlow Lite model files in the assets/ directory:
detect.tflite- Detection modellabelmap.txt- Model labels
Dependencies
This package depends on:
flutter_bloc- State managementequatable- Value equalitygo_router- Navigationcamera- Camera accessimage- Image processing
License
MIT License - see LICENSE file for details.