FacePing class

FacePing on this device: enrol a face (in the sandbox), then verify it with a live check, with no network.

final faceping = await FacePing.init(sandboxKey: 'fp_test_…');
await faceping.enroll('me', photo);                    // sandbox: once, on the device
final result = await faceping.verifyLive('me', camera); // any time, with no network
if (result.isMatch) { … }

Setup problems throw FacePingSetupException and model problems FacePingModelException; see FacePingException for the rest. Face checks never throw for what they find: they return an outcome.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isSandbox → bool
True with a sandbox key: faces are enrolled and kept on this device.
no setter
options → FacePingOptions
The options FacePing was set up with.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
synced → Stream<SyncResult>
Every sync, automatic or not.
no setter

Methods

close() → Future<void>
Stops automatic sync and frees the engine. current is cleared; call init again to start over.
enroll(String id, FaceImage photo) → Future<EnrollResult>
Sandbox only: enrols a face on this device under id, replacing any face already there.
enrolledIds() → Future<Set<String>>
Who can be verified on this device, as of the last enrol, forget or sync.
forget(String id) → Future<bool>
Sandbox: deletes the face stored under id from this device now. Returns false if there was none.
forgetAll() → Future<void>
Deletes every face on this device now. In production the next sync brings back the people still enrolled.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sync() → Future<SyncResult>
Production: downloads the latest faces for this device's check-in list; a revoked device wipes its faces. Sandbox: activates the key, or renews its licence when due.
toString() → String
A string representation of this object.
inherited
unpair() → Future<void>
Unpairs this device: deletes every face on it and forgets the check-in list it synced, so it can start again with any device token (close, then FacePing.init with the new one).
verify(String id, FaceImage photo, {String? nonce}) → Future<VerifyResult>
One photo against the face enrolled under id, with passive liveness only.
verifyLive(String id, FacePingCameraController camera, {String? nonce}) → Future<VerifyResult>
A live check on the camera: match, a head turn in a random direction, match again.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

current → FacePing
The app's FacePing, for code that doesn't keep the instance. Throws StateError until init has completed.
no setter
currentOrNull → FacePing?
The app's FacePing, or null until init has completed (and after close).
no setter
sdkVersion → Future<String>
The version of the native FacePing SDK in this app.
no setter

Static Methods

init({String? sandboxKey, String? deviceToken, FacePingRegion region = FacePingRegion.eu}) → Future<FacePing>
Sets FacePing up for this app and starts loading the face models in the background. Completes at once.
initWithOptions(FacePingOptions options) → Future<FacePing>
init with every option.