getThreshold method
Retrieves the security threshold from the native platform.
This method invokes the native method 'SmartfaceMobile.getSecurityLevel' to get the security level. If the response indicates an error (left side), it returns 0. Otherwise, it returns the security level divided by 100.
Returns: A Future that completes with the security threshold as a double.
Implementation
Future<double> getThreshold() async {
final response =
await invokeNativeMethod('SmartfaceMobile.getSecurityLevel');
if (response.isLeft()) {
return 0;
}
return response.asRight / 100;
}