faceVerify method
/faceVerify ml api
Implementation
Future<bool> faceVerify(img, front) async {
String frontBase64File = '';
if (front != null) {
List<int> bytes = await front.readAsBytes();
frontBase64File = base64Encode(bytes);
}
Response response;
var payload = {
"live": img,
"id": frontBase64File,
"ref_no": "${DateTime.now().microsecond}"
};
try {
final dio = apiClient();
var data = dio.then((value) async {
response = await value.post(UrlResources.getFaceVerify, data: payload);
if (response.statusCode == 200) {
return true;
} else {
throw Exception("Face verification failed");
}
});
return data;
} catch (e) {
throw Exception("something went wrong ,try again");
}
}