usesmileid_kamera 1.0.6
usesmileid_kamera: ^1.0.6 copied to clipboard
Smile ID's purpose-built camera SDK for Flutter. A thin wrapper embedding the native kamera cores (kamera-android / kamera-ios). Pixels never cross the bridge.
kamera-flutter #
The Flutter SDK for kamera — a thin, faithful wrapper that embeds the native kamera cores (kamera-android, kamera-ios). It replaces the third-party camera plugin used by the production Smile ID Flutter SDK today.
What this is #
- A Flutter plugin (
kamera) whose Android artifact depends onkamera-androidand whose iOS pod/xcframework depends onkamera-ios. Nocameraplugin, no third-party camera code. - Preview via the texture layer (
Texturewidget fed by aSurfaceTexture/FlutterTexturethe native core renders into) — the fast path on low-end devices; no hybrid composition. - Control plane via Pigeon-generated type-safe channels (
pigeons/kamera_api.dart): configuration, lifecycle, capture, zoom/torch/focus, plus an event stream for analysis results and session state. - Pixels never cross the bridge. Frame analysis (ML Kit / Vision through the frozen
Analyzerpattern) runs natively; Dart receives events (face box, document corners, quality signals) and capture file paths only. The currentCameraImage → YuvFrame → bridgecopy path in the production SDK disappears entirely.
Goals #
- Give Flutter exactly the native camera behavior — pinned resolutions, ZSL/MaxQuality capture, tuned defaults — instead of
ResolutionPreset.mediumbest-effort. - One Dart API (
KameraSession,KameraPreviewView,KameraConfig) mirroring the shared contract in../SPEC.md§3. - Serve as the ML staging ground for Flutter:
sample/renders native analysis events live so ML experiments validate here before the production Flutter SDK.
Layout #
lib/ Dart API (KameraSession, KameraPreviewView, KameraConfig, events)
pigeons/ Pigeon API definitions (codegen source of truth)
android/ Thin glue → kamera-android
ios/usesmileid_kamera/ Thin glue → kamera-ios (SPM package; no podspec — see docs/design/18)
sample/ Sample app — texture preview, analysis event overlay, capture
ML backend toggle #
The Android glue defaults to the ML Kit adapter; switch with one flag
(docs/design/20 D4): -PkameraMlBackend=huawei (or KAMERA_ML_BACKEND=huawei) puts
com.usesmileid:kamera-huawei on the host classpath and injects the HMS repo —
none adds no adapter. iOS pairs with Vision (KameraVision); HMS ML is
Android-only, a documented platform divergence.
Local development #
Wire the glue to locally built cores — Android via publishToMavenLocal, iOS via
locally built xcframeworks. Walkthrough: ../docs/local-dev.md.
Requirements #
Dart ^3.11.0 · Flutter stable · androidMinSdk 24 · iOS 15.0 (matches the production Smile ID Flutter SDK)
Status #
Bootstrapping — Dart API stubs and Pigeon definitions in place. See ../SPEC.md §6.3 and milestones §9.