FallbackVerificationProvider class

A verification provider that tries a primary provider first and falls back to fallback when the primary fails.

Useful for remote-first setups where the cloud provider should be tried first, with on-device verification as a safety net:

final provider = FallbackVerificationProvider(
  primary: FaceGateCloudProvider(baseUrl: 'https://api.example.com'),
  fallback: LocalFaceVerificationProvider(),
);
Implemented types

Constructors

FallbackVerificationProvider({required FaceVerificationProvider primary, required FaceVerificationProvider fallback, void onFallback(Object error, StackTrace stack)?})

Properties

fallback FaceVerificationProvider
The backup provider used when primary throws.
final
hashCode int
The hash code for this object.
no setterinherited
onFallback → void Function(Object error, StackTrace stack)?
Optional callback invoked when the fallback is used. Receives the error and stack trace from the primary.
final
primary FaceVerificationProvider
The preferred provider tried first.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkLiveness(Face face) Future<LivenessResult>
Check a face for liveness (anti-spoofing).
override
clearAll() Future<void>
Delete all enrolled templates.
override
deleteTemplate(String id) Future<void>
Delete an enrolled template by ID.
override
enroll(String label, List<Face> samples) Future<FaceTemplate>
Enroll a new face from multiple sample captures.
override
listTemplates() Future<List<FaceTemplate>>
List all enrolled templates.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
verify(Face face) Future<FaceVerificationResult>
Verify a detected face against enrolled templates.
override

Operators

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