📸 Capture & Match
- ID + selfie capture via device camera.
- Face match between ID face and live selfie.
- Legal-age decision (18/21/custom) with clear messaging.
ID & Face Verification
Legal Age is a modern, agency-ready mobile app to verify legal age and confirm identity by comparing an ID photo to a live selfie. The app supports dual cloud providers (AWS + Azure) with automatic failover, keeping secrets on the server side for security and compliance.
Everything you need for age & ID verification in one Flutter app.
CompareFaces & DetectFaces.verify & detect?returnFaceAttributes=age.Clean separation between Flutter app, proxy services, and cloud providers.
main.dart — app entry, global error handling, theming.id_scanner_app.dart — shell with a private navigator.id_scanner_home_page.dart — home with quick actions.main_screen.dart — guided overview and entry to verification.face_verification_screen.dart — capture, verify, results.settings_screen.dart — provider, threshold, and runtime overrides.Data Flow
Camera (ID & Selfie) → Flutter App → Your Proxy API (AWS or Azure). On failure,
the orchestrator falls back to the secondary provider and returns normalized results:
{ matched, confidence, estimatedAge, ageConfidence, provider }.
dependencies:
flutter:
sdk: flutter
http: ^1.2.2
image_picker: ^1.1.2
google_fonts: ^6.2.1
shared_preferences: ^2.3.2
Environment-agnostic builds using --dart-define and runtime overrides.
| Dart Define | Example | Purpose |
|---|---|---|
AWS_API_BASE |
https://abc.execute-api.us-east-1.amazonaws.com/prod |
API Gateway base URL for AWS Lambdas. |
AZURE_FN_BASE |
https://your-fn.azurewebsites.net |
Azure Function App base URL. |
AZURE_FN_CODE |
... (optional) |
Function key if required by your auth level. |
AUTH_BEARER |
eyJhbGciOiJI... |
JWT/ID token header for your gateways (optional). |
PRIMARY_PROVIDER |
aws or azure |
Default provider preference. |
All of these can be overridden at runtime via the Settings screen and persisted using
SharedPreferences.
Info.plist<key>NSCameraUsageDescription</key>
<string>Camera is used to capture ID photos and selfies for verification.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo library access is used to pick images for verification.</string>
AWS + Azure patterns ready for your infrastructure team.
IAM Role policy (Lambda):
{
"Version": "2012-10-17",
"Statement": [
{"Effect":"Allow","Action":["rekognition:CompareFaces","rekognition:DetectFaces"],"Resource":"*"},
{"Effect":"Allow","Action":["s3:GetObject"],"Resource":"*"}
]
}
POST /compare, POST /detect.idImage, selfieImage, or image.Sample tests:
curl -X POST "$AWS_API_BASE/compare" \
-F idImage=@id.jpg -F selfieImage=@selfie.jpg
curl -X POST "$AWS_API_BASE/detect" \
-F image=@selfie.jpg
flutter pub get
flutter run \
--dart-define=AWS_API_BASE=https://abc.execute-api.us-east-1.amazonaws.com/prod \
--dart-define=AZURE_FN_BASE=https://your-fn.azurewebsites.net \
--dart-define=PRIMARY_PROVIDER=aws
flutter build apk --release \
--dart-define=AWS_API_BASE=... \
--dart-define=AZURE_FN_BASE=... \
--dart-define=PRIMARY_PROVIDER=aws
# or:
# flutter build appbundle --release ...
flutter build ios --release \
--dart-define=AWS_API_BASE=... \
--dart-define=AZURE_FN_BASE=... \
--dart-define=PRIMARY_PROVIDER=azure
# Then archive/sign in Xcode as usual
matched=true, high confidence.matched=false, estimatedAge=null.--dart-define or Settings.AZURE_FN_CODE or JWT auth.Share a bit about your organization, compliance requirements, and how you plan to use Legal Age. We’ll follow up with a detailed technical brief and next steps.