submitLiveliness method
submit/liveliness token return
Implementation
Future<SubmitResponse> submitLiveliness(imageList) async {
final dio = apiClient();
Response response;
var payload = {
"livelinessImage": imageList,
"dataSource": "",
"issueCountry": "644b373960d64aec0123a093"
};
try {
var data = dio.then((value) async {
response =
await value.post(UrlResources.submitLiveliness, data: payload);
if (response.statusCode == 200) {
SubmitResponse results = SubmitResponse.fromMap(response.data);
accessToken = results.token;
return results;
} else {
throw Exception("Documents uploading failed");
}
}).catchError((e) {
throw Exception(e);
});
return data;
} on DioError catch (_, e) {
throw Exception(e);
}
}