setThreshold method

Future<void> setThreshold(
  1. double threshold
)

Sets the security threshold for the Smartface Mobile platform.

This method takes a threshold value, multiplies it by 100, and formats it to two decimal places. The formatted value is then parsed back to a double and passed to the native method 'SmartfaceMobile.setSecurityLevel' as an argument.

The threshold parameter is a double representing the desired security level.

Example:

await setThreshold(0.75);

This will set the security level to 75.00.

Throws an exception if the native method invocation fails.

  • Parameter threshold: The security threshold to be set.

Implementation

Future<void> setThreshold(double threshold) async {
  final floatThreshold = (threshold * 100).toStringAsFixed(2);
  final parsedThreshold = double.parse(floatThreshold).toDouble();
  final _ = await invokeNativeMethod('SmartfaceMobile.setSecurityLevel', {
    'arg0': parsedThreshold,
  });
}