11/25/1
This commit is contained in:
4
.env
4
.env
@@ -6,9 +6,11 @@ twilloRecoveryCode=CAU79DHPH1BE9PUH4ETXTSXZXrXlBl
|
|||||||
authTokenTwillo=70u98ju0214xx4q0u74028u021u4qu65XrXlBl
|
authTokenTwillo=70u98ju0214xx4q0u74028u021u4qu65XrXlBl
|
||||||
chatGPTkey=zg-4C26q4SYBKQeHZDqkWowC9XrxgUEfUy9JRw2rm6Q2adb3kjwXrXlBl
|
chatGPTkey=zg-4C26q4SYBKQeHZDqkWowC9XrxgUEfUy9JRw2rm6Q2adb3kjwXrXlBl
|
||||||
transactionCloude=Qhcwilomqcoib:QVO_JNYED2XWA26YXKC2TP:YK1DVH6SJB31N3PE1UXrXlBl
|
transactionCloude=Qhcwilomqcoib:QVO_JNYED2XWA26YXKC2TP:YK1DVH6SJB31N3PE1UXrXlBl
|
||||||
visionApi=3vQRyaYYSWpmv69A58ZOkxmeK6M1mgwEDlXrXlBl
|
visionApi=3pALsqSSYTvzp69Q5FMIgbzjG6Z1zktJXrXlBl
|
||||||
chatGPTkeySefer=zg-IiR34ooza3Yvhvb9rZk1C9XrxgUE0l8jRRZrHj3Qe5QXPlqVXrXlBl
|
chatGPTkeySefer=zg-IiR34ooza3Yvhvb9rZk1C9XrxgUE0l8jRRZrHj3Qe5QXPlqVXrXlBl
|
||||||
|
chatGPTkeySeferNew=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
|
||||||
secretKey=zg_cjzc_57I0TCIYNJPlIFQ5ZXkqiZZ28bBULsuMd1Cr5IYztSseaRvf3LdXWT9wwfV94Cv64CM7VAiMi6jWUrrLoAy9lNWVB33Rl8TY9b1XrXlBl
|
secretKey=zg_cjzc_57I0TCIYNJPlIFQ5ZXkqiZZ28bBULsuMd1Cr5IYztSseaRvf3LdXWT9wwfV94Cv64CM7VAiMi6jWUrrLoAy9lNWVB33Rl8TY9b1XrXlBl
|
||||||
stripe_publishableKe=vg_cjzc_57I0TCIYNJPlIFQ5ZB5j2x4vQpU5FVYF9f9Vou74a60BJAQvH5QunMMJB8D1TOqsuOlHCeeh7vHqpnkijRkx9UL5g33vb0iNWKIXrXlBl
|
stripe_publishableKe=vg_cjzc_57I0TCIYNJPlIFQ5ZB5j2x4vQpU5FVYF9f9Vou74a60BJAQvH5QunMMJB8D1TOqsuOlHCeeh7vHqpnkijRkx9UL5g33vb0iNWKIXrXlBl
|
||||||
llamaKey=LL-JfdiCXFpcLXNe87cSGQwGE0piZ9Zw179tVjEP1KMxQgVWGxD9Ixz3m8kkKaO5Kdi
|
llamaKey=LL-JfdiCXFpcLXNe87cSGQwGE0piZ9Zw179tVjEP1KMxQgVWGxD9Ixz3m8kkKaO5Kdi
|
||||||
serverPHP=https://ride.mobile-app.store
|
serverPHP=https://ride.mobile-app.store
|
||||||
|
Cohere=Qfrhx9d5YVHiy4uEuK4wiFc9kIuFFlvc5A6WVzPK
|
||||||
@@ -22,6 +22,8 @@
|
|||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
<meta-data android:name="flutterEmbedding" android:value="2"/>
|
<meta-data android:name="flutterEmbedding" android:value="2"/>
|
||||||
|
<activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait" android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
BIN
assets/notify.mp3
Normal file
BIN
assets/notify.mp3
Normal file
Binary file not shown.
@@ -24,4 +24,7 @@ class AK {
|
|||||||
static final String visionApi = a.r(a.r(a.r(Env.visionApi, cn), cC), cs);
|
static final String visionApi = a.r(a.r(a.r(Env.visionApi, cn), cC), cs);
|
||||||
static final String chatGPTkeySefer =
|
static final String chatGPTkeySefer =
|
||||||
a.r(a.r(a.r(Env.chatGPTkeySefer, cn), cC), cs);
|
a.r(a.r(a.r(Env.chatGPTkeySefer, cn), cC), cs);
|
||||||
|
static final String chatGPTkeySeferNew = Env.chatGPTkeySeferNew;
|
||||||
|
static final String serverPHP = Env.serverPHP;
|
||||||
|
static final String llamaKey = Env.llamaKey;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,11 @@ class AppLink {
|
|||||||
static const String addLicense = "$ride/license/add.php";
|
static const String addLicense = "$ride/license/add.php";
|
||||||
static const String getLicense = "$ride/license/get.php";
|
static const String getLicense = "$ride/license/get.php";
|
||||||
static const String updateLicense = "$ride/license/updateFeedBack.php";
|
static const String updateLicense = "$ride/license/updateFeedBack.php";
|
||||||
|
//-----------------RegisrationCar------------------
|
||||||
|
static const String addRegisrationCar = "$ride/RegisrationCar/add.php";
|
||||||
|
static const String getRegisrationCar = "$ride/RegisrationCar/get.php";
|
||||||
|
static const String updateRegisrationCar =
|
||||||
|
"$ride/RegisrationCar/updateFeedBack.php";
|
||||||
|
|
||||||
//-----------------DriverOrder------------------
|
//-----------------DriverOrder------------------
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ import 'package:ride/constant/links.dart';
|
|||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/controller/functions/secure_storage.dart';
|
import 'package:ride/controller/functions/secure_storage.dart';
|
||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
|
import 'package:ride/views/auth/captin/verify_email_captain.dart';
|
||||||
import 'package:ride/views/auth/verify_email_page.dart';
|
import 'package:ride/views/auth/verify_email_page.dart';
|
||||||
import 'package:ride/views/home/Captin/home_captin.dart';
|
import 'package:ride/views/home/Captin/home_captain/home_captin.dart';
|
||||||
import 'package:ride/views/home/map_page_passenger.dart';
|
import 'package:ride/views/home/map_page_passenger.dart';
|
||||||
|
|
||||||
class LoginCaptinController extends GetxController {
|
class LoginCaptinController extends GetxController {
|
||||||
@@ -82,7 +83,7 @@ class LoginCaptinController extends GetxController {
|
|||||||
'email': emailController.text,
|
'email': emailController.text,
|
||||||
'token': randomNumber.toString(),
|
'token': randomNumber.toString(),
|
||||||
}).then((value) => print(value));
|
}).then((value) => print(value));
|
||||||
Get.to(() => VerifyEmailPage());
|
Get.to(() => VerifyEmailCaptainPage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
|
import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
|
||||||
|
import 'package:image_cropper/image_cropper.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
import 'package:ride/constant/colors.dart';
|
||||||
|
import 'package:ride/controller/functions/llama_ai.dart';
|
||||||
|
|
||||||
class CarRegistrationRecognizerController extends GetxController {
|
class CarRegistrationRecognizerController extends GetxController {
|
||||||
@override
|
@override
|
||||||
@@ -15,7 +16,6 @@ class CarRegistrationRecognizerController extends GetxController {
|
|||||||
|
|
||||||
// The ImagePicker instance
|
// The ImagePicker instance
|
||||||
final ImagePicker _imagePicker = ImagePicker();
|
final ImagePicker _imagePicker = ImagePicker();
|
||||||
Map extractedData = {};
|
|
||||||
|
|
||||||
// The GoogleMlKit TextRecognizer instance
|
// The GoogleMlKit TextRecognizer instance
|
||||||
final TextRecognizer _textRecognizer = TextRecognizer();
|
final TextRecognizer _textRecognizer = TextRecognizer();
|
||||||
@@ -24,47 +24,57 @@ class CarRegistrationRecognizerController extends GetxController {
|
|||||||
String? scannedText;
|
String? scannedText;
|
||||||
String? jsonOutput;
|
String? jsonOutput;
|
||||||
final List<Map<String, dynamic>> lines = [];
|
final List<Map<String, dynamic>> lines = [];
|
||||||
|
Map extracted = {};
|
||||||
XFile? image;
|
XFile? image;
|
||||||
Map decode = {};
|
CroppedFile? croppedFile;
|
||||||
// Picks an image from the camera or gallery and extracts the text
|
// Picks an image from the camera or gallery and extracts the text
|
||||||
final List<Map<String, dynamic>> extractedTextWithCoordinates = [];
|
final List<Map<String, dynamic>> extractedTextWithCoordinates = [];
|
||||||
|
|
||||||
Future<void> scanText() async {
|
Future<void> scanText() async {
|
||||||
// Pick an image from the camera or gallery
|
// Pick an image from the camera or gallery
|
||||||
image = await _imagePicker.pickImage(source: ImageSource.gallery);
|
image = await _imagePicker.pickImage(source: ImageSource.gallery);
|
||||||
update();
|
update();
|
||||||
|
|
||||||
// If no image was picked, return
|
// If no image was picked, return
|
||||||
if (image == null) {
|
if (image == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the XFile object to an InputImage object
|
// Crop the image
|
||||||
final InputImage inputImage = InputImage.fromFile(File(image!.path));
|
croppedFile = await ImageCropper().cropImage(
|
||||||
|
sourcePath: image!.path,
|
||||||
|
aspectRatioPresets: [
|
||||||
|
CropAspectRatioPreset.square,
|
||||||
|
CropAspectRatioPreset.ratio3x2,
|
||||||
|
CropAspectRatioPreset.original,
|
||||||
|
CropAspectRatioPreset.ratio4x3,
|
||||||
|
CropAspectRatioPreset.ratio16x9
|
||||||
|
],
|
||||||
|
uiSettings: [
|
||||||
|
AndroidUiSettings(
|
||||||
|
toolbarTitle: 'Cropper',
|
||||||
|
toolbarColor: AppColor.blueColor,
|
||||||
|
toolbarWidgetColor: AppColor.yellowColor,
|
||||||
|
initAspectRatio: CropAspectRatioPreset.original,
|
||||||
|
lockAspectRatio: false),
|
||||||
|
IOSUiSettings(
|
||||||
|
title: 'Cropper',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
// If no cropped image was obtained, return
|
||||||
|
if (croppedFile == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert the cropped file to an InputImage object
|
||||||
|
final InputImage inputImage = InputImage.fromFile(File(croppedFile!.path));
|
||||||
|
|
||||||
// Recognize the text in the image
|
// Recognize the text in the image
|
||||||
final RecognizedText recognizedText =
|
final RecognizedText recognizedText =
|
||||||
await _textRecognizer.processImage(inputImage);
|
await _textRecognizer.processImage(inputImage);
|
||||||
scannedText = recognizedText.text;
|
scannedText = recognizedText.text;
|
||||||
final Map<String, dynamic> extractedData = {};
|
|
||||||
|
|
||||||
for (TextBlock block in recognizedText.blocks) {
|
|
||||||
for (TextLine line in block.lines) {
|
|
||||||
final String lineText = line.text;
|
|
||||||
final Rect lineBoundingBox = line.boundingBox!;
|
|
||||||
|
|
||||||
extractedTextWithCoordinates.add({
|
|
||||||
'text': lineText,
|
|
||||||
'boundingBox': {
|
|
||||||
'left': lineBoundingBox.left,
|
|
||||||
'top': lineBoundingBox.top,
|
|
||||||
'width': lineBoundingBox.width,
|
|
||||||
'height': lineBoundingBox.height,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
print(jsonEncode(extractedTextWithCoordinates));
|
|
||||||
|
|
||||||
// Extract the scanned text line by line
|
// Extract the scanned text line by line
|
||||||
final List<Map<String, dynamic>> lines = [];
|
final List<Map<String, dynamic>> lines = [];
|
||||||
@@ -73,15 +83,20 @@ class CarRegistrationRecognizerController extends GetxController {
|
|||||||
i.toString(): recognizedText.blocks[i].text,
|
i.toString(): recognizedText.blocks[i].text,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// print(jsonEncode(lines));
|
|
||||||
|
|
||||||
// Convert the list of lines to a JSON string
|
String result = lines.map((map) => map.values.first.toString()).join(' ');
|
||||||
jsonOutput = jsonEncode(extractedData);
|
// print(result.length);
|
||||||
decode = jsonDecode(jsonOutput!);
|
if (result.length > 2200) {
|
||||||
|
result = result.substring(0, 2200);
|
||||||
|
}
|
||||||
|
// print('jsonOutput------------------------------');
|
||||||
|
// print(result);
|
||||||
|
Map result2 = await LlamaAi().getCarRegistrationData(result);
|
||||||
|
|
||||||
|
// Assign the result to the extracted variable
|
||||||
|
extracted = result2;
|
||||||
|
|
||||||
|
print('extracted is ' + extracted.toString());
|
||||||
update();
|
update();
|
||||||
print('jsonOutput------------------------------');
|
|
||||||
print(decode);
|
|
||||||
// print(jsonEncode(lines));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import 'package:ride/views/auth/captin/verify_email_captain.dart';
|
|||||||
import '../../../views/auth/captin/ai_page.dart';
|
import '../../../views/auth/captin/ai_page.dart';
|
||||||
import '../../../views/auth/verify_email_page.dart';
|
import '../../../views/auth/verify_email_page.dart';
|
||||||
|
|
||||||
class RegisterCaptinController extends GetxController {
|
class RegisterCaptainController extends GetxController {
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
TextEditingController emailController = TextEditingController();
|
TextEditingController emailController = TextEditingController();
|
||||||
@@ -125,6 +125,27 @@ class RegisterCaptinController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addRegisrationCarForDriver(String vin, make, model, year, color, owner,
|
||||||
|
expirationDate, registrationDate) async {
|
||||||
|
getFromController();
|
||||||
|
var res = await CRUD().post(link: AppLink.addRegisrationCar, payload: {
|
||||||
|
'vin': vin,
|
||||||
|
'make': make,
|
||||||
|
'model': model,
|
||||||
|
'year': year,
|
||||||
|
'expirationDate': expirationDate,
|
||||||
|
'color': color,
|
||||||
|
'owner': owner,
|
||||||
|
'registrationDate': registrationDate,
|
||||||
|
});
|
||||||
|
print(jsonDecode(res));
|
||||||
|
isLoading = false;
|
||||||
|
update();
|
||||||
|
if (jsonDecode(res)['status'] == 'success') {
|
||||||
|
// Get.to(() => AiPage()); //todo replace this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void register() async {
|
void register() async {
|
||||||
getFromController();
|
getFromController();
|
||||||
if (formKey.currentState!.validate()) {
|
if (formKey.currentState!.validate()) {
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ import '../../constant/box_name.dart';
|
|||||||
import '../../constant/colors.dart';
|
import '../../constant/colors.dart';
|
||||||
import '../../constant/links.dart';
|
import '../../constant/links.dart';
|
||||||
import '../../constant/style.dart';
|
import '../../constant/style.dart';
|
||||||
import '../../env/env.dart';
|
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import '../../views/home/profile/promos_passenger_page.dart';
|
import '../../views/home/profile/promos_passenger_page.dart';
|
||||||
import '../../views/orderCaptin/order_request_page.dart';
|
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
||||||
import '../../views/widgets/elevated_btn.dart';
|
import '../../views/widgets/elevated_btn.dart';
|
||||||
import '../functions/crud.dart';
|
import '../functions/crud.dart';
|
||||||
import '../functions/launch.dart';
|
import '../functions/launch.dart';
|
||||||
@@ -413,7 +412,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
'notification': <String, dynamic>{
|
'notification': <String, dynamic>{
|
||||||
'title': title,
|
'title': title,
|
||||||
'body': body,
|
'body': body,
|
||||||
'sound': 'true'
|
'sound': 'assets/notify.mp3'
|
||||||
},
|
},
|
||||||
'priority': 'high',
|
'priority': 'high',
|
||||||
'data': <String, dynamic>{
|
'data': <String, dynamic>{
|
||||||
@@ -471,7 +470,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
'notification': <String, dynamic>{
|
'notification': <String, dynamic>{
|
||||||
'title': title,
|
'title': title,
|
||||||
'body': body,
|
'body': body,
|
||||||
'sound': 'true'
|
'sound': 'assets/notify.mp3'
|
||||||
},
|
},
|
||||||
'data': {
|
'data': {
|
||||||
'passengerList': map,
|
'passengerList': map,
|
||||||
@@ -508,7 +507,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
'notification': <String, dynamic>{
|
'notification': <String, dynamic>{
|
||||||
'title': title,
|
'title': title,
|
||||||
'body': body,
|
'body': body,
|
||||||
'sound': 'true'
|
'sound': 'assets/notify.mp3'
|
||||||
},
|
},
|
||||||
'data': <String, dynamic>{
|
'data': <String, dynamic>{
|
||||||
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
|
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
|
||||||
@@ -547,7 +546,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
'notification': <String, dynamic>{
|
'notification': <String, dynamic>{
|
||||||
'title': title,
|
'title': title,
|
||||||
'body': body,
|
'body': body,
|
||||||
'sound': 'true'
|
'sound': 'assets/notify.mp3'
|
||||||
},
|
},
|
||||||
'data': {
|
'data': {
|
||||||
'DriverList': data,
|
'DriverList': data,
|
||||||
|
|||||||
@@ -59,7 +59,42 @@ class CRUD {
|
|||||||
{
|
{
|
||||||
"role": "user",
|
"role": "user",
|
||||||
"content":
|
"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"
|
"Extract the desired information from the following passage as json decoded like vin,make,made,year,expiration_date,color,owner,registration_date just 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> getChatGPT({
|
||||||
|
required String link,
|
||||||
|
required String payload,
|
||||||
|
}) async {
|
||||||
|
var url = Uri.parse(
|
||||||
|
link,
|
||||||
|
);
|
||||||
|
var headers = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization':
|
||||||
|
'Bearer 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'
|
||||||
|
};
|
||||||
|
var data = json.encode({
|
||||||
|
"model": "gpt-3.5-turbo",
|
||||||
|
"messages": [
|
||||||
|
{
|
||||||
|
"role": "user",
|
||||||
|
"content":
|
||||||
|
"Extract the desired information from the following passage as json decoded like vin,make,made,year,expiration_date,color,owner,registration_date just in this:\n\n$payload"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"temperature": 0.9
|
"temperature": 0.9
|
||||||
|
|||||||
@@ -4,18 +4,21 @@ import 'package:ride/constant/links.dart';
|
|||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
|
|
||||||
class LlamaAi {
|
class LlamaAi {
|
||||||
Future getExractionData(String input) async {
|
Future<Map> getCarRegistrationData(String input) async {
|
||||||
print(true);
|
print(true);
|
||||||
|
Map exrtatDataFinal = {};
|
||||||
String oneLine = input.replaceAll('\n', ' ');
|
String oneLine = input.replaceAll('\n', ' ');
|
||||||
var res = await CRUD().getLlama(link: AppLink.llama, payload: oneLine);
|
var res = await CRUD().getLlama(link: AppLink.llama, payload: oneLine);
|
||||||
var decod = jsonDecode(res);
|
var decod = jsonDecode(res);
|
||||||
// print(decod['choices'][0]['message']['content']);
|
// print(decod);
|
||||||
extractDataFromJsonString(decod['choices'][0]['message']['content']);
|
exrtatDataFinal = jsonDecode(
|
||||||
|
extractDataFromJsonString(decod['choices'][0]['message']['content']));
|
||||||
|
// print(jsonEncode(exrtatDataFinal));
|
||||||
print(false);
|
print(false);
|
||||||
|
return exrtatDataFinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> extractDataFromJsonString(String jsonString) {
|
String extractDataFromJsonString(String jsonString) {
|
||||||
// Remove any leading or trailing whitespace from the string
|
// Remove any leading or trailing whitespace from the string
|
||||||
jsonString = jsonString.trim();
|
jsonString = jsonString.trim();
|
||||||
|
|
||||||
@@ -25,10 +28,11 @@ class LlamaAi {
|
|||||||
final jsonSubstring = jsonString.substring(startIndex, endIndex + 1);
|
final jsonSubstring = jsonString.substring(startIndex, endIndex + 1);
|
||||||
|
|
||||||
// Parse the JSON substring into a Map
|
// Parse the JSON substring into a Map
|
||||||
final jsonData = json.decode(jsonSubstring);
|
final jsonData = jsonDecode(jsonSubstring);
|
||||||
|
|
||||||
// Return the extracted data
|
// Return the extracted data
|
||||||
print(jsonData);
|
|
||||||
return jsonData;
|
// print(jsonEncode(jsonData));
|
||||||
|
return jsonEncode(jsonData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,14 @@ import 'package:image_picker/image_picker.dart';
|
|||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
import 'package:path_provider/path_provider.dart' as path_provider;
|
import 'package:path_provider/path_provider.dart' as path_provider;
|
||||||
|
import 'package:ride/constant/api_key.dart';
|
||||||
import 'package:ride/constant/box_name.dart';
|
import 'package:ride/constant/box_name.dart';
|
||||||
import 'package:ride/constant/colors.dart';
|
import 'package:ride/constant/colors.dart';
|
||||||
import 'package:ride/constant/credential.dart';
|
import 'package:ride/constant/credential.dart';
|
||||||
import 'package:ride/constant/info.dart';
|
import 'package:ride/constant/info.dart';
|
||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
import 'package:ride/constant/table_names.dart';
|
import 'package:ride/constant/table_names.dart';
|
||||||
|
import 'package:ride/env/env.dart';
|
||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
@@ -284,9 +286,11 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
///
|
///
|
||||||
|
|
||||||
Future<void> scanDocumentsByApi() async {
|
Future<void> scanDocumentsByApi() async {
|
||||||
String? visionApi = await storage.read(key: BoxName.visionApi);
|
// String? visionApi = await storage.read(key: BoxName.visionApi);
|
||||||
|
// String? visionApi = AK.visionApi;
|
||||||
// Pick an image from the camera or gallery
|
// Pick an image from the camera or gallery
|
||||||
image = await imagePicker.pickImage(source: ImageSource.camera);
|
// print(visionApi);
|
||||||
|
image = await imagePicker.pickImage(source: ImageSource.camera); //
|
||||||
|
|
||||||
// If no image was picked, return
|
// If no image was picked, return
|
||||||
if (image == null) {
|
if (image == null) {
|
||||||
@@ -295,7 +299,7 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
|
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
update();
|
update();
|
||||||
var headers = {'X-BLOBR-KEY': visionApi.toString()};
|
var headers = {'X-BLOBR-KEY': AK.visionApi};
|
||||||
var request = http.MultipartRequest('POST',
|
var request = http.MultipartRequest('POST',
|
||||||
Uri.parse('https://api.faceonlive.com/j2y3q25y1b6maif1/api/iddoc'));
|
Uri.parse('https://api.faceonlive.com/j2y3q25y1b6maif1/api/iddoc'));
|
||||||
request.files.add(await http.MultipartFile.fromPath('image', image!.path));
|
request.files.add(await http.MultipartFile.fromPath('image', image!.path));
|
||||||
@@ -399,7 +403,7 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
|
|
||||||
Map res = {};
|
Map res = {};
|
||||||
Future matchFaceApi() async {
|
Future matchFaceApi() async {
|
||||||
String? visionApi = await storage.read(key: BoxName.visionApi);
|
// String? visionApi = await storage.read(key: BoxName.visionApi);
|
||||||
imageFace = await imagePicker.pickImage(
|
imageFace = await imagePicker.pickImage(
|
||||||
source: ImageSource.camera,
|
source: ImageSource.camera,
|
||||||
preferredCameraDevice: CameraDevice.front,
|
preferredCameraDevice: CameraDevice.front,
|
||||||
@@ -411,13 +415,13 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
}
|
}
|
||||||
final imageFile = File(imageFace!.path);
|
final imageFile = File(imageFace!.path);
|
||||||
// Uint8List imageBytes = await imageFile.readAsBytes();
|
// Uint8List imageBytes = await imageFile.readAsBytes();
|
||||||
var headers = {'X-BLOBR-KEY': visionApi.toString()};
|
var headers = {'X-BLOBR-KEY': AK.visionApi};
|
||||||
var request = http.MultipartRequest(
|
var request = http.MultipartRequest(
|
||||||
'POST',
|
'POST',
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
'https://api.faceonlive.com/sntzbspfsdupgid1/api/face_compare'));
|
'https://api.faceonlive.com/sntzbspfsdupgid1/api/face_compare'));
|
||||||
request.files
|
request.files
|
||||||
.add(await http.MultipartFile.fromPath('image1', imageFace!.path));
|
.add(await http.MultipartFile.fromPath('image1', imageFile.path));
|
||||||
request.files.add(await http.MultipartFile.fromPath('image2', imagePath));
|
request.files.add(await http.MultipartFile.fromPath('image2', imagePath));
|
||||||
request.headers.addAll(headers);
|
request.headers.addAll(headers);
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
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:ride/constant/box_name.dart';
|
import 'package:ride/constant/box_name.dart';
|
||||||
|
import 'package:ride/controller/home/captin/order_request_controller.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import '../../../constant/links.dart';
|
import '../../../constant/links.dart';
|
||||||
|
import '../../../constant/style.dart';
|
||||||
|
import '../../../constant/table_names.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
|
import '../../../views/widgets/elevated_btn.dart';
|
||||||
import '../../functions/crud.dart';
|
import '../../functions/crud.dart';
|
||||||
import '../../functions/location_controller.dart';
|
import '../../functions/location_controller.dart';
|
||||||
|
|
||||||
@@ -21,6 +26,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
String totalMoneyInSEFER = '0';
|
String totalMoneyInSEFER = '0';
|
||||||
String totalDurationToday = '0';
|
String totalDurationToday = '0';
|
||||||
Timer? timer;
|
Timer? timer;
|
||||||
|
String countRefuse = '0';
|
||||||
bool mapType = false;
|
bool mapType = false;
|
||||||
bool mapTrafficON = false;
|
bool mapTrafficON = false;
|
||||||
double widthMapTypeAndTraffic = 50;
|
double widthMapTypeAndTraffic = 50;
|
||||||
@@ -55,6 +61,52 @@ class HomeCaptainController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void getRefusedOrderByCaptain() async {
|
||||||
|
DateTime today = DateTime.now();
|
||||||
|
int todayDay = today.day;
|
||||||
|
|
||||||
|
String driverId = box.read(BoxName.driverID).toString();
|
||||||
|
|
||||||
|
String customQuery = '''
|
||||||
|
SELECT COUNT(*) AS count
|
||||||
|
FROM ${TableName.driverOrdersRefuse}
|
||||||
|
WHERE driver_id = '$driverId'
|
||||||
|
AND created_at LIKE '%$todayDay%'
|
||||||
|
''';
|
||||||
|
|
||||||
|
try {
|
||||||
|
List<Map<String, dynamic>> results =
|
||||||
|
await sql.getCustomQuery(customQuery);
|
||||||
|
countRefuse = results[0]['count'].toString();
|
||||||
|
update();
|
||||||
|
if (int.parse(countRefuse) > 3) {
|
||||||
|
locationController.stopLocationUpdates();
|
||||||
|
activeStartTime = null;
|
||||||
|
activeTimer?.cancel();
|
||||||
|
savePeriod(activeDuration);
|
||||||
|
activeDuration = Duration.zero;
|
||||||
|
update();
|
||||||
|
Get.defaultDialog(
|
||||||
|
// backgroundColor: CupertinoColors.destructiveRed,
|
||||||
|
barrierDismissible: false,
|
||||||
|
title: 'You Are Stopped For this Day !'.tr,
|
||||||
|
content: Text(
|
||||||
|
'You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!'
|
||||||
|
.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Ok , See you Tomorrow'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
Get.back();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print('Error executing custom query: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void changeMapType() {
|
void changeMapType() {
|
||||||
mapType = !mapType;
|
mapType = !mapType;
|
||||||
// heightButtomSheetShown = isButtomSheetShown == true ? 240 : 0;
|
// heightButtomSheetShown = isButtomSheetShown == true ? 240 : 0;
|
||||||
@@ -110,6 +162,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
getPaymentToday();
|
getPaymentToday();
|
||||||
getAllPayment();
|
getAllPayment();
|
||||||
startPeriodicExecution();
|
startPeriodicExecution();
|
||||||
|
getRefusedOrderByCaptain();
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import '../../../constant/colors.dart';
|
|||||||
import '../../../constant/links.dart';
|
import '../../../constant/links.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
import '../../../views/Rate/rate_passenger.dart';
|
import '../../../views/Rate/rate_passenger.dart';
|
||||||
import '../../../views/home/Captin/home_captin.dart';
|
import '../../../views/home/Captin/home_captain/home_captin.dart';
|
||||||
import '../../firebase/firbase_messge.dart';
|
import '../../firebase/firbase_messge.dart';
|
||||||
import '../../functions/crud.dart';
|
import '../../functions/crud.dart';
|
||||||
import '../../functions/location_controller.dart';
|
import '../../functions/location_controller.dart';
|
||||||
@@ -49,8 +49,8 @@ class MapDriverController extends GetxController {
|
|||||||
double progress = 0;
|
double progress = 0;
|
||||||
double progressToPassenger = 0;
|
double progressToPassenger = 0;
|
||||||
bool isRideBegin = false;
|
bool isRideBegin = false;
|
||||||
int progressTimerToShowPassengerInfoWindowFromDriver = 15;
|
int progressTimerToShowPassengerInfoWindowFromDriver = 20;
|
||||||
int remainingTimeToShowPassengerInfoWindowFromDriver = 15;
|
int remainingTimeToShowPassengerInfoWindowFromDriver = 20;
|
||||||
int remainingTimeToPassenger = 60;
|
int remainingTimeToPassenger = 60;
|
||||||
bool isDriverNearPassengerStart = false;
|
bool isDriverNearPassengerStart = false;
|
||||||
GoogleMapController? mapController;
|
GoogleMapController? mapController;
|
||||||
@@ -60,7 +60,7 @@ class MapDriverController extends GetxController {
|
|||||||
double progressTimerRideBegin = 0;
|
double progressTimerRideBegin = 0;
|
||||||
late Timer timer;
|
late Timer timer;
|
||||||
String? mapAPIKEY;
|
String? mapAPIKEY;
|
||||||
|
final zones = <Zone>[];
|
||||||
void onMapCreated(GoogleMapController controller) {
|
void onMapCreated(GoogleMapController controller) {
|
||||||
LocationController locationController = Get.find<LocationController>();
|
LocationController locationController = Get.find<LocationController>();
|
||||||
myLocation = locationController.myLocation;
|
myLocation = locationController.myLocation;
|
||||||
|
|||||||
@@ -8,14 +8,15 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
|||||||
import '../../../constant/box_name.dart';
|
import '../../../constant/box_name.dart';
|
||||||
import '../../../constant/table_names.dart';
|
import '../../../constant/table_names.dart';
|
||||||
import '../../functions/crud.dart';
|
import '../../functions/crud.dart';
|
||||||
|
import '../../functions/location_controller.dart';
|
||||||
|
|
||||||
class OrderRequestController extends GetxController {
|
class OrderRequestController extends GetxController {
|
||||||
double progress = 0;
|
double progress = 0;
|
||||||
int duration = 15;
|
int duration = 20;
|
||||||
int remainingTime = 0;
|
int remainingTime = 0;
|
||||||
String countRefuse = '0';
|
String countRefuse = '0';
|
||||||
bool applied = false;
|
bool applied = false;
|
||||||
|
final locationController = Get.put(LocationController());
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
getRefusedOrderByCaptain();
|
getRefusedOrderByCaptain();
|
||||||
@@ -47,6 +48,7 @@ class OrderRequestController extends GetxController {
|
|||||||
countRefuse = results[0]['count'].toString();
|
countRefuse = results[0]['count'].toString();
|
||||||
update();
|
update();
|
||||||
if (int.parse(countRefuse) > 3) {
|
if (int.parse(countRefuse) > 3) {
|
||||||
|
locationController.stopLocationUpdates();
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
// backgroundColor: CupertinoColors.destructiveRed,
|
// backgroundColor: CupertinoColors.destructiveRed,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../constant/style.dart';
|
||||||
|
import '../../../../views/widgets/elevated_btn.dart';
|
||||||
import '../home_captain_controller.dart';
|
import '../home_captain_controller.dart';
|
||||||
import '../order_request_controller.dart';
|
import '../order_request_controller.dart';
|
||||||
|
|
||||||
@@ -19,7 +21,23 @@ class ConnectWidget extends StatelessWidget {
|
|||||||
int.parse(orderRequestController.countRefuse) > 3
|
int.parse(orderRequestController.countRefuse) > 3
|
||||||
? CupertinoButton(
|
? CupertinoButton(
|
||||||
child: Text('You are Stopped'.tr),
|
child: Text('You are Stopped'.tr),
|
||||||
onPressed: () {},
|
onPressed: () {
|
||||||
|
Get.defaultDialog(
|
||||||
|
// backgroundColor: CupertinoColors.destructiveRed,
|
||||||
|
barrierDismissible: false,
|
||||||
|
title: 'You Are Stopped For this Day !'.tr,
|
||||||
|
content: Text(
|
||||||
|
'You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!'
|
||||||
|
.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Ok , See you Tomorrow'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
Get.back();
|
||||||
|
}));
|
||||||
|
},
|
||||||
color: CupertinoColors.destructiveRed,
|
color: CupertinoColors.destructiveRed,
|
||||||
)
|
)
|
||||||
: CupertinoButton(
|
: CupertinoButton(
|
||||||
|
|||||||
@@ -13,6 +13,24 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
left: 6,
|
left: 6,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
AnimatedContainer(
|
||||||
|
duration: const Duration(microseconds: 200),
|
||||||
|
width: controller.widthMapTypeAndTraffic,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(),
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {},
|
||||||
|
icon: const Icon(
|
||||||
|
FontAwesome.map_signs,
|
||||||
|
size: 24,
|
||||||
|
color: Colors.black,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
duration: const Duration(microseconds: 200),
|
duration: const Duration(microseconds: 200),
|
||||||
width: controller.widthMapTypeAndTraffic,
|
width: controller.widthMapTypeAndTraffic,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ 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/views/home/map_page_passenger.dart';
|
||||||
import '../../constant/api_key.dart';
|
import '../../constant/api_key.dart';
|
||||||
import '../../constant/box_name.dart';
|
import '../../constant/box_name.dart';
|
||||||
import '../../constant/info.dart';
|
import '../../constant/info.dart';
|
||||||
@@ -359,9 +360,21 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
startTimer();
|
startTimer();
|
||||||
} else if (decod['data'].toString() == 'Refused') {
|
} else if (decod['data'].toString() == 'Refused') {
|
||||||
|
if (dataCarsLocationByPassenger.length > carsOrder) {
|
||||||
carsOrder++;
|
carsOrder++;
|
||||||
update();
|
update();
|
||||||
changeConfirmRide();
|
changeConfirmRide();
|
||||||
|
} else {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'There no Captain Aplly your order sorry for that '.tr,
|
||||||
|
middleText: 'try next time .',
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Back',
|
||||||
|
onPressed: () => Get.offAll(const MapPagePassenger()),
|
||||||
|
));
|
||||||
|
|
||||||
|
// cancelRide();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
delayAndFetchRideStatus(
|
delayAndFetchRideStatus(
|
||||||
rideId); // Repeat the delay and fetch operation
|
rideId); // Repeat the delay and fetch operation
|
||||||
@@ -443,8 +456,11 @@ class MapPassengerController extends GetxController {
|
|||||||
noCarString = false;
|
noCarString = false;
|
||||||
dataCarsLocationByPassenger = jsonDecode(res);
|
dataCarsLocationByPassenger = jsonDecode(res);
|
||||||
// print(dataCarsLocationByPassenger);
|
// print(dataCarsLocationByPassenger);
|
||||||
|
// if (dataCarsLocationByPassenger.length > carsOrder) {
|
||||||
driverId = dataCarsLocationByPassenger['message'][carsOrder]['driver_id']
|
driverId = dataCarsLocationByPassenger['message'][carsOrder]['driver_id']
|
||||||
.toString();
|
.toString();
|
||||||
|
// }
|
||||||
|
|
||||||
// print('driverId==============$driverId');
|
// print('driverId==============$driverId');
|
||||||
for (var i = 0; i < dataCarsLocationByPassenger['message'].length; i++) {
|
for (var i = 0; i < dataCarsLocationByPassenger['message'].length; i++) {
|
||||||
carsLocationByPassenger.add(LatLng(
|
carsLocationByPassenger.add(LatLng(
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import '../../constant/box_name.dart';
|
|||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
import '../../onbording_page.dart';
|
import '../../onbording_page.dart';
|
||||||
import '../../views/auth/captin/login_captin.dart';
|
import '../../views/auth/captin/login_captin.dart';
|
||||||
import '../../views/home/Captin/home_captin.dart';
|
import '../../views/home/Captin/home_captain/home_captin.dart';
|
||||||
import '../../views/home/map_page_passenger.dart';
|
import '../../views/home/map_page_passenger.dart';
|
||||||
|
|
||||||
class SplashScreenController extends GetxController
|
class SplashScreenController extends GetxController
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import 'package:ride/constant/style.dart';
|
|||||||
import 'package:ride/controller/functions/crud.dart';
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
import 'package:ride/controller/home/map_passenger_controller.dart';
|
import 'package:ride/controller/home/map_passenger_controller.dart';
|
||||||
import 'package:ride/main.dart';
|
import 'package:ride/main.dart';
|
||||||
import 'package:ride/views/home/Captin/home_captin.dart';
|
import 'package:ride/views/home/Captin/home_captain/home_captin.dart';
|
||||||
import 'package:ride/views/home/map_page_passenger.dart';
|
import 'package:ride/views/home/map_page_passenger.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ class AiPage extends StatelessWidget {
|
|||||||
title: 'get sql data',
|
title: 'get sql data',
|
||||||
kolor: AppColor.yellowColor,
|
kolor: AppColor.yellowColor,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// sql.deleteAllData(TableName.faceDetectTimes);
|
sql.deleteAllData(TableName.faceDetectTimes);
|
||||||
sql
|
sql
|
||||||
.getAllData(TableName.faceDetectTimes)
|
.getAllData(TableName.faceDetectTimes)
|
||||||
.then((value) =>
|
.then((value) =>
|
||||||
|
|||||||
@@ -2,19 +2,23 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/controller/auth/captin/ml_google_doc.dart';
|
import 'package:ride/constant/api_key.dart';
|
||||||
import 'package:ride/controller/auth/captin/register_captin_controller.dart';
|
import 'package:ride/env/env.dart';
|
||||||
import 'package:ride/views/widgets/my_scafold.dart';
|
|
||||||
|
|
||||||
import '../../../controller/functions/ocr_controller.dart';
|
import '../../../constant/box_name.dart';
|
||||||
|
import '../../../constant/style.dart';
|
||||||
|
import '../../../controller/auth/captin/ml_google_doc.dart';
|
||||||
|
import '../../../controller/auth/captin/register_captin_controller.dart';
|
||||||
|
import '../../../main.dart';
|
||||||
import '../../widgets/elevated_btn.dart';
|
import '../../widgets/elevated_btn.dart';
|
||||||
|
import '../../widgets/my_scafold.dart';
|
||||||
|
|
||||||
class CarLicensePage extends StatelessWidget {
|
class CarLicensePage extends StatelessWidget {
|
||||||
CarLicensePage({super.key});
|
CarLicensePage({super.key});
|
||||||
CarRegistrationRecognizerController carRegistrationRecognizerController =
|
CarRegistrationRecognizerController carRegistrationRecognizerController =
|
||||||
Get.put(CarRegistrationRecognizerController());
|
Get.put(CarRegistrationRecognizerController());
|
||||||
RegisterCaptinController registerCaptainController =
|
RegisterCaptainController registerCaptainController =
|
||||||
Get.put(RegisterCaptinController());
|
Get.put(RegisterCaptainController());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -28,6 +32,11 @@ class CarLicensePage extends StatelessWidget {
|
|||||||
child: MyElevatedButton(
|
child: MyElevatedButton(
|
||||||
title: 'Take Picture Of ID Card'.tr,
|
title: 'Take Picture Of ID Card'.tr,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
//0vQRyaYYDWpsv73A5CZOknseK7S2sgwE
|
||||||
|
//3vQRyaYYSWpmv69A58ZOkxmeK6M1mgwEDlXrXlBl
|
||||||
|
//0pALdqDDYHvzp73Q59SIgbzjG7Z2zkhJXr
|
||||||
|
// String? visionApi = AK.serverPHP;
|
||||||
|
// print(AK.visionApi);
|
||||||
await carRegistrationRecognizerController.scanText();
|
await carRegistrationRecognizerController.scanText();
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
@@ -47,6 +56,18 @@ class CarLicensePage extends StatelessWidget {
|
|||||||
title: 'Register'.tr,
|
title: 'Register'.tr,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
registerCaptainController.addLisence();
|
registerCaptainController.addLisence();
|
||||||
|
registerCaptainController.addRegisrationCarForDriver(
|
||||||
|
carRegistrationRecognizerController.extracted['vin'],
|
||||||
|
carRegistrationRecognizerController.extracted['make'],
|
||||||
|
carRegistrationRecognizerController.extracted['model'],
|
||||||
|
carRegistrationRecognizerController.extracted['year'],
|
||||||
|
carRegistrationRecognizerController.extracted['color'],
|
||||||
|
carRegistrationRecognizerController.extracted['owner'],
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['expiration_date'],
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['registration_date'],
|
||||||
|
);
|
||||||
registerCaptainController.register();
|
registerCaptainController.register();
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
@@ -56,36 +77,120 @@ class CarLicensePage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildImageWithBoundingBoxes() {
|
Widget buildImageWithBoundingBoxes() {
|
||||||
CarRegistrationRecognizerController carRegistrationRecognizerController =
|
|
||||||
Get.put(CarRegistrationRecognizerController());
|
Get.put(CarRegistrationRecognizerController());
|
||||||
if (carRegistrationRecognizerController.image == null) {
|
return GetBuilder<CarRegistrationRecognizerController>(
|
||||||
return Text('No image selected');
|
builder: (carRegistrationRecognizerController) =>
|
||||||
} else {
|
carRegistrationRecognizerController.image == null ||
|
||||||
return Stack(
|
carRegistrationRecognizerController.extracted.isEmpty
|
||||||
|
? Center(
|
||||||
|
child: Text(
|
||||||
|
'No image selected yet'.tr,
|
||||||
|
style: AppStyle.headtitle2,
|
||||||
|
))
|
||||||
|
: Column(
|
||||||
children: [
|
children: [
|
||||||
Positioned(
|
SizedBox(
|
||||||
// top: 50,
|
width: Get.width * .8,
|
||||||
// right: 5,
|
height: Get.width * .5,
|
||||||
// left: 5,
|
|
||||||
// bottom: 50,
|
|
||||||
child: Image.file(
|
child: Image.file(
|
||||||
File(carRegistrationRecognizerController.image!.path),
|
File(carRegistrationRecognizerController
|
||||||
fit: BoxFit.fill,
|
.croppedFile!.path),
|
||||||
|
// fit: BoxFit.fill,
|
||||||
)),
|
)),
|
||||||
// for (var line
|
const SizedBox(
|
||||||
// in carRegistrationRecognizerController.extractedTextWithCoordinates)
|
height: 20,
|
||||||
// Positioned(
|
),
|
||||||
// left: line['boundingBox']['left'],
|
Container(
|
||||||
// top: line['boundingBox']['top'] - Get.width * 2,
|
decoration: AppStyle.boxDecoration,
|
||||||
// width: line['boundingBox']['width'],
|
height: Get.width * .5,
|
||||||
// height: line['boundingBox']['height'],
|
width: Get.width * .9,
|
||||||
// child: Container(
|
child: Column(
|
||||||
// decoration: BoxDecoration(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// border: Border.all(color: Colors.red, width: 2),
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
// ),
|
children: [
|
||||||
// ),
|
Row(
|
||||||
// ),
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Made :' +
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['make']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'model :' +
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['model']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
),
|
||||||
}
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'VIN :' +
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['vin']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'year :' +
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['year']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'expiration date :' +
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['expiration_date']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'registration date :' +
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['registration_date']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'color :' +
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['color']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'owner :' +
|
||||||
|
carRegistrationRecognizerController
|
||||||
|
.extracted['owner']
|
||||||
|
.toString(),
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
// await storage.read(key: BoxName.serverAPI) ?? '';
|
// 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();
|
||||||
@@ -215,13 +215,13 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
// print('v: $v');
|
// print('v: $v');
|
||||||
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
||||||
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
||||||
// // String convertedStringN = credentials.c(
|
String convertedStringN = credentials.c(
|
||||||
// credentials.c(
|
credentials.c(
|
||||||
// credentials.c(
|
credentials.c(
|
||||||
// 'QFx0qy456juj3839xuy2194q629q1fj0y7XrXlBl', cs),
|
'0vQRyaYYDWpsv73A5CZOknseK7S2sgwE', cs),
|
||||||
// cC),
|
cC),
|
||||||
// // cn);
|
cn);
|
||||||
// print('Converted v: $convertedStringN');
|
print('Converted v: $convertedStringN');
|
||||||
// //
|
// //
|
||||||
// String retrievedStringN =
|
// String retrievedStringN =
|
||||||
// credentials.r(convertedStringN, n);
|
// credentials.r(convertedStringN, n);
|
||||||
@@ -230,14 +230,11 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
// credentials.r(retrievedStringN, c);
|
// credentials.r(retrievedStringN, c);
|
||||||
// print('Retrieved String: $retrievedStringC');
|
// print('Retrieved String: $retrievedStringC');
|
||||||
|
|
||||||
// String retrievedStringS = credentials.r(
|
String retrievedStringS = credentials.r(
|
||||||
// credentials.r(
|
credentials.r(
|
||||||
// credentials.r(
|
credentials.r(convertedStringN, cn), cC),
|
||||||
// 'QFx0qy456juj3839xuy2194q629q1fj0y7XrXlBl',
|
cs);
|
||||||
// cn),
|
print('Retrieved String: $retrievedStringS');
|
||||||
// cC),
|
|
||||||
// cs);
|
|
||||||
// print('Retrieved String: $retrievedStringS');
|
|
||||||
|
|
||||||
// if (retrievedStringS == apiKey) {
|
// if (retrievedStringS == apiKey) {
|
||||||
// print('same');
|
// print('same');
|
||||||
@@ -247,59 +244,6 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
// print(' ENV is ' + Env.chatGPTkey); //
|
// print(' ENV is ' + Env.chatGPTkey); //
|
||||||
// // print('storage is ' + v); //
|
// // print('storage is ' + v); //
|
||||||
// print('storage is ' + apiKeyf!); //
|
// 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,
|
||||||
|
|||||||
16
lib/views/auth/captin/logout_captain.dart
Normal file
16
lib/views/auth/captin/logout_captain.dart
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
class LogoutCaptain extends StatelessWidget {
|
||||||
|
const LogoutCaptain({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MyScafolld(
|
||||||
|
title: 'Log Out Page'.tr,
|
||||||
|
body: [],
|
||||||
|
isleading: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,11 +12,11 @@ class RegisterCaptin extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Get.put(RegisterCaptinController());
|
Get.put(RegisterCaptainController());
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Register Captain'.tr,
|
title: 'Register Captain'.tr,
|
||||||
body: [
|
body: [
|
||||||
GetBuilder<RegisterCaptinController>(
|
GetBuilder<RegisterCaptainController>(
|
||||||
builder: (controller) => Form(
|
builder: (controller) => Form(
|
||||||
key: controller.formKey,
|
key: controller.formKey,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import 'package:ride/views/widgets/my_scafold.dart';
|
|||||||
|
|
||||||
class VerifyEmailCaptainPage extends StatelessWidget {
|
class VerifyEmailCaptainPage extends StatelessWidget {
|
||||||
VerifyEmailCaptainPage({super.key});
|
VerifyEmailCaptainPage({super.key});
|
||||||
RegisterCaptinController registerCaptinController =
|
RegisterCaptainController registerCaptinController =
|
||||||
Get.put(RegisterCaptinController());
|
Get.put(RegisterCaptainController());
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
@@ -22,7 +22,7 @@ class VerifyEmailCaptainPage extends StatelessWidget {
|
|||||||
'We sent 5 digit to your Email provided'.tr,
|
'We sent 5 digit to your Email provided'.tr,
|
||||||
style: AppStyle.title.copyWith(fontSize: 20),
|
style: AppStyle.title.copyWith(fontSize: 20),
|
||||||
)),
|
)),
|
||||||
GetBuilder<RegisterCaptinController>(
|
GetBuilder<RegisterCaptainController>(
|
||||||
builder: (controller) => Positioned(
|
builder: (controller) => Positioned(
|
||||||
top: 100,
|
top: 100,
|
||||||
left: 80,
|
left: 80,
|
||||||
|
|||||||
16
lib/views/home/Captin/history_captain.dart
Normal file
16
lib/views/home/Captin/history_captain.dart
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
class HistoryCaptain extends StatelessWidget {
|
||||||
|
const HistoryCaptain({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MyScafolld(
|
||||||
|
title: 'History Page'.tr,
|
||||||
|
body: [],
|
||||||
|
isleading: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
104
lib/views/home/Captin/home_captain/drawer_captain.dart
Normal file
104
lib/views/home/Captin/home_captain/drawer_captain.dart
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/box_name.dart';
|
||||||
|
import 'package:ride/constant/colors.dart';
|
||||||
|
import 'package:ride/main.dart';
|
||||||
|
import 'package:ride/views/auth/captin/logout_captain.dart';
|
||||||
|
import 'package:ride/views/home/Captin/history_captain.dart';
|
||||||
|
import 'package:ride/views/home/Captin/home_captain/help_captain.dart';
|
||||||
|
import 'package:ride/views/home/Captin/settings_captain.dart';
|
||||||
|
import 'package:ride/views/home/my_wallet/walet_captain.dart';
|
||||||
|
import 'package:ride/views/home/profile/profile_captain.dart';
|
||||||
|
import 'package:ride/views/notification/notification_captain.dart';
|
||||||
|
|
||||||
|
class DrawerCaptain extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Drawer(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
// Other drawer items
|
||||||
|
UserAccountsDrawerHeader(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
AppColor.greenColor,
|
||||||
|
AppColor.yellowColor
|
||||||
|
], // Define your gradient colors
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
accountName: Text(box.read(BoxName.nameDriver)),
|
||||||
|
accountEmail: Text(box.read(BoxName.emailDriver)),
|
||||||
|
currentAccountPicture: const CircleAvatar(
|
||||||
|
backgroundImage: AssetImage('path_to_profile_image'),
|
||||||
|
), //todo image from server
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.account_balance_wallet),
|
||||||
|
title: const Text('Wallet'),
|
||||||
|
onTap: () {
|
||||||
|
// Handle wallet item tap
|
||||||
|
Get.to(() => const WaletCaptain(), transition: Transition.native);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.person),
|
||||||
|
title: const Text('Profile'),
|
||||||
|
onTap: () {
|
||||||
|
// Handle profile item tap
|
||||||
|
Get.to(() => const ProfileCaptain(),
|
||||||
|
transition: Transition.rightToLeftWithFade);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.history),
|
||||||
|
title: const Text('History of Trip'),
|
||||||
|
onTap: () {
|
||||||
|
Get.to(() => const HistoryCaptain(),
|
||||||
|
transition: Transition.downToUp);
|
||||||
|
// Handle history of trip item tap
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.notifications),
|
||||||
|
title: const Text('Notifications'),
|
||||||
|
onTap: () {
|
||||||
|
// Handle notifications item tap
|
||||||
|
Get.to(() => const NotificationCaptain(),
|
||||||
|
transition: Transition.upToDown);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.help),
|
||||||
|
title: const Text('Helping Center'),
|
||||||
|
onTap: () {
|
||||||
|
// Handle helping center item tap
|
||||||
|
Get.to(() => const HelpCaptain(), transition: Transition.size);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.settings),
|
||||||
|
title: const Text('Settings'),
|
||||||
|
onTap: () {
|
||||||
|
// Handle settings item tap
|
||||||
|
Get.to(() => const SettingsCaptain(),
|
||||||
|
transition: Transition.cupertino);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.exit_to_app),
|
||||||
|
title: const Text('Sign Out'),
|
||||||
|
onTap: () {
|
||||||
|
// Handle sign out item tap
|
||||||
|
Get.to(() => const LogoutCaptain(),
|
||||||
|
transition: Transition.cupertinoDialog);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
lib/views/home/Captin/home_captain/help_captain.dart
Normal file
16
lib/views/home/Captin/home_captain/help_captain.dart
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
class HelpCaptain extends StatelessWidget {
|
||||||
|
const HelpCaptain({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MyScafolld(
|
||||||
|
title: 'Helping Page'.tr,
|
||||||
|
body: [],
|
||||||
|
isleading: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,27 +1,22 @@
|
|||||||
import 'package:flutter/material.dart';
|
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: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/home/captin/home_captain_controller.dart';
|
|
||||||
import 'package:ride/controller/home/captin/order_request_controller.dart';
|
|
||||||
import 'package:ride/controller/home/captin/widget/left_menu_map_captain.dart';
|
|
||||||
import 'package:ride/controller/payment/payment_controller.dart';
|
|
||||||
import 'package:ride/main.dart';
|
|
||||||
import 'package:ride/views/Rate/ride_calculate_driver.dart';
|
|
||||||
import 'package:ride/views/home/Captin/bottom_bar.dart';
|
|
||||||
import 'package:ride/views/home/Captin/camer_widget.dart';
|
|
||||||
import 'package:ride/views/home/Captin/text_scanner.dart';
|
|
||||||
import 'package:ride/views/widgets/circle_container.dart';
|
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
|
import 'package:ride/views/home/Captin/home_captain/drawer_captain.dart';
|
||||||
|
|
||||||
import '../../../controller/functions/location_controller.dart';
|
import '../../../../constant/colors.dart';
|
||||||
import '../../../controller/home/captin/widget/connect.dart';
|
import '../../../../constant/info.dart';
|
||||||
import '../../widgets/mycircular.dart';
|
import '../../../../constant/style.dart';
|
||||||
import 'passportimage.dart';
|
import '../../../../constant/table_names.dart';
|
||||||
|
import '../../../../controller/functions/location_controller.dart';
|
||||||
|
import '../../../../controller/home/captin/home_captain_controller.dart';
|
||||||
|
import '../../../../controller/home/captin/order_request_controller.dart';
|
||||||
|
import '../../../../controller/home/captin/widget/connect.dart';
|
||||||
|
import '../../../../controller/home/captin/widget/left_menu_map_captain.dart';
|
||||||
|
import '../../../../main.dart';
|
||||||
|
import '../../../widgets/circle_container.dart';
|
||||||
|
import '../../../widgets/elevated_btn.dart';
|
||||||
|
import '../text_scanner.dart';
|
||||||
|
|
||||||
class HomeCaptain extends StatelessWidget {
|
class HomeCaptain extends StatelessWidget {
|
||||||
HomeCaptain({super.key});
|
HomeCaptain({super.key});
|
||||||
@@ -65,15 +60,7 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
)))
|
)))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
drawer: Drawer(
|
drawer: DrawerCaptain(),
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
// Other drawer items
|
|
||||||
|
|
||||||
MyElevatedButton(title: 'Sign Out'.tr, onPressed: () {})
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
GetBuilder<HomeCaptainController>(
|
GetBuilder<HomeCaptainController>(
|
||||||
@@ -100,43 +87,11 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
// liteModeEnabled: true,
|
// liteModeEnabled: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// GetBuilder<LocationController>(
|
|
||||||
// builder: (locationController) => Column(
|
|
||||||
// children: [
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// '${locationController.myLocation}',
|
|
||||||
// style: AppStyle.subtitle,
|
|
||||||
// ),
|
|
||||||
// Text(
|
|
||||||
// '${DateTime.now()}',
|
|
||||||
// style: AppStyle.subtitle,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// // TextButton(
|
|
||||||
// // onPressed: () {
|
|
||||||
// // MyClass().exampleUsage();
|
|
||||||
// // },
|
|
||||||
// // child: Text(
|
|
||||||
// // "Text Button",
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// ],
|
|
||||||
// )),
|
|
||||||
|
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 10,
|
bottom: 10,
|
||||||
right: Get.width * .1,
|
right: Get.width * .1,
|
||||||
left: Get.width * .1,
|
left: Get.width * .1,
|
||||||
child: const ConnectWidget()),
|
child: const ConnectWidget()),
|
||||||
|
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 5,
|
top: 5,
|
||||||
right: Get.width * .17,
|
right: Get.width * .17,
|
||||||
@@ -226,55 +181,6 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// TextButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// Get.to(
|
|
||||||
// () => CameraWidgetCardId(),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// child: const Text(
|
|
||||||
// "Text IdCamera",
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// Get.to(
|
|
||||||
// () => CameraWidgetPassPort(),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// child: const Text(
|
|
||||||
// " CameraWidgetPassPort",
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// Get.to(() => HomeScreen());
|
|
||||||
// },
|
|
||||||
// child: const Text(
|
|
||||||
// "Home Screen",
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
Get.to(() => const TextRecognizerAPI());
|
|
||||||
},
|
|
||||||
child: const Text(
|
|
||||||
"scan licnse",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// PaymentController().makePayment(
|
|
||||||
// 14,
|
|
||||||
// 'USD',
|
|
||||||
// () => Get.snackbar('Yes you pay success', '',
|
|
||||||
// backgroundColor: Colors.greenAccent));
|
|
||||||
// },
|
|
||||||
// child: const Text(
|
|
||||||
// "Pay 18 dollar",
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
|
|
||||||
leftMainMenuCaptainIcons(),
|
leftMainMenuCaptainIcons(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -41,7 +41,9 @@ class SosConnect extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
launchCommunication(
|
launchCommunication(
|
||||||
'whatsapp',
|
'whatsapp',
|
||||||
'0798583052', //todo add number from driver
|
'962' +
|
||||||
|
box.read(BoxName
|
||||||
|
.phoneDriver), //todo add number from driver
|
||||||
'Hello this is Captain'.tr +
|
'Hello this is Captain'.tr +
|
||||||
' ${box.read(BoxName.nameDriver)}');
|
' ${box.read(BoxName.nameDriver)}');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import 'package:ride/main.dart';
|
|||||||
import 'package:ride/views/home/Captin/driver_map_page.dart';
|
import 'package:ride/views/home/Captin/driver_map_page.dart';
|
||||||
import 'package:ride/views/widgets/my_scafold.dart';
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
import '../../constant/colors.dart';
|
import '../../../../constant/colors.dart';
|
||||||
import '../../constant/links.dart';
|
import '../../../../constant/links.dart';
|
||||||
import '../../constant/style.dart';
|
import '../../../../constant/style.dart';
|
||||||
import '../../controller/functions/crud.dart';
|
import '../../../../controller/functions/crud.dart';
|
||||||
import '../../controller/functions/launch.dart';
|
import '../../../../controller/functions/launch.dart';
|
||||||
import '../../controller/home/captin/order_request_controller.dart';
|
import '../../../../controller/home/captin/order_request_controller.dart';
|
||||||
import '../widgets/elevated_btn.dart';
|
import '../../../widgets/elevated_btn.dart';
|
||||||
|
|
||||||
class OrderRequestPage extends StatelessWidget {
|
class OrderRequestPage extends StatelessWidget {
|
||||||
OrderRequestPage({super.key});
|
OrderRequestPage({super.key});
|
||||||
16
lib/views/home/Captin/settings_captain.dart
Normal file
16
lib/views/home/Captin/settings_captain.dart
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
class SettingsCaptain extends StatelessWidget {
|
||||||
|
const SettingsCaptain({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MyScafolld(
|
||||||
|
title: 'Settings'.tr,
|
||||||
|
body: [],
|
||||||
|
isleading: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:ride/constant/colors.dart';
|
import '../../constant/colors.dart';
|
||||||
import 'package:ride/controller/home/map_passenger_controller.dart';
|
import '../../controller/home/map_passenger_controller.dart';
|
||||||
import 'package:ride/views/home/map_widget.dart/cancel_raide_page.dart';
|
import '../../views/home/map_widget.dart/cancel_raide_page.dart';
|
||||||
import 'package:ride/views/home/map_widget.dart/ride_begin_passenger.dart';
|
import '../../views/home/map_widget.dart/ride_begin_passenger.dart';
|
||||||
|
|
||||||
import '../../controller/home/menu_controller.dart';
|
import '../../controller/home/menu_controller.dart';
|
||||||
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
import 'map_widget.dart/buttom_sheet_map_show.dart';
|
||||||
import 'map_widget.dart/cash_confirm_bottom_page.dart';
|
import 'map_widget.dart/cash_confirm_bottom_page.dart';
|
||||||
import 'map_widget.dart/driver_card_from_passenger.dart';
|
import 'map_widget.dart/driver_card_from_passenger.dart';
|
||||||
import 'map_widget.dart/google_map_passenger_widget.dart';
|
import 'map_widget.dart/google_map_passenger_widget.dart';
|
||||||
import 'map_widget.dart/left_main_menu_icons.dart';
|
import 'map_widget.dart/left_main_menu_icons.dart'; //Ml@6Pt@11
|
||||||
import 'map_widget.dart/main_bottom_Menu_map.dart';
|
import 'map_widget.dart/main_bottom_Menu_map.dart';
|
||||||
import 'map_widget.dart/map_menu_widget.dart';
|
import 'map_widget.dart/map_menu_widget.dart';
|
||||||
import 'map_widget.dart/menu_map_page.dart';
|
import 'map_widget.dart/menu_map_page.dart';
|
||||||
|
|||||||
17
lib/views/home/my_wallet/walet_captain.dart
Normal file
17
lib/views/home/my_wallet/walet_captain.dart
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
class WaletCaptain extends StatelessWidget {
|
||||||
|
const WaletCaptain({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MyScafolld(
|
||||||
|
title: 'Wallet'.tr,
|
||||||
|
body: [],
|
||||||
|
isleading: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
lib/views/home/profile/profile_captain.dart
Normal file
16
lib/views/home/profile/profile_captain.dart
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
class ProfileCaptain extends StatelessWidget {
|
||||||
|
const ProfileCaptain({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MyScafolld(
|
||||||
|
title: 'My Profile'.tr,
|
||||||
|
body: [],
|
||||||
|
isleading: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
lib/views/notification/notification_captain.dart
Normal file
16
lib/views/notification/notification_captain.dart
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
class NotificationCaptain extends StatelessWidget {
|
||||||
|
const NotificationCaptain({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MyScafolld(
|
||||||
|
title: 'Notifications'.tr,
|
||||||
|
body: [],
|
||||||
|
isleading: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user