6/22/1
This commit is contained in:
@@ -90,7 +90,6 @@ class EgyptCardAI extends StatelessWidget {
|
||||
right: 30,
|
||||
left: 30,
|
||||
child: GetBuilder<AI>(builder: (controller) {
|
||||
print(controller.approved);
|
||||
return controller.approved == false
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
@@ -641,8 +640,6 @@ class EgyptCardAI extends StatelessWidget {
|
||||
return GetBuilder<AI>(
|
||||
builder: (ai) {
|
||||
if (ai.responseIdCardDriverEgyptBack.isNotEmpty) {
|
||||
// print(ai.responseIdCardDriverEgyptBack);
|
||||
|
||||
// Get the tax expiry date from the response
|
||||
final taxExpiryDate = ai.responseIdCardDriverEgyptBack['tax_expiry'];
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ class GeminiEgypt extends GetxController {
|
||||
},
|
||||
]
|
||||
});
|
||||
// print(requestBody);
|
||||
|
||||
final response = await http.post(
|
||||
Uri.parse(
|
||||
@@ -59,12 +58,8 @@ class GeminiEgypt extends GetxController {
|
||||
if (response.statusCode == 200) {
|
||||
var responseData = jsonDecode(response.body);
|
||||
// Process the responseData as needed
|
||||
// print(responseData);
|
||||
|
||||
var result = responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||
// print(jsonEncode(result));
|
||||
// print((result));
|
||||
// print(result['dob']);
|
||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||
String? jsonString =
|
||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||
@@ -72,22 +67,14 @@ class GeminiEgypt extends GetxController {
|
||||
if (jsonString != null) {
|
||||
// Convert the JSON object to a String
|
||||
jsonString = jsonEncode(json.decode(jsonString));
|
||||
// print(jsonString);
|
||||
responseIdCardDriverEgypt1 = jsonString;
|
||||
|
||||
// print(jsonDecode(responseIdCardDriverEgypt1!));
|
||||
responseIdCardDriverEgypt = jsonDecode(responseIdCardDriverEgypt1!);
|
||||
print(responseIdCardDriverEgypt);
|
||||
update();
|
||||
return responseIdCardDriverEgypt;
|
||||
} else {
|
||||
print("JSON string not found");
|
||||
}
|
||||
} else {}
|
||||
|
||||
// Rest of your code...
|
||||
} else {
|
||||
print('Request failed with status: ${response.statusCode}');
|
||||
print('Request failed with status: ${response.body}');
|
||||
}
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user