11/21/1
This commit is contained in:
4
.env
4
.env
@@ -9,4 +9,6 @@ transactionCloude=Qhcwilomqcoib:QVO_JNYED2XWA26YXKC2TP:YK1DVH6SJB31N3PE1UXrXlBl
|
|||||||
visionApi=3vQRyaYYSWpmv69A58ZOkxmeK6M1mgwEDlXrXlBl
|
visionApi=3vQRyaYYSWpmv69A58ZOkxmeK6M1mgwEDlXrXlBl
|
||||||
chatGPTkeySefer=zg-IiR34ooza3Yvhvb9rZk1C9XrxgUE0l8jRRZrHj3Qe5QXPlqVXrXlBl
|
chatGPTkeySefer=zg-IiR34ooza3Yvhvb9rZk1C9XrxgUE0l8jRRZrHj3Qe5QXPlqVXrXlBl
|
||||||
secretKey=zg_cjzc_57I0TCIYNJPlIFQ5ZXkqiZZ28bBULsuMd1Cr5IYztSseaRvf3LdXWT9wwfV94Cv64CM7VAiMi6jWUrrLoAy9lNWVB33Rl8TY9b1XrXlBl
|
secretKey=zg_cjzc_57I0TCIYNJPlIFQ5ZXkqiZZ28bBULsuMd1Cr5IYztSseaRvf3LdXWT9wwfV94Cv64CM7VAiMi6jWUrrLoAy9lNWVB33Rl8TY9b1XrXlBl
|
||||||
stripe_publishableKe=vg_cjzc_57I0TCIYNJPlIFQ5ZB5j2x4vQpU5FVYF9f9Vou74a60BJAQvH5QunMMJB8D1TOqsuOlHCeeh7vHqpnkijRkx9UL5g33vb0iNWKIXrXlBl
|
stripe_publishableKe=vg_cjzc_57I0TCIYNJPlIFQ5ZB5j2x4vQpU5FVYF9f9Vou74a60BJAQvH5QunMMJB8D1TOqsuOlHCeeh7vHqpnkijRkx9UL5g33vb0iNWKIXrXlBl
|
||||||
|
llamaKey=LL-JfdiCXFpcLXNe87cSGQwGE0piZ9Zw179tVjEP1KMxQgVWGxD9Ixz3m8kkKaO5Kdi
|
||||||
|
serverPHP=https://ride.mobile-app.store
|
||||||
@@ -3,10 +3,10 @@ import 'char_map.dart';
|
|||||||
import 'credential.dart';
|
import 'credential.dart';
|
||||||
|
|
||||||
class AK {
|
class AK {
|
||||||
static final AC a = AC(); // Create an instance of AC
|
static final AC a = AC();
|
||||||
|
|
||||||
static final String publishableKey =
|
static final String publishableKey =
|
||||||
a.r(a.r(a.r(Env.stripePublishableKe, cn), cC), cs);
|
AC().r(AC().r(AC().r(Env.stripePublishableKe, cn), cC), cs);
|
||||||
static final String secretKey = a.r(a.r(a.r(Env.secretKey, cn), cC), cs);
|
static final String secretKey = a.r(a.r(a.r(Env.secretKey, cn), cC), cs);
|
||||||
static final String basicAuthCredentials =
|
static final String basicAuthCredentials =
|
||||||
a.r(a.r(a.r(Env.basicAuthCredentials, cn), cC), cs);
|
a.r(a.r(a.r(Env.basicAuthCredentials, cn), cC), cs);
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ class AC {
|
|||||||
if (box.read(BoxName.apiKeyRun).toString() != 'run') {
|
if (box.read(BoxName.apiKeyRun).toString() != 'run') {
|
||||||
var res = await CRUD().get(link: AppLink.getApiKey, payload: {});
|
var res = await CRUD().get(link: AppLink.getApiKey, payload: {});
|
||||||
var decod = jsonDecode(res);
|
var decod = jsonDecode(res);
|
||||||
// print(decod);
|
print(decod);
|
||||||
// Map<String, dynamic> jsonData = {};
|
Map<String, dynamic> jsonData = {};
|
||||||
for (var i = 0; i < decod['message'].length; i++) {
|
for (var i = 0; i < decod['message'].length; i++) {
|
||||||
String h = decod['message'][i]['hashed_key'].toString();
|
String h = decod['message'][i]['hashed_key'].toString();
|
||||||
String retrievedString = r(r(r(h, cn), cC), cs);
|
String retrievedString = r(r(r(h, cn), cC), cs);
|
||||||
@@ -23,13 +23,13 @@ class AC {
|
|||||||
value: retrievedString.toString(),
|
value: retrievedString.toString(),
|
||||||
);
|
);
|
||||||
//
|
//
|
||||||
// String name = decod['message'][i]['name'].toString();
|
String name = decod['message'][i]['name'].toString();
|
||||||
// String value = decod['message'][i]['hashed_key'].toString();
|
String value = decod['message'][i]['hashed_key'].toString();
|
||||||
|
|
||||||
// jsonData[name] = value;
|
jsonData[name] = value;
|
||||||
}
|
}
|
||||||
// String jsonString = json.encode(jsonData);
|
String jsonString = json.encode(jsonData);
|
||||||
// print(jsonString);
|
print(jsonString);
|
||||||
box.write(BoxName.apiKeyRun, 'run');
|
box.write(BoxName.apiKeyRun, 'run');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
import 'package:ride/env/env.dart';
|
||||||
|
|
||||||
class AppLink {
|
class AppLink {
|
||||||
static const String server = 'https://ride.mobile-app.store';
|
static const String server = 'https://ride.mobile-app.store'; //Env.serverPHP;
|
||||||
static const String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
|
static const String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
|
||||||
|
static const String llama = 'https://api.llama-api.com/chat/completions';
|
||||||
|
|
||||||
static const String test = "$server/test.php";
|
static const String test = "$server/test.php";
|
||||||
//===============firebase==========================
|
//===============firebase==========================
|
||||||
@@ -90,7 +93,7 @@ class AppLink {
|
|||||||
"$location/getTotalDriverDurationToday.php";
|
"$location/getTotalDriverDurationToday.php";
|
||||||
|
|
||||||
//==================Blog=============
|
//==================Blog=============
|
||||||
static const String profile = 'https://ride.mobile-app.store/ride/profile';
|
static const String profile = '$server/ride/profile';
|
||||||
static const String getprofile = "$profile/get.php";
|
static const String getprofile = "$profile/get.php";
|
||||||
static const String addprofile = "$profile/add.php";
|
static const String addprofile = "$profile/add.php";
|
||||||
static const String deleteprofile = "$profile/delete.php";
|
static const String deleteprofile = "$profile/delete.php";
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:ride/env/env.dart';
|
||||||
|
|
||||||
import '../../constant/api_key.dart';
|
import '../../constant/api_key.dart';
|
||||||
import '../../constant/box_name.dart';
|
|
||||||
import '../../main.dart';
|
|
||||||
|
|
||||||
class CRUD {
|
class CRUD {
|
||||||
Future<dynamic> get({
|
Future<dynamic> get({
|
||||||
required String link,
|
required String link,
|
||||||
Map<String, dynamic>? payload,
|
Map<String, dynamic>? payload,
|
||||||
}) async {
|
}) async {
|
||||||
String? basicAuthCredentials =
|
// String? basicAuthCredentials =
|
||||||
await storage.read(key: BoxName.basicAuthCredentials);
|
// await storage.read(key: BoxName.basicAuthCredentials);
|
||||||
var url = Uri.parse(
|
var url = Uri.parse(
|
||||||
link,
|
link,
|
||||||
);
|
);
|
||||||
@@ -22,16 +21,19 @@ class CRUD {
|
|||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
'Authorization':
|
'Authorization':
|
||||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
// 'Basic ${base64Encode(utf8.encode('hamzaayedphp:malDEV@2101'))}',
|
||||||
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
|
||||||
// 'Basic ${base64Encode(utf8.encode(basicAuthCredentials.toString()))}',
|
// 'Basic ${base64Encode(utf8.encode(basicAuthCredentials.toString()))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print("--------------" + response.request.toString());
|
//print("-----basicAuthCredentials----" + AK.basicAuthCredentials.toString());
|
||||||
print("--------------" + payload.toString());
|
//print("-----request----" + response.request.toString());
|
||||||
|
//print("-----headers-----" + response.headers.toString());
|
||||||
|
//print("-----payload-----" + payload.toString());
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
// print(jsonData);
|
// //print(jsonData);
|
||||||
|
|
||||||
return response.body;
|
return response.body;
|
||||||
}
|
}
|
||||||
@@ -40,11 +42,45 @@ class CRUD {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<dynamic> getLlama({
|
||||||
|
required String link,
|
||||||
|
required String payload,
|
||||||
|
}) async {
|
||||||
|
var url = Uri.parse(
|
||||||
|
link,
|
||||||
|
);
|
||||||
|
var headers = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer ${Env.llamaKey}'
|
||||||
|
};
|
||||||
|
var data = json.encode({
|
||||||
|
"model": "llama-13b-chat",
|
||||||
|
"messages": [
|
||||||
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content":
|
||||||
|
"Extract the desired information from the following passage as json decoded like vin,make,made,color,owner and all you find in this:\n\n$payload"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"temperature": 0.9
|
||||||
|
});
|
||||||
|
var response = await http.post(
|
||||||
|
url,
|
||||||
|
body: data,
|
||||||
|
headers: headers,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
return response.body;
|
||||||
|
}
|
||||||
|
return response.statusCode;
|
||||||
|
}
|
||||||
|
|
||||||
Future<dynamic> postStripe({
|
Future<dynamic> postStripe({
|
||||||
required String link,
|
required String link,
|
||||||
Map<String, dynamic>? payload,
|
Map<String, dynamic>? payload,
|
||||||
}) async {
|
}) async {
|
||||||
String? secretKey = await storage.read(key: BoxName.secretKey);
|
// String? secretKey = await storage.read(key: BoxName.secretKey);
|
||||||
var url = Uri.parse(
|
var url = Uri.parse(
|
||||||
link,
|
link,
|
||||||
);
|
);
|
||||||
@@ -64,8 +100,8 @@ class CRUD {
|
|||||||
required String link,
|
required String link,
|
||||||
Map<String, dynamic>? payload,
|
Map<String, dynamic>? payload,
|
||||||
}) async {
|
}) async {
|
||||||
String? basicAuthCredentials =
|
// String? basicAuthCredentials =
|
||||||
await storage.read(key: BoxName.basicAuthCredentials);
|
// await storage.read(key: BoxName.basicAuthCredentials);
|
||||||
var url = Uri.parse(
|
var url = Uri.parse(
|
||||||
link,
|
link,
|
||||||
);
|
);
|
||||||
@@ -78,8 +114,8 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.request);
|
//print(response.request);
|
||||||
print(payload);
|
//print(payload);
|
||||||
|
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
@@ -88,7 +124,7 @@ class CRUD {
|
|||||||
jsonData['status'],
|
jsonData['status'],
|
||||||
jsonData['message'],
|
jsonData['message'],
|
||||||
);
|
);
|
||||||
print(response.body);
|
//print(response.body);
|
||||||
return response.body;
|
return response.body;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,8 +135,8 @@ class CRUD {
|
|||||||
required String link,
|
required String link,
|
||||||
Map<String, dynamic>? payload,
|
Map<String, dynamic>? payload,
|
||||||
}) async {
|
}) async {
|
||||||
String? basicAuthCredentials =
|
// String? basicAuthCredentials =
|
||||||
await storage.read(key: BoxName.basicAuthCredentials);
|
// await storage.read(key: BoxName.basicAuthCredentials);
|
||||||
var url = Uri.parse(
|
var url = Uri.parse(
|
||||||
link,
|
link,
|
||||||
);
|
);
|
||||||
@@ -113,9 +149,9 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.request);
|
//print(response.request);
|
||||||
print('body=========================');
|
//print('body=========================');
|
||||||
print(response.body);
|
//print(response.body);
|
||||||
|
|
||||||
if (response.body.isNotEmpty) {
|
if (response.body.isNotEmpty) {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
@@ -145,9 +181,9 @@ class CRUD {
|
|||||||
url,
|
url,
|
||||||
body: payload,
|
body: payload,
|
||||||
);
|
);
|
||||||
print(response.request);
|
//print(response.request);
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
// print(jsonData);
|
// //print(jsonData);
|
||||||
if (jsonData['status'] == 'OK') {
|
if (jsonData['status'] == 'OK') {
|
||||||
return jsonData;
|
return jsonData;
|
||||||
}
|
}
|
||||||
@@ -159,8 +195,8 @@ class CRUD {
|
|||||||
required Map<String, dynamic> data,
|
required Map<String, dynamic> data,
|
||||||
required String id,
|
required String id,
|
||||||
}) async {
|
}) async {
|
||||||
String? basicAuthCredentials =
|
// String? basicAuthCredentials =
|
||||||
await storage.read(key: BoxName.basicAuthCredentials);
|
// await storage.read(key: BoxName.basicAuthCredentials);
|
||||||
var url = Uri.parse('$endpoint/$id');
|
var url = Uri.parse('$endpoint/$id');
|
||||||
var response = await http.put(
|
var response = await http.put(
|
||||||
url,
|
url,
|
||||||
@@ -177,8 +213,8 @@ class CRUD {
|
|||||||
required String endpoint,
|
required String endpoint,
|
||||||
required String id,
|
required String id,
|
||||||
}) async {
|
}) async {
|
||||||
String? basicAuthCredentials =
|
// String? basicAuthCredentials =
|
||||||
await storage.read(key: BoxName.basicAuthCredentials);
|
// await storage.read(key: BoxName.basicAuthCredentials);
|
||||||
var url = Uri.parse('$endpoint/$id');
|
var url = Uri.parse('$endpoint/$id');
|
||||||
var response = await http.delete(
|
var response = await http.delete(
|
||||||
url,
|
url,
|
||||||
|
|||||||
34
lib/controller/functions/llama_ai.dart
Normal file
34
lib/controller/functions/llama_ai.dart
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:ride/constant/links.dart';
|
||||||
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
|
|
||||||
|
class LlamaAi {
|
||||||
|
Future getExractionData(String input) async {
|
||||||
|
print(true);
|
||||||
|
|
||||||
|
String oneLine = input.replaceAll('\n', ' ');
|
||||||
|
var res = await CRUD().getLlama(link: AppLink.llama, payload: oneLine);
|
||||||
|
var decod = jsonDecode(res);
|
||||||
|
// print(decod['choices'][0]['message']['content']);
|
||||||
|
extractDataFromJsonString(decod['choices'][0]['message']['content']);
|
||||||
|
print(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> extractDataFromJsonString(String jsonString) {
|
||||||
|
// Remove any leading or trailing whitespace from the string
|
||||||
|
jsonString = jsonString.trim();
|
||||||
|
|
||||||
|
// Extract the JSON substring from the given string
|
||||||
|
final startIndex = jsonString.indexOf('{');
|
||||||
|
final endIndex = jsonString.lastIndexOf('}');
|
||||||
|
final jsonSubstring = jsonString.substring(startIndex, endIndex + 1);
|
||||||
|
|
||||||
|
// Parse the JSON substring into a Map
|
||||||
|
final jsonData = json.decode(jsonSubstring);
|
||||||
|
|
||||||
|
// Return the extracted data
|
||||||
|
print(jsonData);
|
||||||
|
return jsonData;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,18 +5,17 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||||
import 'package:ride/constant/box_name.dart';
|
|
||||||
import 'package:ride/constant/colors.dart';
|
|
||||||
import 'package:ride/controller/firebase/firbase_messge.dart';
|
|
||||||
import 'package:ride/controller/functions/location_controller.dart';
|
|
||||||
import 'package:ride/main.dart';
|
|
||||||
import 'package:ride/views/Rate/rate_passenger.dart';
|
|
||||||
import 'package:ride/views/home/Captin/home_captin.dart';
|
|
||||||
|
|
||||||
import '../../../constant/api_key.dart';
|
import '../../../constant/api_key.dart';
|
||||||
import '../../../constant/credential.dart';
|
import '../../../constant/box_name.dart';
|
||||||
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/links.dart';
|
import '../../../constant/links.dart';
|
||||||
|
import '../../../main.dart';
|
||||||
|
import '../../../views/Rate/rate_passenger.dart';
|
||||||
|
import '../../../views/home/Captin/home_captin.dart';
|
||||||
|
import '../../firebase/firbase_messge.dart';
|
||||||
import '../../functions/crud.dart';
|
import '../../functions/crud.dart';
|
||||||
|
import '../../functions/location_controller.dart';
|
||||||
|
|
||||||
class MapDriverController extends GetxController {
|
class MapDriverController extends GetxController {
|
||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
|
|||||||
@@ -6,19 +6,19 @@ import 'package:get/get.dart';
|
|||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||||
import 'package:location/location.dart';
|
import 'package:location/location.dart';
|
||||||
import 'package:ride/constant/box_name.dart';
|
|
||||||
import 'package:ride/constant/credential.dart';
|
|
||||||
import 'package:ride/constant/links.dart';
|
|
||||||
import 'package:ride/controller/firebase/firbase_messge.dart';
|
|
||||||
import 'package:ride/controller/functions/crud.dart';
|
|
||||||
import 'package:ride/controller/functions/secure_storage.dart';
|
|
||||||
import 'package:ride/controller/payment/payment_controller.dart';
|
|
||||||
import 'package:ride/views/Rate/rate_captain.dart';
|
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
|
||||||
import '../../constant/api_key.dart';
|
import '../../constant/api_key.dart';
|
||||||
|
import '../../constant/box_name.dart';
|
||||||
|
import '../../constant/info.dart';
|
||||||
|
import '../../constant/links.dart';
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import '../../models/model/locations.dart';
|
import '../../models/model/locations.dart';
|
||||||
|
import '../../views/Rate/rate_captain.dart';
|
||||||
|
import '../../views/widgets/elevated_btn.dart';
|
||||||
|
import '../firebase/firbase_messge.dart';
|
||||||
|
import '../functions/crud.dart';
|
||||||
import '../functions/launch.dart';
|
import '../functions/launch.dart';
|
||||||
|
import '../functions/secure_storage.dart';
|
||||||
|
import '../payment/payment_controller.dart';
|
||||||
|
|
||||||
class MapPassengerController extends GetxController {
|
class MapPassengerController extends GetxController {
|
||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
@@ -140,7 +140,7 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
// Format the message.
|
// Format the message.
|
||||||
String message =
|
String message =
|
||||||
'Hi! This is ${box.read(BoxName.name)}. I am using Sefer to ride with ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} as the driver. ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} is driving a ${dataCarsLocationByPassenger['message'][carsOrder]['model'].toString()} with license plate ${dataCarsLocationByPassenger['message'][carsOrder]['license_plate'].toString()}. I am currently located at $myLocation. If you need to reach me, please contact the driver directly at $driverPhone.';
|
'Hi! This is ${box.read(BoxName.name)}. I am using ${box.read(AppInformation.appName)} to ride with ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} as the driver. ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} is driving a ${dataCarsLocationByPassenger['message'][carsOrder]['model'].toString()} with license plate ${dataCarsLocationByPassenger['message'][carsOrder]['license_plate'].toString()}. I am currently located at $myLocation. If you need to reach me, please contact the driver directly at $driverPhone.';
|
||||||
|
|
||||||
// Launch the URL to send the SMS.
|
// Launch the URL to send the SMS.
|
||||||
launchCommunication('sms', to, message);
|
launchCommunication('sms', to, message);
|
||||||
@@ -153,7 +153,7 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
// Format the message.
|
// Format the message.
|
||||||
String message =
|
String message =
|
||||||
'Hi! This is ${box.read(BoxName.name)}. I am using Sefer to ride with ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} as the driver. ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} is driving a ${dataCarsLocationByPassenger['message'][carsOrder]['model'].toString()} with license plate ${dataCarsLocationByPassenger['message'][carsOrder]['license_plate'].toString()}. I am currently located at $myLocation. If you need to reach me, please contact the driver directly at $driverPhone.';
|
'Hi! This is ${box.read(BoxName.name)}. I am using ${box.read(AppInformation.appName)} to ride with ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} as the driver. ${dataCarsLocationByPassenger['message'][carsOrder]['first_name'].toString()} is driving a ${dataCarsLocationByPassenger['message'][carsOrder]['model'].toString()} with license plate ${dataCarsLocationByPassenger['message'][carsOrder]['license_plate'].toString()}. I am currently located at $myLocation. If you need to reach me, please contact the driver directly at $driverPhone.';
|
||||||
|
|
||||||
// Launch the URL to send the SMS.
|
// Launch the URL to send the SMS.
|
||||||
launchCommunication('whatsapp', to, message);
|
launchCommunication('whatsapp', to, message);
|
||||||
@@ -599,7 +599,7 @@ class MapPassengerController extends GetxController {
|
|||||||
Future getPlaces() async {
|
Future getPlaces() async {
|
||||||
var url =
|
var url =
|
||||||
// '${AppLink.googleMapsLink}place/nearbysearch/json?location=${mylocation.longitude}&radius=25000&language=ar&keyword=&key=${placeController.text}${AK.mapAPIKEY}';
|
// '${AppLink.googleMapsLink}place/nearbysearch/json?location=${mylocation.longitude}&radius=25000&language=ar&keyword=&key=${placeController.text}${AK.mapAPIKEY}';
|
||||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${placeController.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=ar&key=${AK.mapAPIKEY.toString()}';
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${placeController.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
|||||||
if (message.notification!.title == 'Sefer') {}
|
if (message.notification!.title == 'Sefer') {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// late List<CameraDescription> cameras;
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
await GetStorage.init();
|
await GetStorage.init();
|
||||||
|
|||||||
@@ -1,26 +1,27 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:html/parser.dart' show parse;
|
import 'package:ride/controller/functions/llama_ai.dart';
|
||||||
import 'package:ride/constant/api_key.dart';
|
import 'package:ride/env/env.dart';
|
||||||
import 'package:ride/constant/box_name.dart';
|
|
||||||
import 'package:ride/constant/colors.dart';
|
|
||||||
import 'package:ride/constant/info.dart';
|
|
||||||
import 'package:ride/constant/style.dart';
|
|
||||||
import 'package:ride/constant/table_names.dart';
|
|
||||||
import 'package:ride/controller/auth/captin/login_captin_controller.dart';
|
|
||||||
import 'package:ride/main.dart';
|
|
||||||
import 'package:ride/views/auth/captin/register_captin.dart';
|
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
|
||||||
import 'package:ride/views/widgets/my_scafold.dart';
|
|
||||||
|
|
||||||
|
import '../../../constant/api_key.dart';
|
||||||
|
import '../../../constant/box_name.dart';
|
||||||
import '../../../constant/char_map.dart';
|
import '../../../constant/char_map.dart';
|
||||||
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/credential.dart';
|
import '../../../constant/credential.dart';
|
||||||
|
import '../../../constant/info.dart';
|
||||||
|
import '../../../constant/style.dart';
|
||||||
|
import '../../../controller/auth/captin/login_captin_controller.dart';
|
||||||
import '../../../controller/auth/login_controller.dart';
|
import '../../../controller/auth/login_controller.dart';
|
||||||
import '../../../env/env.dart';
|
import '../../../main.dart';
|
||||||
|
import '../../widgets/elevated_btn.dart';
|
||||||
|
import '../../widgets/my_scafold.dart';
|
||||||
import '../../widgets/mycircular.dart';
|
import '../../widgets/mycircular.dart';
|
||||||
|
import 'register_captin.dart';
|
||||||
|
|
||||||
class LoginCaptin extends StatelessWidget {
|
class LoginCaptin extends StatelessWidget {
|
||||||
final controller = Get.put(LoginController());
|
final controller = Get.put(LoginController());
|
||||||
@@ -195,27 +196,32 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
// String v = await storage.read(
|
// String v =
|
||||||
// key: BoxName.basicAuthCredentials) ??
|
// await storage.read(key: BoxName.serverAPI) ?? '';
|
||||||
// '';
|
|
||||||
// print(v);
|
// print(v);
|
||||||
// sql.deleteAllData(TableName.faceDetectTimes);
|
// sql.deleteAllData(TableName.faceDetectTimes);
|
||||||
AC credentials = AC();
|
// AC credentials = AC();
|
||||||
String apiKey = AK.secretKey;
|
// String apiKey = AK.secretKey;
|
||||||
// // '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';
|
// // // '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';
|
||||||
credentials.gAK();
|
// credentials.gAK();
|
||||||
String? apiKeyf =
|
// String? apiKeyf =
|
||||||
await storage.read(key: 'basicAuthCredentials');
|
// await storage.read(key: BoxName.chatGPTkey);
|
||||||
// print(apiKeyf);
|
// print(apiKeyf);
|
||||||
// String convertedString = credentials.c(apiKey, s);
|
// String convertedString = credentials.c(apiKey, s);
|
||||||
// String convertedStrings = credentials.c(apiKey, s);
|
// String convertedStrings = credentials.c(apiKey, s);
|
||||||
// print('Converted String s: $convertedStrings');
|
// print('Converted String s: $convertedStrings');
|
||||||
// String convertedStringC =
|
// String convertedStringC =
|
||||||
// credentials.c(convertedStrings, c);
|
// credentials.c(convertedStrings, c);
|
||||||
// print('Converted String C: $convertedStringC');
|
// print('v: $v');
|
||||||
// String convertedStringN = credentials.c(
|
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
||||||
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
||||||
// print('Converted String N: $convertedStringN');
|
// // String convertedStringN = credentials.c(
|
||||||
|
// credentials.c(
|
||||||
|
// credentials.c(
|
||||||
|
// 'QFx0qy456juj3839xuy2194q629q1fj0y7XrXlBl', cs),
|
||||||
|
// cC),
|
||||||
|
// // cn);
|
||||||
|
// print('Converted v: $convertedStringN');
|
||||||
// //
|
// //
|
||||||
// String retrievedStringN =
|
// String retrievedStringN =
|
||||||
// credentials.r(convertedStringN, n);
|
// credentials.r(convertedStringN, n);
|
||||||
@@ -226,15 +232,74 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
|
|
||||||
// String retrievedStringS = credentials.r(
|
// String retrievedStringS = credentials.r(
|
||||||
// credentials.r(
|
// credentials.r(
|
||||||
// credentials.r(convertedStringN, cn), cC),
|
// credentials.r(
|
||||||
|
// 'QFx0qy456juj3839xuy2194q629q1fj0y7XrXlBl',
|
||||||
|
// cn),
|
||||||
|
// cC),
|
||||||
// cs);
|
// cs);
|
||||||
// print('Retrieved String: $retrievedStringS');
|
// print('Retrieved String: $retrievedStringS');
|
||||||
|
|
||||||
// if (retrievedStringS == apiKey) {
|
// if (retrievedStringS == apiKey) {
|
||||||
// print('same');
|
// print('same');
|
||||||
// }
|
// }
|
||||||
// print(AK.basicAuthCredentials); //
|
// print(' AK is ' + AK.chatGPTkey); //
|
||||||
print(apiKeyf); //
|
|
||||||
|
// print(' ENV is ' + Env.chatGPTkey); //
|
||||||
|
// // print('storage is ' + v); //
|
||||||
|
// print('storage is ' + apiKeyf!); //
|
||||||
|
String input = """
|
||||||
|
[PAN
|
||||||
|
I/flutter (28718): wOYARMAN
|
||||||
|
I/flutter (28718): 2018 CHEV
|
||||||
|
I/flutter (28718): ASN AORESS
|
||||||
|
I/flutter (28718): rmv
|
||||||
|
I/flutter (28718): REGISTRY MOTOR VEHICL ES
|
||||||
|
I/flutter (28718): NEGIS TRATNWIYPE
|
||||||
|
I/flutter (28718): RSNTN AORLS( OrreRCNT THAN MALINO)
|
||||||
|
I/flutter (28718): Passenger Normal Red
|
||||||
|
I/flutter (28718): 274
|
||||||
|
I/flutter (28718): SILVERADO
|
||||||
|
I/flutter (28718): ESSSENOSTOoN
|
||||||
|
I/flutter (28718): Neso WNRS) ANO MALING ADOSES
|
||||||
|
I/flutter (28718): 274 CHATTERTON AVE SOMERSET MA 02726-2939
|
||||||
|
I/flutter (28718): CHRISTOPHER D WALL
|
||||||
|
I/flutter (28718): 74 CHATTERTON AVE
|
||||||
|
I/flutter (28718): SOMERSET NA
|
||||||
|
I/flutter (28718): A 02726-2939
|
||||||
|
I/flutter (28718): OEL NUMICR
|
||||||
|
I/flutter (28718): RAIL NUMOER
|
||||||
|
I/flutter (28718): 4DGY18
|
||||||
|
I/flutter (28718): oooY aYE
|
||||||
|
I/flutter (28718): PU
|
||||||
|
I/flutter (28718): M.G.L. Chapter 90 Section 24B makes it a crime to alter this Certificate
|
||||||
|
I/flutter (28718): MASSACHUSETTS DEPARTMENT OF TRANSPORTATION
|
||||||
|
I/flutter (28718): his vehicle is newty acquired, it must be inspected within 7 days
|
||||||
|
I/flutter (28718): of registration
|
||||||
|
I/flutter (28718): CERTIFICATE OF REGISTRATION
|
||||||
|
I/flutter (28718): rECVE DATE
|
||||||
|
I/flutter (28718): 21-Sep-2023
|
||||||
|
I/flutter (28718): Cancel the registration plates if:
|
||||||
|
I/flutter (28718): COLoR
|
||||||
|
I/flutter (28718): BLACK
|
||||||
|
I/flutter (28718): CHANGE OF ADORESS
|
||||||
|
I/flutter (28718): TITLE NUMUER
|
||||||
|
I/flutter (28718): VEHICLE IDENTIFICATION NUMDCR
|
||||||
|
I/flutter (28718): EXPIRES ON
|
||||||
|
I/flutter (28718): 1GCVKREC7JZ169002
|
||||||
|
I/flutter (28718): TOTAL RE GISTERED WEIGHT FOR A COMMERCIAL VEICLE CR TRALER
|
||||||
|
I/flutter (28718): US DOT LMBER FOR COMMERCAL, VEHICLE
|
||||||
|
I/flutter (28718): HSURWCE COMPi
|
||||||
|
I/flutter (28718): PLYMOUTH ROCK ASSURANCE
|
||||||
|
I/flutter (28718): CORPORATION
|
||||||
|
I/flutter (28718): MAMUM SEATVG CAPACIIYFHVEGES FOK HRE
|
||||||
|
I/flutter (28718): | RESIDENTIAL
|
||||||
|
I/flutter (28718): Important information for vehicle owners
|
||||||
|
I/flutter (28718): oun f9nia Rogistrar of Motor Vehicles
|
||||||
|
I/flutter (28718): 31-Aug-2025
|
||||||
|
I/flutter (28718): MAILING
|
||||||
|
I/flutter (28718): Cert]""";
|
||||||
|
|
||||||
|
await LlamaAi().getExractionData(input);
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.close,
|
Icons.close,
|
||||||
|
|||||||
Reference in New Issue
Block a user