11/20/1
This commit is contained in:
@@ -284,6 +284,7 @@ class ScanDocumentsByApi extends GetxController {
|
||||
///
|
||||
|
||||
Future<void> scanDocumentsByApi() async {
|
||||
String? visionApi = await storage.read(key: BoxName.visionApi);
|
||||
// Pick an image from the camera or gallery
|
||||
image = await imagePicker.pickImage(source: ImageSource.camera);
|
||||
|
||||
@@ -294,7 +295,7 @@ class ScanDocumentsByApi extends GetxController {
|
||||
|
||||
isLoading = true;
|
||||
update();
|
||||
var headers = {'X-BLOBR-KEY': AppCredintials.visionApi};
|
||||
var headers = {'X-BLOBR-KEY': visionApi.toString()};
|
||||
var request = http.MultipartRequest('POST',
|
||||
Uri.parse('https://api.faceonlive.com/j2y3q25y1b6maif1/api/iddoc'));
|
||||
request.files.add(await http.MultipartFile.fromPath('image', image!.path));
|
||||
@@ -398,6 +399,7 @@ class ScanDocumentsByApi extends GetxController {
|
||||
|
||||
Map res = {};
|
||||
Future matchFaceApi() async {
|
||||
String? visionApi = await storage.read(key: BoxName.visionApi);
|
||||
imageFace = await imagePicker.pickImage(
|
||||
source: ImageSource.camera,
|
||||
preferredCameraDevice: CameraDevice.front,
|
||||
@@ -409,7 +411,7 @@ class ScanDocumentsByApi extends GetxController {
|
||||
}
|
||||
final imageFile = File(imageFace!.path);
|
||||
// Uint8List imageBytes = await imageFile.readAsBytes();
|
||||
var headers = {'X-BLOBR-KEY': AppCredintials.visionApi};
|
||||
var headers = {'X-BLOBR-KEY': visionApi.toString()};
|
||||
var request = http.MultipartRequest(
|
||||
'POST',
|
||||
Uri.parse(
|
||||
@@ -484,6 +486,8 @@ class ScanDocumentsByApi extends GetxController {
|
||||
// Todo upload images and fields
|
||||
|
||||
Future<String> uploadImage(File imageFile) async {
|
||||
String? basicAuthCredentials =
|
||||
await storage.read(key: BoxName.basicAuthCredentials);
|
||||
var request = http.MultipartRequest(
|
||||
'POST',
|
||||
Uri.parse(AppLink.uploadImage),
|
||||
@@ -496,7 +500,7 @@ class ScanDocumentsByApi extends GetxController {
|
||||
request.headers.addAll({
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
'Authorization':
|
||||
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||
'Basic ${base64Encode(utf8.encode(basicAuthCredentials.toString()))}',
|
||||
});
|
||||
|
||||
// Add the driverID to the request
|
||||
|
||||
Reference in New Issue
Block a user