openCSLiveness method

  1. @override
Future<CSLivenessResult> openCSLiveness({
  1. String? accessToken,
  2. String? transactionId,
  3. String? clientId,
  4. String? clientSecretId,
  5. String? identifierId,
  6. String? cpf,
  7. bool? vocalGuidance,
  8. Color? primaryColor,
  9. Color? secondaryColor,
  10. Color? titleColor,
  11. Color? paragraphColor,
})
override

Implementation

@override
Future<CSLivenessResult> openCSLiveness(
    {String? accessToken,
    String? transactionId,
    String? clientId,
    String? clientSecretId,
    String? identifierId,
    String? cpf,
    bool? vocalGuidance,
    Color? primaryColor,
    Color? secondaryColor,
    Color? titleColor,
    Color? paragraphColor}) async {
  final Map<String, dynamic>? response =
      await methodChannel.invokeMapMethod('openCSLiveness', {
    "accessToken": accessToken,
    "transactionId": transactionId,
    "clientId": clientId,
    "clientSecretId": clientSecretId,
    "identifierId":
        identifierId != null && identifierId.isNotEmpty ? identifierId : null,
    "cpf": cpf != null && cpf.isNotEmpty ? cpf : null,
    "vocalGuidance": vocalGuidance == true,
    "primaryColor": primaryColor?.toHexString(enableAlpha: false),
    "secondaryColor": secondaryColor?.toHexString(enableAlpha: false),
    "titleColor": titleColor?.toHexString(enableAlpha: false),
    "paragraphColor": paragraphColor?.toHexString(enableAlpha: false)
  });

  if (response != null) {
    return CSLivenessResult.fromJson(
        response.cast().map((k, v) => MapEntry(k.toString(), v)));
  }

  throw "No response from native side";
}