6/22/1
This commit is contained in:
@@ -55,8 +55,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 32
|
versionCode 35
|
||||||
versionName '1.5.32'
|
versionName '1.5.35'
|
||||||
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 916 KiB After Width: | Height: | Size: 4.6 MiB |
@@ -21,7 +21,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>33</string>
|
<string>35</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>4.0.33</string>
|
<string>4.0.35</string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
<string>NO</string>
|
<string>NO</string>
|
||||||
<key>GMSApiKey</key>
|
<key>GMSApiKey</key>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ class AuthController extends GetxController {
|
|||||||
await _auth.signInWithCredential(credential);
|
await _auth.signInWithCredential(credential);
|
||||||
return userCredential.user;
|
return userCredential.user;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
print("Error during Apple sign-in: $error");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ class HistoryCaptainController extends GetxController {
|
|||||||
payload: {'driver_id': box.read(BoxName.driverID)});
|
payload: {'driver_id': box.read(BoxName.driverID)});
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
historyData = jsonDecode(res);
|
historyData = jsonDecode(res);
|
||||||
print(historyData);
|
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
@@ -48,7 +47,6 @@ class HistoryCaptainController extends GetxController {
|
|||||||
var res = await CRUD()
|
var res = await CRUD()
|
||||||
.get(link: AppLink.getRideOrderID, payload: {'id': orderId});
|
.get(link: AppLink.getRideOrderID, payload: {'id': orderId});
|
||||||
historyDetailsData = jsonDecode(res);
|
historyDetailsData = jsonDecode(res);
|
||||||
print(historyDetailsData);
|
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
Get.to(() => HistoryDetailsPage());
|
Get.to(() => HistoryDetailsPage());
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'dart:math';
|
|||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
import 'package:SEFER/controller/functions/location_background_controller.dart';
|
import 'package:SEFER/controller/functions/location_background_controller.dart';
|
||||||
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
|
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
|
||||||
import 'package:SEFER/views/auth/captin/register_captin.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -30,7 +29,6 @@ class LoginCaptinController extends GetxController {
|
|||||||
final location = Location();
|
final location = Location();
|
||||||
void changeAgreeTerm() {
|
void changeAgreeTerm() {
|
||||||
isAgreeTerms = !isAgreeTerms;
|
isAgreeTerms = !isAgreeTerms;
|
||||||
print(isAgreeTerms);
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +56,6 @@ class LoginCaptinController extends GetxController {
|
|||||||
'phone': phoneController.text,
|
'phone': phoneController.text,
|
||||||
'password': passwordController.text
|
'password': passwordController.text
|
||||||
});
|
});
|
||||||
print(res);
|
|
||||||
if (res == 'failure') {
|
if (res == 'failure') {
|
||||||
//Failure
|
//Failure
|
||||||
isloading = false;
|
isloading = false;
|
||||||
@@ -66,10 +63,8 @@ class LoginCaptinController extends GetxController {
|
|||||||
Get.snackbar('Failure', '', backgroundColor: Colors.red);
|
Get.snackbar('Failure', '', backgroundColor: Colors.red);
|
||||||
} else {
|
} else {
|
||||||
var jsonDecoeded = jsonDecode(res);
|
var jsonDecoeded = jsonDecode(res);
|
||||||
// print(jsonDecoeded);
|
|
||||||
if (jsonDecoeded.isNotEmpty) {
|
if (jsonDecoeded.isNotEmpty) {
|
||||||
if (jsonDecoeded['status'] == 'success') {
|
if (jsonDecoeded['status'] == 'success') {
|
||||||
print(jsonDecoeded['data'][0]['verified']);
|
|
||||||
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
||||||
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
||||||
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
||||||
@@ -81,12 +76,10 @@ class LoginCaptinController extends GetxController {
|
|||||||
Get.offAll(() => HomeCaptain());
|
Get.offAll(() => HomeCaptain());
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
print(box.read(BoxName.driverID).toString());
|
|
||||||
print(box.read(BoxName.tokenDriver));
|
|
||||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||||
'token': box.read(BoxName.tokenDriver),
|
'token': box.read(BoxName.tokenDriver),
|
||||||
'captain_id': box.read(BoxName.driverID).toString()
|
'captain_id': box.read(BoxName.driverID).toString()
|
||||||
}).then((value) => print('cccc'));
|
});
|
||||||
} else {
|
} else {
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
@@ -99,7 +92,7 @@ class LoginCaptinController extends GetxController {
|
|||||||
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
|
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
|
||||||
'email': emailController.text,
|
'email': emailController.text,
|
||||||
'token': randomNumber.toString(),
|
'token': randomNumber.toString(),
|
||||||
}).then((value) => print(value));
|
});
|
||||||
Get.to(() => VerifyEmailCaptainPage());
|
Get.to(() => VerifyEmailCaptainPage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -111,7 +104,6 @@ class LoginCaptinController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print('res is null');
|
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -125,7 +117,6 @@ class LoginCaptinController extends GetxController {
|
|||||||
'email': email,
|
'email': email,
|
||||||
'id': driverID,
|
'id': driverID,
|
||||||
});
|
});
|
||||||
print(res);
|
|
||||||
if (res == 'Failure') {
|
if (res == 'Failure') {
|
||||||
//Failure
|
//Failure
|
||||||
Get.offAll(() => SmsSignupEgypt());
|
Get.offAll(() => SmsSignupEgypt());
|
||||||
@@ -134,7 +125,6 @@ class LoginCaptinController extends GetxController {
|
|||||||
// Get.snackbar('Failure', '', backgroundColor: Colors.red);
|
// Get.snackbar('Failure', '', backgroundColor: Colors.red);
|
||||||
} else {
|
} else {
|
||||||
var jsonDecoeded = jsonDecode(res);
|
var jsonDecoeded = jsonDecode(res);
|
||||||
// print(jsonDecoeded['data'][0]['is_verified']);
|
|
||||||
if (jsonDecoeded.isNotEmpty) {
|
if (jsonDecoeded.isNotEmpty) {
|
||||||
if (jsonDecoeded['status'] == 'success' &&
|
if (jsonDecoeded['status'] == 'success' &&
|
||||||
jsonDecoeded['data'][0]['is_verified'] == 1) {
|
jsonDecoeded['data'][0]['is_verified'] == 1) {
|
||||||
@@ -147,12 +137,10 @@ class LoginCaptinController extends GetxController {
|
|||||||
'${jsonDecoeded['data'][0]['first_name']}'
|
'${jsonDecoeded['data'][0]['first_name']}'
|
||||||
' ${jsonDecoeded['data'][0]['last_name']}');
|
' ${jsonDecoeded['data'][0]['last_name']}');
|
||||||
|
|
||||||
print(box.read(BoxName.tokenDriver));
|
|
||||||
var token = await CRUD().get(
|
var token = await CRUD().get(
|
||||||
link: AppLink.getDriverToken,
|
link: AppLink.getDriverToken,
|
||||||
payload: {'captain_id': box.read(BoxName.driverID).toString()});
|
payload: {'captain_id': box.read(BoxName.driverID).toString()});
|
||||||
print(token);
|
|
||||||
print(box.read(BoxName.tokenDriver));
|
|
||||||
if (token != 'failure') {
|
if (token != 'failure') {
|
||||||
if (jsonDecode(token)['data'][0]['token'] !=
|
if (jsonDecode(token)['data'][0]['token'] !=
|
||||||
box.read(BoxName.tokenDriver)) {
|
box.read(BoxName.tokenDriver)) {
|
||||||
@@ -165,7 +153,7 @@ class LoginCaptinController extends GetxController {
|
|||||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||||
'token': box.read(BoxName.tokenDriver),
|
'token': box.read(BoxName.tokenDriver),
|
||||||
'captain_id': box.read(BoxName.driverID).toString()
|
'captain_id': box.read(BoxName.driverID).toString()
|
||||||
}).then((value) => print('cccc'));
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +166,6 @@ class LoginCaptinController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print('res is null');
|
|
||||||
Get.snackbar('failure'.tr, '', backgroundColor: AppColor.redColor);
|
Get.snackbar('failure'.tr, '', backgroundColor: AppColor.redColor);
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
|
|||||||
@@ -85,19 +85,15 @@ class CarRegistrationRecognizerController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String result = lines.map((map) => map.values.first.toString()).join(' ');
|
String result = lines.map((map) => map.values.first.toString()).join(' ');
|
||||||
// print(result.length);
|
|
||||||
if (result.length > 2200) {
|
if (result.length > 2200) {
|
||||||
result = result.substring(0, 2200);
|
result = result.substring(0, 2200);
|
||||||
}
|
}
|
||||||
// print('jsonOutput------------------------------');
|
|
||||||
// print(result);
|
|
||||||
Map result2 = await LlamaAi().getCarRegistrationData(result,
|
Map result2 = await LlamaAi().getCarRegistrationData(result,
|
||||||
'vin,make,made,year,expiration_date,color,owner,registration_date'); //
|
'vin,make,made,year,expiration_date,color,owner,registration_date'); //
|
||||||
|
|
||||||
// Assign the result to the extracted variable
|
// Assign the result to the extracted variable
|
||||||
extracted = result2;
|
extracted = result2;
|
||||||
|
|
||||||
print('extracted is ' + extracted.toString());
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ class RegisterCaptainController extends GetxController {
|
|||||||
'expireDate': expireDate,
|
'expireDate': expireDate,
|
||||||
'dateOfBirth': dob,
|
'dateOfBirth': dob,
|
||||||
});
|
});
|
||||||
print(jsonDecode(res));
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
if (jsonDecode(res)['status'] == 'success') {
|
if (jsonDecode(res)['status'] == 'success') {
|
||||||
@@ -199,7 +198,6 @@ class RegisterCaptainController extends GetxController {
|
|||||||
'owner': owner,
|
'owner': owner,
|
||||||
'registrationDate': registrationDate,
|
'registrationDate': registrationDate,
|
||||||
});
|
});
|
||||||
print(jsonDecode(res));
|
|
||||||
box.write(BoxName.vin, vin);
|
box.write(BoxName.vin, vin);
|
||||||
box.write(BoxName.make, make);
|
box.write(BoxName.make, make);
|
||||||
box.write(BoxName.model, model);
|
box.write(BoxName.model, model);
|
||||||
@@ -243,7 +241,7 @@ class RegisterCaptainController extends GetxController {
|
|||||||
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
|
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
|
||||||
'email': emailController.text,
|
'email': emailController.text,
|
||||||
'token': randomNumber.toString(),
|
'token': randomNumber.toString(),
|
||||||
}).then((value) => print(value));
|
});
|
||||||
Get.to(() => VerifyEmailCaptainPage());
|
Get.to(() => VerifyEmailCaptainPage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class GoogleSignInHelper {
|
|||||||
}
|
}
|
||||||
return googleUser;
|
return googleUser;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
print('Google Sign-In error: $error');
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,7 +50,6 @@ class GoogleSignInHelper {
|
|||||||
}
|
}
|
||||||
return googleUser;
|
return googleUser;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
print('Google Sign-In error: $error');
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,10 +59,7 @@ class GoogleSignInHelper {
|
|||||||
try {
|
try {
|
||||||
await _googleSignIn.signOut();
|
await _googleSignIn.signOut();
|
||||||
await _handleSignOut();
|
await _handleSignOut();
|
||||||
print('User signed out.');
|
} catch (error) {}
|
||||||
} catch (error) {
|
|
||||||
print('Google Sign-Out error: $error');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> _handleSignOut() async {
|
static Future<void> _handleSignOut() async {
|
||||||
@@ -88,8 +83,6 @@ class GoogleSignInHelper {
|
|||||||
Get.offAll(OnBoardingPage());
|
Get.offAll(OnBoardingPage());
|
||||||
// Perform any additional sign-out tasks or API calls here
|
// Perform any additional sign-out tasks or API calls here
|
||||||
// For example, you can notify your server about the user sign-out
|
// For example, you can notify your server about the user sign-out
|
||||||
|
|
||||||
print('User data cleared.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method to get the current signed-in user
|
// Method to get the current signed-in user
|
||||||
@@ -107,10 +100,5 @@ class GoogleSignInHelper {
|
|||||||
|
|
||||||
// Perform any additional sign-up tasks or API calls here
|
// Perform any additional sign-up tasks or API calls here
|
||||||
// For example, you can send the user data to your server for registration
|
// For example, you can send the user data to your server for registration
|
||||||
|
|
||||||
print('driverID = ${box.read(BoxName.driverID)}');
|
|
||||||
print('emailDriver = ${box.read(BoxName.emailDriver)}');
|
|
||||||
// print('nameDriver = ${box.read(BoxName.nameDriver)}');
|
|
||||||
// print('driverPhotoUrl = ${box.read(BoxName.driverPhotoUrl)}');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -12,8 +11,6 @@ import 'package:SEFER/controller/functions/secure_storage.dart';
|
|||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/auth/verify_email_page.dart';
|
import 'package:SEFER/views/auth/verify_email_page.dart';
|
||||||
|
|
||||||
import '../functions/device_info.dart';
|
|
||||||
|
|
||||||
class LoginController extends GetxController {
|
class LoginController extends GetxController {
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
final formKeyAdmin = GlobalKey<FormState>();
|
final formKeyAdmin = GlobalKey<FormState>();
|
||||||
@@ -28,7 +25,6 @@ class LoginController extends GetxController {
|
|||||||
|
|
||||||
void changeAgreeTerm() {
|
void changeAgreeTerm() {
|
||||||
isAgreeTerms = !isAgreeTerms;
|
isAgreeTerms = !isAgreeTerms;
|
||||||
print(isAgreeTerms);
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,12 +52,9 @@ class LoginController extends GetxController {
|
|||||||
//Failure
|
//Failure
|
||||||
Get.snackbar('Failure', '', backgroundColor: Colors.red);
|
Get.snackbar('Failure', '', backgroundColor: Colors.red);
|
||||||
} else {
|
} else {
|
||||||
// print(res);
|
|
||||||
var jsonDecoeded = jsonDecode(res);
|
var jsonDecoeded = jsonDecode(res);
|
||||||
// print(jsonDecoeded);
|
|
||||||
if (jsonDecoeded.isNotEmpty) {
|
if (jsonDecoeded.isNotEmpty) {
|
||||||
if (jsonDecoeded['status'] == 'success') {
|
if (jsonDecoeded['status'] == 'success') {
|
||||||
print(jsonDecoeded['data'][0]['verified']);
|
|
||||||
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
||||||
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
||||||
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
||||||
@@ -75,12 +68,10 @@ class LoginController extends GetxController {
|
|||||||
// Get.offAll(() => const MapPagePassenger());
|
// Get.offAll(() => const MapPagePassenger());
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
print(box.read(BoxName.passengerID).toString());
|
|
||||||
print(box.read(BoxName.tokenFCM));
|
|
||||||
await CRUD().post(link: AppLink.addTokens, payload: {
|
await CRUD().post(link: AppLink.addTokens, payload: {
|
||||||
'token': box.read(BoxName.tokenFCM),
|
'token': box.read(BoxName.tokenFCM),
|
||||||
'passengerID': box.read(BoxName.passengerID).toString()
|
'passengerID': box.read(BoxName.passengerID).toString()
|
||||||
}).then((value) => print('cccc'));
|
});
|
||||||
} else {
|
} else {
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
@@ -93,7 +84,7 @@ class LoginController extends GetxController {
|
|||||||
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
|
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
|
||||||
'email': emailController.text,
|
'email': emailController.text,
|
||||||
'token': randomNumber.toString(),
|
'token': randomNumber.toString(),
|
||||||
}).then((value) => print(value));
|
});
|
||||||
Get.to(() => const VerifyEmailPage());
|
Get.to(() => const VerifyEmailPage());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -105,7 +96,6 @@ class LoginController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print('res is null');
|
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,14 +83,12 @@ class RegisterController extends GetxController {
|
|||||||
'site': siteController.text,
|
'site': siteController.text,
|
||||||
'birthdate': birthDate,
|
'birthdate': birthDate,
|
||||||
});
|
});
|
||||||
print(jsonDecode(res));
|
|
||||||
if (jsonDecode(res)['status'] == 'success') {
|
if (jsonDecode(res)['status'] == 'success') {
|
||||||
print('sdfffffffffff');
|
|
||||||
int randomNumber = Random().nextInt(100000) + 1;
|
int randomNumber = Random().nextInt(100000) + 1;
|
||||||
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
|
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
|
||||||
'email': emailController.text,
|
'email': emailController.text,
|
||||||
'token': randomNumber.toString(),
|
'token': randomNumber.toString(),
|
||||||
}).then((value) => print(value));
|
});
|
||||||
Get.to(() => const VerifyEmailPage());
|
Get.to(() => const VerifyEmailPage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,10 +29,7 @@ class TokenController extends GetxController {
|
|||||||
|
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
print(res.request);
|
|
||||||
print(res.body);
|
|
||||||
var jsonToken = jsonDecode(res.body);
|
var jsonToken = jsonDecode(res.body);
|
||||||
// print(jsonToken);
|
|
||||||
if (jsonToken['status'] == 'The token has been updated successfully.') {
|
if (jsonToken['status'] == 'The token has been updated successfully.') {
|
||||||
Get.snackbar('token updated'.tr, '');
|
Get.snackbar('token updated'.tr, '');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// Get the current notification settings
|
// Get the current notification settings
|
||||||
NotificationSettings? notificationSettings =
|
NotificationSettings? notificationSettings =
|
||||||
await FirebaseMessaging.instance.getNotificationSettings();
|
await FirebaseMessaging.instance.getNotificationSettings();
|
||||||
print(
|
'Notification authorization status: ${notificationSettings.authorizationStatus}';
|
||||||
'Notification authorization status: ${notificationSettings.authorizationStatus}');
|
|
||||||
|
|
||||||
// Call the update function if needed
|
// Call the update function if needed
|
||||||
update();
|
update();
|
||||||
@@ -57,7 +56,6 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
provisional: false,
|
provisional: false,
|
||||||
sound: true,
|
sound: true,
|
||||||
);
|
);
|
||||||
print('User granted permission: ${settings.authorizationStatus}');
|
|
||||||
messaging.setForegroundNotificationPresentationOptions(
|
messaging.setForegroundNotificationPresentationOptions(
|
||||||
alert: true, badge: true, sound: true);
|
alert: true, badge: true, sound: true);
|
||||||
}
|
}
|
||||||
@@ -66,8 +64,6 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
Future getToken() async {
|
Future getToken() async {
|
||||||
fcmToken.getToken().then((token) {
|
fcmToken.getToken().then((token) {
|
||||||
box.write(BoxName.tokenDriver, token);
|
box.write(BoxName.tokenDriver, token);
|
||||||
|
|
||||||
print(token);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||||
@@ -82,14 +78,12 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
FirebaseMessaging.onBackgroundMessage((RemoteMessage message) async {
|
FirebaseMessaging.onBackgroundMessage((RemoteMessage message) async {
|
||||||
// Handle background message
|
// Handle background message
|
||||||
if (message.data.isNotEmpty && message.notification != null) {
|
if (message.data.isNotEmpty && message.notification != null) {
|
||||||
print(message.notification?.title);
|
|
||||||
fireBaseTitles(message);
|
fireBaseTitles(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
||||||
if (message.data.isNotEmpty && message.notification != null) {
|
if (message.data.isNotEmpty && message.notification != null) {
|
||||||
print(message.notification?.title);
|
|
||||||
fireBaseTitles(message);
|
fireBaseTitles(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -109,7 +103,6 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// This is for location using and uploading status
|
// This is for location using and uploading status
|
||||||
Get.put(HomeCaptainController()).changeRideId();
|
Get.put(HomeCaptainController()).changeRideId();
|
||||||
update();
|
update();
|
||||||
// print('driverToken==============$driverToken');
|
|
||||||
Get.to(() => OrderRequestPage(), arguments: {
|
Get.to(() => OrderRequestPage(), arguments: {
|
||||||
'myListString': myListString,
|
'myListString': myListString,
|
||||||
'DriverList': myList,
|
'DriverList': myList,
|
||||||
@@ -153,9 +146,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// token: driverList[0].toString(),
|
// token: driverList[0].toString(),
|
||||||
// remoteID: driverList[2].toString(),
|
// remoteID: driverList[2].toString(),
|
||||||
// ));
|
// ));
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
print('Error navigating to PassengerCallPage: $e');
|
|
||||||
}
|
|
||||||
} else if (message.notification!.title! == 'Call Income from Passenger') {
|
} else if (message.notification!.title! == 'Call Income from Passenger') {
|
||||||
try {
|
try {
|
||||||
var myListString = message.data['passengerList'];
|
var myListString = message.data['passengerList'];
|
||||||
@@ -173,9 +164,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// token: driverList[0].toString(),
|
// token: driverList[0].toString(),
|
||||||
// remoteID: driverList[2].toString(),
|
// remoteID: driverList[2].toString(),
|
||||||
));
|
));
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
print('Error navigating to PassengerCallPage: $e');
|
|
||||||
}
|
|
||||||
} else if (message.notification!.title! == 'Call End') {
|
} else if (message.notification!.title! == 'Call End') {
|
||||||
try {
|
try {
|
||||||
var myListString = message.data['passengerList'];
|
var myListString = message.data['passengerList'];
|
||||||
@@ -189,9 +178,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
}
|
}
|
||||||
// Assuming GetMaterialApp is initialized and context is valid for navigation
|
// Assuming GetMaterialApp is initialized and context is valid for navigation
|
||||||
Get.off(const CallPage());
|
Get.off(const CallPage());
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
print('Error navigating to PassengerCallPage: $e');
|
|
||||||
}
|
|
||||||
} else if (message.notification!.title! == 'Order Applied') {
|
} else if (message.notification!.title! == 'Order Applied') {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"The order has been accepted by another driver."
|
"The order has been accepted by another driver."
|
||||||
@@ -209,7 +196,6 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// var myPoints = jsonDecode(points) as List<dynamic>;
|
// var myPoints = jsonDecode(points) as List<dynamic>;
|
||||||
driverToken = myList[14].toString();
|
driverToken = myList[14].toString();
|
||||||
update();
|
update();
|
||||||
// print('driverToken==============$driverToken');
|
|
||||||
Get.to(() => OrderSpeedRequest(), arguments: {
|
Get.to(() => OrderSpeedRequest(), arguments: {
|
||||||
'myListString': myListString,
|
'myListString': myListString,
|
||||||
'DriverList': myList,
|
'DriverList': myList,
|
||||||
@@ -364,7 +350,6 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// Save the list of tokens back to the box.
|
// Save the list of tokens back to the box.
|
||||||
// box.write(BoxName.tokens, tokens);
|
// box.write(BoxName.tokens, tokens);
|
||||||
tokens = box.read(BoxName.tokens);
|
tokens = box.read(BoxName.tokens);
|
||||||
// print(tokens);
|
|
||||||
for (var i = 0; i < tokens.length; i++) {
|
for (var i = 0; i < tokens.length; i++) {
|
||||||
http
|
http
|
||||||
.post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
.post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
|
||||||
@@ -387,9 +372,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
'to': tokens[i],
|
'to': tokens[i],
|
||||||
}))
|
}))
|
||||||
.whenComplete(() {})
|
.whenComplete(() {})
|
||||||
.catchError((e) {
|
.catchError((e) {});
|
||||||
print('sendNotification() error: $e');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,7 +399,6 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// }))
|
// }))
|
||||||
// .whenComplete(() {})
|
// .whenComplete(() {})
|
||||||
// .catchError((e) {
|
// .catchError((e) {
|
||||||
// print('sendNotification() error: $e');
|
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -446,15 +428,12 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
// Notification sent successfully
|
// Notification sent successfully
|
||||||
print('Notification sent successfully');
|
|
||||||
} else {
|
} else {
|
||||||
// Handle error response
|
// Handle error response
|
||||||
print(
|
'Failed to send notification. Status code: ${response.statusCode}';
|
||||||
'Failed to send notification. Status code: ${response.statusCode}');
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle other exceptions
|
// Handle other exceptions
|
||||||
print('sendNotification() error: $e');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,15 +462,12 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
// Notification sent successfully
|
// Notification sent successfully
|
||||||
print('Notification sent successfully');
|
|
||||||
} else {
|
} else {
|
||||||
// Handle error response
|
// Handle error response
|
||||||
print(
|
'Failed to send notification. Status code: ${response.statusCode}';
|
||||||
'Failed to send notification. Status code: ${response.statusCode}');
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle other exceptions
|
// Handle other exceptions
|
||||||
print('sendNotification() error: $e');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,15 +498,12 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
// Notification sent successfully
|
// Notification sent successfully
|
||||||
print('Notification sent successfully');
|
|
||||||
} else {
|
} else {
|
||||||
// Handle error response
|
// Handle error response
|
||||||
print(
|
'Failed to send notification. Status code: ${response.statusCode}';
|
||||||
'Failed to send notification. Status code: ${response.statusCode}');
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle other exceptions
|
// Handle other exceptions
|
||||||
print('sendNotification() error: $e');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,15 +533,12 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
// Notification sent successfully
|
// Notification sent successfully
|
||||||
print('Notification sent successfully');
|
|
||||||
} else {
|
} else {
|
||||||
// Handle error response
|
// Handle error response
|
||||||
print(
|
'Failed to send notification. Status code: ${response.statusCode}';
|
||||||
'Failed to send notification. Status code: ${response.statusCode}');
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle other exceptions
|
// Handle other exceptions
|
||||||
print('sendNotification() error: $e');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -599,15 +569,12 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
// Notification sent successfully
|
// Notification sent successfully
|
||||||
print('Notification sent successfully');
|
|
||||||
} else {
|
} else {
|
||||||
// Handle error response
|
// Handle error response
|
||||||
print(
|
'Failed to send notification. Status code: ${response.statusCode}';
|
||||||
'Failed to send notification. Status code: ${response.statusCode}');
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle other exceptions
|
// Handle other exceptions
|
||||||
print('sendNotification() error: $e');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,6 @@ class CallController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initAgoraFull() async {
|
initAgoraFull() async {
|
||||||
print('channelName is $channelName');
|
|
||||||
print('remoteid is $remoteUid');
|
|
||||||
print('uid is $uid');
|
|
||||||
await fetchToken();
|
await fetchToken();
|
||||||
// Set up an instance of Agora engine
|
// Set up an instance of Agora engine
|
||||||
setupVoiceSDKEngine();
|
setupVoiceSDKEngine();
|
||||||
@@ -65,8 +62,6 @@ class CallController extends GetxController {
|
|||||||
//create an instance of the Agora engine
|
//create an instance of the Agora engine
|
||||||
agoraEngine = createAgoraRtcEngine();
|
agoraEngine = createAgoraRtcEngine();
|
||||||
await agoraEngine.initialize(RtcEngineContext(appId: AK.agoraAppId));
|
await agoraEngine.initialize(RtcEngineContext(appId: AK.agoraAppId));
|
||||||
print('eeeeeeeeeeeeeeeeeeee');
|
|
||||||
print(agoraEngine);
|
|
||||||
// Register the event handler
|
// Register the event handler
|
||||||
agoraEngine.registerEventHandler(
|
agoraEngine.registerEventHandler(
|
||||||
RtcEngineEventHandler(
|
RtcEngineEventHandler(
|
||||||
@@ -129,7 +124,6 @@ class CallController extends GetxController {
|
|||||||
var res = await CRUD()
|
var res = await CRUD()
|
||||||
.getAgoraToken(channelName: channelName, uid: uid.toString());
|
.getAgoraToken(channelName: channelName, uid: uid.toString());
|
||||||
token = res;
|
token = res;
|
||||||
print('token is $token');
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,10 +91,7 @@ class CameraClassController extends GetxController {
|
|||||||
http.StreamedResponse response = await request.send();
|
http.StreamedResponse response = await request.send();
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
print(await response.stream.bytesToString());
|
} else {}
|
||||||
} else {
|
|
||||||
print(response.reasonPhrase);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> uploadImage(File imageFile) async {
|
Future<String> uploadImage(File imageFile) async {
|
||||||
@@ -164,12 +161,9 @@ class CameraClassController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
|
|
||||||
// Print the JSON output
|
// Print the JSON output
|
||||||
print(jsonOutput);
|
|
||||||
|
|
||||||
// Get.back();
|
// Get.back();
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
print('Error capturing image: $e');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String getTextAsJSON(String text) {
|
String getTextAsJSON(String text) {
|
||||||
@@ -228,11 +222,8 @@ class CameraClassController extends GetxController {
|
|||||||
// textBlocks.toString(); // Convert the extracted text to JSON.
|
// textBlocks.toString(); // Convert the extracted text to JSON.
|
||||||
|
|
||||||
// // Print the JSON to the console.
|
// // Print the JSON to the console.
|
||||||
// print(jsonText);
|
|
||||||
// update();
|
// update();
|
||||||
// // print(text);
|
|
||||||
// } catch (e) {
|
// } catch (e) {
|
||||||
// print('Error during text extraction: $e');
|
|
||||||
// scannedText = '';
|
// scannedText = '';
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -27,15 +27,9 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print("-----request----" + response.request.toString());
|
|
||||||
// print("-----headers-----" + response.headers.toString());
|
|
||||||
print("-----payload-----" + payload.toString());
|
|
||||||
// if (response.statusCode == 200) {
|
// if (response.statusCode == 200) {
|
||||||
// print(response.body);
|
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
print(jsonData);
|
|
||||||
|
|
||||||
return response.body;
|
return response.body;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,11 +49,8 @@ class CRUD {
|
|||||||
|
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
var response = jsonDecode(res.body);
|
var response = jsonDecode(res.body);
|
||||||
print(await response);
|
|
||||||
return response['token'];
|
return response['token'];
|
||||||
} else {
|
} else {}
|
||||||
print(res.reasonPhrase);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> getLlama({
|
Future<dynamic> getLlama({
|
||||||
@@ -105,10 +96,8 @@ class CRUD {
|
|||||||
Future.delayed(const Duration(seconds: 2));
|
Future.delayed(const Duration(seconds: 2));
|
||||||
var extractedString =
|
var extractedString =
|
||||||
await arabicTextExtractByVisionAndAI(imagePath: imagePath);
|
await arabicTextExtractByVisionAndAI(imagePath: imagePath);
|
||||||
// print(extractedString);
|
|
||||||
var json = jsonDecode(extractedString);
|
var json = jsonDecode(extractedString);
|
||||||
var textValues = extractTextFromLines(json);
|
var textValues = extractTextFromLines(json);
|
||||||
print(textValues);
|
|
||||||
// await Get.put(AI()).geminiAiExtraction(prompt, textValues);
|
// await Get.put(AI()).geminiAiExtraction(prompt, textValues);
|
||||||
await Get.put(AI()).anthropicAI(textValues, prompt, imagePath);
|
await Get.put(AI()).anthropicAI(textValues, prompt, imagePath);
|
||||||
}
|
}
|
||||||
@@ -152,11 +141,8 @@ class CRUD {
|
|||||||
http.StreamedResponse response = await request.send();
|
http.StreamedResponse response = await request.send();
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
// print(await response.stream.bytesToString());
|
|
||||||
return await response.stream.bytesToString();
|
return await response.stream.bytesToString();
|
||||||
} else {
|
} else {}
|
||||||
print(response.reasonPhrase);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> getChatGPT({
|
Future<dynamic> getChatGPT({
|
||||||
@@ -210,12 +196,8 @@ class CRUD {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
print(response);
|
|
||||||
return response.body;
|
return response.body;
|
||||||
} else {
|
} else {}
|
||||||
print('eeeeeeeeerrrrorrrr ${response.statusCode}');
|
|
||||||
print(response.body);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> post({
|
Future<dynamic> post({
|
||||||
@@ -236,11 +218,8 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.request);
|
|
||||||
print(payload);
|
|
||||||
|
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
print(jsonData);
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
return response.body;
|
return response.body;
|
||||||
@@ -248,7 +227,6 @@ class CRUD {
|
|||||||
String errorMessage = jsonData['message'];
|
String errorMessage = jsonData['message'];
|
||||||
// Get.snackbar('Error'.tr, errorMessage.tr,
|
// Get.snackbar('Error'.tr, errorMessage.tr,
|
||||||
// backgroundColor: AppColor.redColor);
|
// backgroundColor: AppColor.redColor);
|
||||||
print(errorMessage.tr);
|
|
||||||
return (jsonData['status']);
|
return (jsonData['status']);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -267,11 +245,8 @@ class CRUD {
|
|||||||
);
|
);
|
||||||
var response = await http.post(url,
|
var response = await http.post(url,
|
||||||
body: payload, headers: {'Content-Type': 'application/json'});
|
body: payload, headers: {'Content-Type': 'application/json'});
|
||||||
print(response.request);
|
|
||||||
print(payload);
|
|
||||||
|
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
// print(jsonData);
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
return response.body;
|
return response.body;
|
||||||
@@ -297,13 +272,8 @@ class CRUD {
|
|||||||
request.headers.addAll(headers);
|
request.headers.addAll(headers);
|
||||||
|
|
||||||
http.StreamedResponse response = await request.send();
|
http.StreamedResponse response = await request.send();
|
||||||
// print(request.body);
|
|
||||||
// print(response);
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
print(await response.stream.bytesToString());
|
} else {}
|
||||||
} else {
|
|
||||||
print(response.reasonPhrase);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> postFromDialogue({
|
Future<dynamic> postFromDialogue({
|
||||||
@@ -324,9 +294,6 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
//print(response.request);
|
|
||||||
//print('body=========================');
|
|
||||||
//print(response.body);
|
|
||||||
|
|
||||||
if (response.body.isNotEmpty) {
|
if (response.body.isNotEmpty) {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
@@ -368,10 +335,7 @@ class CRUD {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 201) {
|
if (response.statusCode == 201) {
|
||||||
print('Verification request sent');
|
} else {}
|
||||||
} else {
|
|
||||||
print('Failed to send verification request');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prompt the user to enter the OTP
|
// Prompt the user to enter the OTP
|
||||||
final otpCode = "123456"; // Replace with user input
|
final otpCode = "123456"; // Replace with user input
|
||||||
@@ -394,10 +358,7 @@ class CRUD {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (checkResponse.statusCode == 201) {
|
if (checkResponse.statusCode == 201) {
|
||||||
print('Verification successful');
|
} else {}
|
||||||
} else {
|
|
||||||
print('Verification failed');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> getGoogleApi({
|
Future<dynamic> getGoogleApi({
|
||||||
@@ -411,9 +372,7 @@ class CRUD {
|
|||||||
url,
|
url,
|
||||||
body: payload,
|
body: payload,
|
||||||
);
|
);
|
||||||
print(response.request);
|
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
// //print(jsonData);
|
|
||||||
if (jsonData['status'] == 'OK') {
|
if (jsonData['status'] == 'OK') {
|
||||||
return jsonData;
|
return jsonData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,5 @@ class DeviceController {
|
|||||||
deviceSerialNumber = iosInfo.identifierForVendor!;
|
deviceSerialNumber = iosInfo.identifierForVendor!;
|
||||||
box.write(BoxName.deviceInfo, deviceSerialNumber.toString());
|
box.write(BoxName.deviceInfo, deviceSerialNumber.toString());
|
||||||
}
|
}
|
||||||
print(deviceSerialNumber);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,20 +208,6 @@ class AI extends GetxController {
|
|||||||
|
|
||||||
Future<void> addDriverEgypt() async {
|
Future<void> addDriverEgypt() async {
|
||||||
try {
|
try {
|
||||||
print(box.read(BoxName.driverID).toString());
|
|
||||||
print(box.read(BoxName.phoneDriver)?.toString() ?? '');
|
|
||||||
print(responseIdEgyptBack['gender']);
|
|
||||||
print(responseIdEgyptDriverLicense['license_type']);
|
|
||||||
print(responseIdEgyptBack['nationalID']);
|
|
||||||
print(responseIdEgyptDriverLicense['issue_date']);
|
|
||||||
print(responseIdEgyptDriverLicense['expiry_date']);
|
|
||||||
print(responseIdEgyptDriverLicense['license_categories']);
|
|
||||||
print(responseIdEgyptFront['card_id']);
|
|
||||||
print(responseIdEgyptDriverLicense['issue_date']);
|
|
||||||
print(responseIdEgyptFront['dob'] != null
|
|
||||||
? responseIdEgyptFront['dob'] + '-01-01'.toString()
|
|
||||||
: '');
|
|
||||||
|
|
||||||
// Extract values from box or set defaults
|
// Extract values from box or set defaults
|
||||||
var firstName = responseIdEgyptDriverLicense['firstName'] ?? '';
|
var firstName = responseIdEgyptDriverLicense['firstName'] ?? '';
|
||||||
var lastName = responseIdEgyptDriverLicense['lastName'] ?? '';
|
var lastName = responseIdEgyptDriverLicense['lastName'] ?? '';
|
||||||
@@ -282,7 +268,6 @@ class AI extends GetxController {
|
|||||||
'site': site,
|
'site': site,
|
||||||
'employmentType': employmentType,
|
'employmentType': employmentType,
|
||||||
};
|
};
|
||||||
print(payload);
|
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
update();
|
update();
|
||||||
// Make POST request
|
// Make POST request
|
||||||
@@ -292,7 +277,6 @@ class AI extends GetxController {
|
|||||||
update();
|
update();
|
||||||
// Handle response
|
// Handle response
|
||||||
|
|
||||||
print(status1);
|
|
||||||
if (status1['status'] == 'success') {
|
if (status1['status'] == 'success') {
|
||||||
isDriverSaved = true;
|
isDriverSaved = true;
|
||||||
Get.snackbar('Success', 'Driver data saved successfully',
|
Get.snackbar('Success', 'Driver data saved successfully',
|
||||||
@@ -302,7 +286,6 @@ class AI extends GetxController {
|
|||||||
backgroundColor: Colors.red);
|
backgroundColor: Colors.red);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Error: $e');
|
|
||||||
Get.snackbar('Error', 'An error occurred while saving driver data',
|
Get.snackbar('Error', 'An error occurred while saving driver data',
|
||||||
backgroundColor: Colors.red);
|
backgroundColor: Colors.red);
|
||||||
}
|
}
|
||||||
@@ -338,9 +321,7 @@ class AI extends GetxController {
|
|||||||
Get.snackbar('Success', 'message',
|
Get.snackbar('Success', 'message',
|
||||||
backgroundColor: AppColor.greenColor);
|
backgroundColor: AppColor.greenColor);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
print('error is $e');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final picker = ImagePicker();
|
final picker = ImagePicker();
|
||||||
@@ -414,10 +395,8 @@ class AI extends GetxController {
|
|||||||
Future.delayed(const Duration(seconds: 2));
|
Future.delayed(const Duration(seconds: 2));
|
||||||
var extractedString =
|
var extractedString =
|
||||||
await CRUD().arabicTextExtractByVisionAndAI(imagePath: imagePath);
|
await CRUD().arabicTextExtractByVisionAndAI(imagePath: imagePath);
|
||||||
// print(extractedString);
|
|
||||||
var json = jsonDecode(extractedString);
|
var json = jsonDecode(extractedString);
|
||||||
var textValues = CRUD().extractTextFromLines(json);
|
var textValues = CRUD().extractTextFromLines(json);
|
||||||
print(textValues);
|
|
||||||
// await Get.put(AI()).geminiAiExtraction(prompt, textValues, imagePath);
|
// await Get.put(AI()).geminiAiExtraction(prompt, textValues, imagePath);
|
||||||
await Get.put(AI()).anthropicAI(textValues, prompt, imagePath);
|
await Get.put(AI()).anthropicAI(textValues, prompt, imagePath);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
@@ -473,7 +452,6 @@ class AI extends GetxController {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -485,13 +463,9 @@ class AI extends GetxController {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result =
|
var result =
|
||||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -499,19 +473,11 @@ class AI extends GetxController {
|
|||||||
if (jsonString != null) {
|
if (jsonString != null) {
|
||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
print(jsonString);
|
} else {}
|
||||||
} else {
|
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
} else {}
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print('No image selected');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> anthropicAI(
|
Future<dynamic> anthropicAI(
|
||||||
@@ -533,9 +499,6 @@ class AI extends GetxController {
|
|||||||
"messages": messagesData,
|
"messages": messagesData,
|
||||||
});
|
});
|
||||||
|
|
||||||
print('requestBody');
|
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse('https://api.anthropic.com/v1/messages'),
|
Uri.parse('https://api.anthropic.com/v1/messages'),
|
||||||
headers: {
|
headers: {
|
||||||
@@ -549,29 +512,22 @@ class AI extends GetxController {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
|
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
print(utf8.decode(response.bodyBytes));
|
|
||||||
if (idType == 'car_back') {
|
if (idType == 'car_back') {
|
||||||
responseIdCardDriverEgyptBack =
|
responseIdCardDriverEgyptBack =
|
||||||
jsonDecode(responseData['content'][0]['text']);
|
jsonDecode(responseData['content'][0]['text']);
|
||||||
print(responseIdCardDriverEgyptBack);
|
|
||||||
} else if (idType == 'car_front') {
|
} else if (idType == 'car_front') {
|
||||||
responseIdCardDriverEgyptFront =
|
responseIdCardDriverEgyptFront =
|
||||||
jsonDecode(responseData['content'][0]['text']);
|
jsonDecode(responseData['content'][0]['text']);
|
||||||
print(responseIdCardDriverEgyptFront);
|
|
||||||
} else if (idType == 'id_front') {
|
} else if (idType == 'id_front') {
|
||||||
responseIdEgyptFront = jsonDecode(responseData['content'][0]['text']);
|
responseIdEgyptFront = jsonDecode(responseData['content'][0]['text']);
|
||||||
print(responseIdEgyptFront);
|
|
||||||
} else if (idType == 'id_back') {
|
} else if (idType == 'id_back') {
|
||||||
responseIdEgyptBack = jsonDecode(responseData['content'][0]['text']);
|
responseIdEgyptBack = jsonDecode(responseData['content'][0]['text']);
|
||||||
print(responseIdEgyptBack);
|
|
||||||
} else if (idType == 'driver_license') {
|
} else if (idType == 'driver_license') {
|
||||||
responseIdEgyptDriverLicense =
|
responseIdEgyptDriverLicense =
|
||||||
jsonDecode(responseData['content'][0]['text']);
|
jsonDecode(responseData['content'][0]['text']);
|
||||||
print(responseIdEgyptDriverLicense);
|
|
||||||
} else if (idType == 'criminalRecord') {
|
} else if (idType == 'criminalRecord') {
|
||||||
responseCriminalRecordEgypt =
|
responseCriminalRecordEgypt =
|
||||||
jsonDecode(responseData['content'][0]['text']);
|
jsonDecode(responseData['content'][0]['text']);
|
||||||
print(responseCriminalRecordEgypt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
@@ -615,7 +571,6 @@ class AI extends GetxController {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
// print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -629,12 +584,8 @@ class AI extends GetxController {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result = responseData['candidates'][0]['content']['parts'][0]['text'];
|
var result = responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -645,33 +596,24 @@ class AI extends GetxController {
|
|||||||
|
|
||||||
if (idType == 'car_back') {
|
if (idType == 'car_back') {
|
||||||
responseIdCardDriverEgyptBack = jsonDecode(jsonString);
|
responseIdCardDriverEgyptBack = jsonDecode(jsonString);
|
||||||
print(responseIdCardDriverEgyptBack);
|
|
||||||
} else if (idType == 'car_front') {
|
} else if (idType == 'car_front') {
|
||||||
responseIdCardDriverEgyptFront = jsonDecode(jsonString);
|
responseIdCardDriverEgyptFront = jsonDecode(jsonString);
|
||||||
print(responseIdCardDriverEgyptFront);
|
|
||||||
} else if (idType == 'id_front') {
|
} else if (idType == 'id_front') {
|
||||||
responseIdEgyptFront = jsonDecode(jsonString);
|
responseIdEgyptFront = jsonDecode(jsonString);
|
||||||
print(responseIdEgyptFront);
|
|
||||||
} else if (idType == 'id_back') {
|
} else if (idType == 'id_back') {
|
||||||
responseIdEgyptBack = jsonDecode(jsonString);
|
responseIdEgyptBack = jsonDecode(jsonString);
|
||||||
print(responseIdEgyptBack);
|
|
||||||
} else if (idType == 'driver_license') {
|
} else if (idType == 'driver_license') {
|
||||||
responseIdEgyptDriverLicense = jsonDecode(jsonString);
|
responseIdEgyptDriverLicense = jsonDecode(jsonString);
|
||||||
print(responseIdEgyptDriverLicense);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
print("JSON string not found");
|
|
||||||
Get.snackbar('Error', "JSON string not found",
|
Get.snackbar('Error', "JSON string not found",
|
||||||
backgroundColor: AppColor.redColor);
|
backgroundColor: AppColor.redColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getDriverLicenseJordanContent() async {
|
Future<void> getDriverLicenseJordanContent() async {
|
||||||
@@ -725,7 +667,6 @@ class AI extends GetxController {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -738,13 +679,9 @@ class AI extends GetxController {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result =
|
var result =
|
||||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -753,21 +690,11 @@ class AI extends GetxController {
|
|||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
responseMap = jsonDecode(jsonString);
|
responseMap = jsonDecode(jsonString);
|
||||||
print(jsonString);
|
} else {}
|
||||||
print(responseMap);
|
|
||||||
print(responseMap['dob']);
|
|
||||||
} else {
|
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
} else {}
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print('No image selected');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getCarLicenseJordanContent() async {
|
Future<void> getCarLicenseJordanContent() async {
|
||||||
@@ -826,7 +753,6 @@ Output the extracted information in the following JSON format''',
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -840,13 +766,9 @@ Output the extracted information in the following JSON format''',
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result =
|
var result =
|
||||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -855,21 +777,11 @@ Output the extracted information in the following JSON format''',
|
|||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
responseCarLicenseMapJordan = jsonDecode(jsonString);
|
responseCarLicenseMapJordan = jsonDecode(jsonString);
|
||||||
print(jsonString);
|
} else {}
|
||||||
print(responseCarLicenseMapJordan);
|
|
||||||
print(responseCarLicenseMapJordan['plate_number']);
|
|
||||||
} else {
|
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
} else {}
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print('No image selected');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> jordanID() async {
|
Future<void> jordanID() async {
|
||||||
@@ -928,7 +840,6 @@ Output the extracted information in the following JSON format''',
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -941,13 +852,9 @@ Output the extracted information in the following JSON format''',
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result =
|
var result =
|
||||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -956,21 +863,11 @@ Output the extracted information in the following JSON format''',
|
|||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
responseCarLicenseMapJordan = jsonDecode(jsonString);
|
responseCarLicenseMapJordan = jsonDecode(jsonString);
|
||||||
print(jsonString);
|
} else {}
|
||||||
print(responseCarLicenseMapJordan);
|
|
||||||
print(responseCarLicenseMapJordan['plate_number']);
|
|
||||||
} else {
|
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
} else {}
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print('No image selected');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> carLicenseJordan() async {
|
Future<void> carLicenseJordan() async {
|
||||||
@@ -1038,7 +935,6 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -1051,13 +947,9 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result =
|
var result =
|
||||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -1066,21 +958,11 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
responseCarLicenseMapJordan = jsonDecode(jsonString);
|
responseCarLicenseMapJordan = jsonDecode(jsonString);
|
||||||
print(jsonString);
|
} else {}
|
||||||
print(responseCarLicenseMapJordan);
|
|
||||||
print(responseCarLicenseMapJordan['plate_number']);
|
|
||||||
} else {
|
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
} else {}
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print('No image selected');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future getTextFromCard(String prompt) async {
|
Future getTextFromCard(String prompt) async {
|
||||||
@@ -1133,7 +1015,6 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -1146,13 +1027,9 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result =
|
var result =
|
||||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -1161,21 +1038,11 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
responseBackCarLicenseMap = jsonDecode(jsonString);
|
responseBackCarLicenseMap = jsonDecode(jsonString);
|
||||||
// print(jsonString);
|
} else {}
|
||||||
print(responseBackCarLicenseMap);
|
|
||||||
// print(responseCarLicenseMap['plate_number']);
|
|
||||||
} else {
|
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
} else {}
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print('No image selected');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> generateBackCarLicenseJordanContent() async {
|
Future<void> generateBackCarLicenseJordanContent() async {
|
||||||
@@ -1229,7 +1096,6 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -1242,13 +1108,9 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result =
|
var result =
|
||||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -1257,21 +1119,11 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
responseBackCarLicenseMap = jsonDecode(jsonString);
|
responseBackCarLicenseMap = jsonDecode(jsonString);
|
||||||
// print(jsonString);
|
} else {}
|
||||||
print(responseBackCarLicenseMap);
|
|
||||||
// print(responseCarLicenseMap['plate_number']);
|
|
||||||
} else {
|
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
} else {}
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print('No image selected');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getFromCarRegistration() async {
|
Future<void> getFromCarRegistration() async {
|
||||||
@@ -1323,7 +1175,6 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -1337,7 +1188,6 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
var result =
|
var result =
|
||||||
responseData['candidates'][0]['content']['parts'][0]['text'];
|
responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
print(result);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -1345,19 +1195,11 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
if (jsonString != null) {
|
if (jsonString != null) {
|
||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
print(jsonString);
|
} else {}
|
||||||
} else {
|
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
} else {}
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print('No image selected');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import 'dart:io';
|
|||||||
void showInBrowser(String url) async {
|
void showInBrowser(String url) async {
|
||||||
if (await canLaunchUrl(Uri.parse(url))) {
|
if (await canLaunchUrl(Uri.parse(url))) {
|
||||||
launchUrl(Uri.parse(url));
|
launchUrl(Uri.parse(url));
|
||||||
} else {
|
} else {}
|
||||||
print('Could not launch $url');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void launchCommunication(
|
void launchCommunication(
|
||||||
@@ -30,7 +28,6 @@ void launchCommunication(
|
|||||||
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
|
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
print('Method not supported on iOS');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (Platform.isAndroid) {
|
} else if (Platform.isAndroid) {
|
||||||
@@ -49,7 +46,6 @@ void launchCommunication(
|
|||||||
url =
|
url =
|
||||||
'whatsapp://send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
'whatsapp://send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
||||||
} else {
|
} else {
|
||||||
print('WhatsApp is not installed on this device.');
|
|
||||||
// Provide an alternative action, such as opening the WhatsApp Web API
|
// Provide an alternative action, such as opening the WhatsApp Web API
|
||||||
url =
|
url =
|
||||||
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
||||||
@@ -60,19 +56,13 @@ void launchCommunication(
|
|||||||
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
|
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
print('Method not supported on Android');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print('Platform not supported');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
print('Launching URL: $url');
|
|
||||||
|
|
||||||
if (await canLaunchUrl(Uri.parse(url))) {
|
if (await canLaunchUrl(Uri.parse(url))) {
|
||||||
await launchUrl(Uri.parse(url));
|
await launchUrl(Uri.parse(url));
|
||||||
} else {
|
} else {}
|
||||||
print('Could not launch $url');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,21 +6,15 @@ import 'package:SEFER/controller/functions/gemeni.dart';
|
|||||||
|
|
||||||
class LlamaAi {
|
class LlamaAi {
|
||||||
Future<Map> getCarRegistrationData(String input, prompt) async {
|
Future<Map> getCarRegistrationData(String input, prompt) async {
|
||||||
print(true);
|
|
||||||
Map exrtatDataFinal = {};
|
Map exrtatDataFinal = {};
|
||||||
String oneLine = input.replaceAll('\n', ' ');
|
String oneLine = input.replaceAll('\n', ' ');
|
||||||
// print(oneLine);
|
|
||||||
// var res = await CRUD().getLlama(link: AppLink.gemini, payload: oneLine);
|
// var res = await CRUD().getLlama(link: AppLink.gemini, payload: oneLine);
|
||||||
var res = await CRUD()
|
var res = await CRUD()
|
||||||
.getLlama(link: AppLink.llama, payload: oneLine, prompt: prompt);
|
.getLlama(link: AppLink.llama, payload: oneLine, prompt: prompt);
|
||||||
|
|
||||||
print(res);
|
|
||||||
var decod = jsonDecode(res.toString());
|
var decod = jsonDecode(res.toString());
|
||||||
print(decod);
|
|
||||||
// exrtatDataFinal = jsonDecode(extractDataFromJsonString(decod['choices']));
|
// exrtatDataFinal = jsonDecode(extractDataFromJsonString(decod['choices']));
|
||||||
extractDataFromJsonString(decod['choices'][0]['message']['content']);
|
extractDataFromJsonString(decod['choices'][0]['message']['content']);
|
||||||
print(jsonEncode(exrtatDataFinal));
|
|
||||||
print(false);
|
|
||||||
return exrtatDataFinal;
|
return exrtatDataFinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +32,6 @@ class LlamaAi {
|
|||||||
|
|
||||||
// Return the extracted data
|
// Return the extracted data
|
||||||
|
|
||||||
// print(jsonEncode(jsonData));
|
|
||||||
return jsonEncode(jsonData);
|
return jsonEncode(jsonData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ class LocationBackgroundController extends GetxController {
|
|||||||
BackgroundLocation.startLocationService();
|
BackgroundLocation.startLocationService();
|
||||||
BackgroundLocation.getLocationUpdates((location) {
|
BackgroundLocation.getLocationUpdates((location) {
|
||||||
// Handle location updates here
|
// Handle location updates here
|
||||||
print("New location: ${location.latitude}, ${location.longitude}");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,21 +46,9 @@ class LocationBackgroundController extends GetxController {
|
|||||||
BackgroundLocation.setAndroidConfiguration(
|
BackgroundLocation.setAndroidConfiguration(
|
||||||
Duration.microsecondsPerSecond); // Set interval to 5 seconds
|
Duration.microsecondsPerSecond); // Set interval to 5 seconds
|
||||||
|
|
||||||
BackgroundLocation.getLocationUpdates((location1) {
|
BackgroundLocation.getLocationUpdates((location1) {});
|
||||||
print('''\n
|
|
||||||
Latitude: ${location1.latitude.toString()}
|
|
||||||
Longitude: ${location1.longitude.toString()}
|
|
||||||
Altitude: ${location1.altitude.toString()}
|
|
||||||
Accuracy: ${location1.accuracy.toString()}
|
|
||||||
Bearing: ${location1.bearing.toString()}
|
|
||||||
Speed: ${location1.speed.toString()}
|
|
||||||
|
|
||||||
|
|
||||||
''');
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
await Permission.locationAlways.request();
|
await Permission.locationAlways.request();
|
||||||
print('Location permission not granted');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,12 +49,8 @@ class LocationController extends GetxController {
|
|||||||
try {
|
try {
|
||||||
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
totalPoints = Get.find<CaptainWalletController>().totalPoints;
|
||||||
isActive = Get.find<HomeCaptainController>().isActive;
|
isActive = Get.find<HomeCaptainController>().isActive;
|
||||||
print('isActive $isActive');
|
|
||||||
print(totalPoints);
|
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
if (double.parse(totalPoints) > -300) {
|
if (double.parse(totalPoints) > -300) {
|
||||||
print('total point is $totalPoints');
|
|
||||||
|
|
||||||
await getLocation();
|
await getLocation();
|
||||||
|
|
||||||
// if (box.read(BoxName.driverID) != null) {
|
// if (box.read(BoxName.driverID) != null) {
|
||||||
@@ -110,7 +106,6 @@ class LocationController extends GetxController {
|
|||||||
// }
|
// }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Handle the error gracefully
|
// Handle the error gracefully
|
||||||
print('Error during location updates: $e');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -162,21 +157,12 @@ class LocationController extends GetxController {
|
|||||||
if (previousTime > 0) {
|
if (previousTime > 0) {
|
||||||
double distance = calculateDistanceInKmPerHour(
|
double distance = calculateDistanceInKmPerHour(
|
||||||
previousTime, _locationData.time, speed);
|
previousTime, _locationData.time, speed);
|
||||||
print('distance $distance');
|
|
||||||
totalDistance += distance;
|
totalDistance += distance;
|
||||||
}
|
}
|
||||||
// print('totalDistance: $totalDistance');
|
|
||||||
|
|
||||||
previousTime = _locationData.time!;
|
previousTime = _locationData.time!;
|
||||||
}
|
}
|
||||||
// Print location details
|
// Print location details
|
||||||
// print('myLocation: ${myLocation}');
|
|
||||||
// print('Accuracy: ${_locationData.accuracy}');
|
|
||||||
// print('Latitude: ${_locationData.latitude}');
|
|
||||||
// print('Longitude: ${_locationData.longitude}');
|
|
||||||
// print('Time: ${_locationData.time}');
|
|
||||||
print('speed: ${_locationData.speed}');
|
|
||||||
// print('Heading: ${_locationData.heading}');
|
|
||||||
// isLoading = false;
|
// isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'package:camera/camera.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
@@ -83,11 +82,8 @@ import 'launch.dart';
|
|||||||
// // textBlocks.toString(); // Convert the extracted text to JSON.
|
// // textBlocks.toString(); // Convert the extracted text to JSON.
|
||||||
//
|
//
|
||||||
// // // Print the JSON to the console.
|
// // // Print the JSON to the console.
|
||||||
// // print(jsonText);
|
|
||||||
// // update();
|
// // update();
|
||||||
// // // print(text);
|
|
||||||
// // } catch (e) {
|
// // } catch (e) {
|
||||||
// // print('Error during text extraction: $e');
|
|
||||||
// // extractedText = '';
|
// // extractedText = '';
|
||||||
// // }
|
// // }
|
||||||
// // }
|
// // }
|
||||||
@@ -214,8 +210,6 @@ import 'launch.dart';
|
|||||||
// decode = jsonDecode(jsonOutput!);
|
// decode = jsonDecode(jsonOutput!);
|
||||||
//
|
//
|
||||||
// update();
|
// update();
|
||||||
// print('jsonOutput------------------------------');
|
|
||||||
// print(scannedText);
|
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -287,7 +281,6 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
// String? visionApi = await storage.read(key: BoxName.visionApi);
|
// String? visionApi = await storage.read(key: BoxName.visionApi);
|
||||||
// String? visionApi = AK.visionApi;
|
// String? visionApi = AK.visionApi;
|
||||||
// Pick an image from the camera or gallery
|
// Pick an image from the camera or gallery
|
||||||
// print(visionApi);
|
|
||||||
image = await imagePicker.pickImage(source: ImageSource.camera); //
|
image = await imagePicker.pickImage(source: ImageSource.camera); //
|
||||||
|
|
||||||
// If no image was picked, return
|
// If no image was picked, return
|
||||||
@@ -351,12 +344,9 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
// Handle error or provide a default value
|
// Handle error or provide a default value
|
||||||
}
|
}
|
||||||
|
|
||||||
// print(responseMap);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {}
|
||||||
print(response.reasonPhrase);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
late int times;
|
late int times;
|
||||||
@@ -425,13 +415,9 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
request.headers.addAll(headers);
|
request.headers.addAll(headers);
|
||||||
|
|
||||||
http.StreamedResponse response = await request.send();
|
http.StreamedResponse response = await request.send();
|
||||||
print('Request: ${request.toString()}');
|
|
||||||
print('Response Status Code: ${response.statusCode}');
|
|
||||||
print('Response Reason Phrase: ${response.reasonPhrase}');
|
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
res = jsonDecode(await response.stream.bytesToString());
|
res = jsonDecode(await response.stream.bytesToString());
|
||||||
print(res);
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
res['data']['result'].toString().contains('No face detected in image')
|
res['data']['result'].toString().contains('No face detected in image')
|
||||||
@@ -494,9 +480,7 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
// },
|
// },
|
||||||
kolor: AppColor.greenColor,
|
kolor: AppColor.greenColor,
|
||||||
));
|
));
|
||||||
} else {
|
} else {}
|
||||||
print(response.reasonPhrase);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Todo upload images and fields
|
// Todo upload images and fields
|
||||||
@@ -529,7 +513,6 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
update();
|
update();
|
||||||
|
|
||||||
// Print the response string
|
// Print the response string
|
||||||
print(responseString);
|
|
||||||
|
|
||||||
return responseString;
|
return responseString;
|
||||||
}
|
}
|
||||||
@@ -540,9 +523,7 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
// initializeCamera(0);
|
// initializeCamera(0);
|
||||||
sql.getAllData(TableName.faceDetectTimes).then((value) {
|
sql.getAllData(TableName.faceDetectTimes).then((value) {
|
||||||
if (value.isEmpty) {
|
if (value.isEmpty) {
|
||||||
print(value);
|
|
||||||
times = 0;
|
times = 0;
|
||||||
print(times);
|
|
||||||
update();
|
update();
|
||||||
// sql.insertData({'faceDetectTimes': 1}, TableName.faceDetectTimes);
|
// sql.insertData({'faceDetectTimes': 1}, TableName.faceDetectTimes);
|
||||||
} else {
|
} else {
|
||||||
@@ -620,7 +601,6 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
//
|
//
|
||||||
// extractedData['extractedTextWithCoordinates'] =
|
// extractedData['extractedTextWithCoordinates'] =
|
||||||
// extractedTextWithCoordinates;
|
// extractedTextWithCoordinates;
|
||||||
// print(jsonEncode(extractedData));
|
|
||||||
// return extractedData;
|
// return extractedData;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -636,9 +616,7 @@ class ScanDocumentsByApi extends GetxController {
|
|||||||
// extractedTextWithCoordinates =
|
// extractedTextWithCoordinates =
|
||||||
// extractedData['extractedTextWithCoordinates'];
|
// extractedData['extractedTextWithCoordinates'];
|
||||||
// update(); // Notify GetX that the state has changed
|
// update(); // Notify GetX that the state has changed
|
||||||
// print(extractedTextWithCoordinates);
|
|
||||||
// } catch (e) {
|
// } catch (e) {
|
||||||
// print('Passport data extraction failed: $e');
|
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -28,10 +28,6 @@ class SmsEgyptController extends GetxController {
|
|||||||
headers: headers,
|
headers: headers,
|
||||||
);
|
);
|
||||||
|
|
||||||
print(res.reasonPhrase);
|
|
||||||
print(res.request);
|
|
||||||
print(res.body);
|
|
||||||
print(body);
|
|
||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: 'You will recieve code in sms message'.tr,
|
title: 'You will recieve code in sms message'.tr,
|
||||||
@@ -53,7 +49,6 @@ class SmsEgyptController extends GetxController {
|
|||||||
},
|
},
|
||||||
headers: headers,
|
headers: headers,
|
||||||
);
|
);
|
||||||
print(res);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future sendSmsWithValidaty(String phone, otp) async {
|
Future sendSmsWithValidaty(String phone, otp) async {
|
||||||
@@ -71,7 +66,6 @@ class SmsEgyptController extends GetxController {
|
|||||||
},
|
},
|
||||||
headers: headers,
|
headers: headers,
|
||||||
);
|
);
|
||||||
print(res);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future sendSmsStatus(String smsid) async {
|
Future sendSmsStatus(String smsid) async {
|
||||||
@@ -84,6 +78,5 @@ class SmsEgyptController extends GetxController {
|
|||||||
},
|
},
|
||||||
headers: headers,
|
headers: headers,
|
||||||
);
|
);
|
||||||
print(res);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ class TextToSpeechController extends GetxController {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Handle error gracefully, e.g., show a message
|
// Handle error gracefully, e.g., show a message
|
||||||
Get.snackbar('Error', 'Failed to speak text: $error');
|
Get.snackbar('Error', 'Failed to speak text: $error');
|
||||||
print('Failed to speak text: $error');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
// messageBody: message,
|
// messageBody: message,
|
||||||
// );
|
// );
|
||||||
// } catch (e) {
|
// } catch (e) {
|
||||||
// print(e); // Print the exception to the console.
|
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ class ImageController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
// Save the cropped image
|
// Save the cropped image
|
||||||
File savedCroppedImage = File(croppedFile!.path);
|
File savedCroppedImage = File(croppedFile!.path);
|
||||||
print('link =$link');
|
|
||||||
try {
|
try {
|
||||||
await uploadImage(
|
await uploadImage(
|
||||||
savedCroppedImage,
|
savedCroppedImage,
|
||||||
@@ -68,7 +67,6 @@ class ImageController extends GetxController {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
Get.snackbar('Image Upload Failed'.tr, e.toString(),
|
Get.snackbar('Image Upload Failed'.tr, e.toString(),
|
||||||
backgroundColor: AppColor.redColor);
|
backgroundColor: AppColor.redColor);
|
||||||
print(e);
|
|
||||||
} finally {
|
} finally {
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
|
|||||||
@@ -40,12 +40,10 @@ class DurationController extends GetxController {
|
|||||||
payload: {'driverID': box.read(BoxName.driverID)});
|
payload: {'driverID': box.read(BoxName.driverID)});
|
||||||
if (res == 'failure') {
|
if (res == 'failure') {
|
||||||
monthlyList = [];
|
monthlyList = [];
|
||||||
print('monthlyList $monthlyList');
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
monthlyList = jsonDecode(res)['message'];
|
monthlyList = jsonDecode(res)['message'];
|
||||||
print(monthlyList);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -62,7 +60,6 @@ class DurationController extends GetxController {
|
|||||||
jsonData1 = jsonDecode(res);
|
jsonData1 = jsonDecode(res);
|
||||||
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
|
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
// print(jsonResponse);
|
|
||||||
final List<dynamic> jsonData = jsonResponse['message'];
|
final List<dynamic> jsonData = jsonResponse['message'];
|
||||||
rideData = jsonData.map<MonthlyDataModel>((item) {
|
rideData = jsonData.map<MonthlyDataModel>((item) {
|
||||||
return MonthlyDataModel.fromJson(item);
|
return MonthlyDataModel.fromJson(item);
|
||||||
@@ -90,7 +87,6 @@ class DurationController extends GetxController {
|
|||||||
jsonData2 = jsonDecode(res);
|
jsonData2 = jsonDecode(res);
|
||||||
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
|
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
// print(jsonResponse);
|
|
||||||
final List<dynamic> jsonData = jsonResponse['message'];
|
final List<dynamic> jsonData = jsonResponse['message'];
|
||||||
rideCountData = jsonData.map<MonthlyRideModel>((item) {
|
rideCountData = jsonData.map<MonthlyRideModel>((item) {
|
||||||
return MonthlyRideModel.fromJson(item);
|
return MonthlyRideModel.fromJson(item);
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class HelpController extends GetxController {
|
|||||||
'helpQuestion': helpQuestionController.text
|
'helpQuestion': helpQuestionController.text
|
||||||
});
|
});
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
// print(d);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
if (d['status'].toString() == 'success') {
|
if (d['status'].toString() == 'success') {
|
||||||
@@ -51,7 +50,6 @@ class HelpController extends GetxController {
|
|||||||
'driverID': box.read(BoxName.driverID).toString(),
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
});
|
});
|
||||||
if (res == "failure") {
|
if (res == "failure") {
|
||||||
// print(res);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
@@ -76,7 +74,6 @@ class HelpController extends GetxController {
|
|||||||
var res = await CRUD().get(link: AppLink.getByIdhelpCenter, payload: {
|
var res = await CRUD().get(link: AppLink.getByIdhelpCenter, payload: {
|
||||||
'id': id,
|
'id': id,
|
||||||
});
|
});
|
||||||
print(res);
|
|
||||||
if (res == "failure") {
|
if (res == "failure") {
|
||||||
status = 'not yet';
|
status = 'not yet';
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ class HomeCaptainController extends GetxController {
|
|||||||
countRefuse = results[0]['count'].toString();
|
countRefuse = results[0]['count'].toString();
|
||||||
update();
|
update();
|
||||||
if (int.parse(countRefuse) > 3 || double.parse(totalPoints) <= -300) {
|
if (int.parse(countRefuse) > 3 || double.parse(totalPoints) <= -300) {
|
||||||
print('total point is $totalPoints');
|
|
||||||
locationController.stopLocationUpdates();
|
locationController.stopLocationUpdates();
|
||||||
activeStartTime = null;
|
activeStartTime = null;
|
||||||
activeTimer?.cancel();
|
activeTimer?.cancel();
|
||||||
@@ -148,9 +147,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
Get.back();
|
Get.back();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
print('Error executing custom query: $e');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeMapType() {
|
void changeMapType() {
|
||||||
@@ -207,13 +204,11 @@ class HomeCaptainController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stopTimer() {
|
void stopTimer() {
|
||||||
print('Stopping timer');
|
|
||||||
timer?.cancel();
|
timer?.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
getlocation() async {
|
getlocation() async {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
print('isLoading $isLoading');
|
|
||||||
update();
|
update();
|
||||||
await Get.find<LocationController>().getLocation();
|
await Get.find<LocationController>().getLocation();
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
@@ -244,7 +239,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||||
'token': box.read(BoxName.tokenDriver),
|
'token': box.read(BoxName.tokenDriver),
|
||||||
'captain_id': box.read(BoxName.driverID).toString()
|
'captain_id': box.read(BoxName.driverID).toString()
|
||||||
}).then((value) => print('Token Added'));
|
});
|
||||||
MapDriverController().driverCallPassenger();
|
MapDriverController().driverCallPassenger();
|
||||||
// box.write(BoxName.statusDriverLocation, 'off');
|
// box.write(BoxName.statusDriverLocation, 'off');
|
||||||
}
|
}
|
||||||
@@ -258,9 +253,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
totalMoneyToday = data['message'][0]['todayAmount'];
|
totalMoneyToday = data['message'][0]['todayAmount'];
|
||||||
|
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {}
|
||||||
print(res);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getKazanPercent() async {
|
getKazanPercent() async {
|
||||||
@@ -279,7 +272,6 @@ class HomeCaptainController extends GetxController {
|
|||||||
deliveryPrice = double.parse(json['message'][0]['deliveryPrice']);
|
deliveryPrice = double.parse(json['message'][0]['deliveryPrice']);
|
||||||
mashwariPrice = double.parse(json['message'][0]['freePrice']);
|
mashwariPrice = double.parse(json['message'][0]['freePrice']);
|
||||||
fuelPrice = double.parse(json['message'][0]['fuelPrice']);
|
fuelPrice = double.parse(json['message'][0]['fuelPrice']);
|
||||||
print(json);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,7 +287,6 @@ class HomeCaptainController extends GetxController {
|
|||||||
data = jsonDecode(res);
|
data = jsonDecode(res);
|
||||||
|
|
||||||
countRideToday = data['message'][0]['count'].toString();
|
countRideToday = data['message'][0]['count'].toString();
|
||||||
// print(countRideToday);
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,11 +173,8 @@ class MapDriverController extends GetxController {
|
|||||||
remainingTimeToPassenger = int.parse(durationToPassenger) - i;
|
remainingTimeToPassenger = int.parse(durationToPassenger) - i;
|
||||||
if (remainingTimeToPassenger == 0) {
|
if (remainingTimeToPassenger == 0) {
|
||||||
isBtnRideBegin = true;
|
isBtnRideBegin = true;
|
||||||
print(isBtnRideBegin);
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
print(isBtnRideBegin);
|
|
||||||
print(remainingTimeToPassenger);
|
|
||||||
|
|
||||||
int minutes = (remainingTimeToPassenger / 60).floor();
|
int minutes = (remainingTimeToPassenger / 60).floor();
|
||||||
int seconds = remainingTimeToPassenger % 60;
|
int seconds = remainingTimeToPassenger % 60;
|
||||||
@@ -205,12 +202,9 @@ class MapDriverController extends GetxController {
|
|||||||
}
|
}
|
||||||
if (remainingTimeInPassengerLocatioWait == 0) {
|
if (remainingTimeInPassengerLocatioWait == 0) {
|
||||||
isdriverWaitTimeEnd = true;
|
isdriverWaitTimeEnd = true;
|
||||||
print(isdriverWaitTimeEnd);
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
print(isdriverWaitTimeEnd);
|
'remainingTimeInPassengerLocatioWait $remainingTimeInPassengerLocatioWait';
|
||||||
print(
|
|
||||||
'remainingTimeInPassengerLocatioWait $remainingTimeInPassengerLocatioWait');
|
|
||||||
|
|
||||||
int minutes = (remainingTimeInPassengerLocatioWait / 60).floor();
|
int minutes = (remainingTimeInPassengerLocatioWait / 60).floor();
|
||||||
int seconds = remainingTimeInPassengerLocatioWait % 60;
|
int seconds = remainingTimeInPassengerLocatioWait % 60;
|
||||||
@@ -267,13 +261,10 @@ class MapDriverController extends GetxController {
|
|||||||
'driverID': box.read(BoxName.driverID),
|
'driverID': box.read(BoxName.driverID),
|
||||||
});
|
});
|
||||||
if (res == 'failure') {
|
if (res == 'failure') {
|
||||||
print('Scam is failure');
|
|
||||||
box.write(BoxName.statusDriverLocation, 'off');
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
return '0';
|
return '0';
|
||||||
}
|
}
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
print('Scam is ');
|
|
||||||
print(d['message'][0]['count']);
|
|
||||||
return d['message'][0]['count'];
|
return d['message'][0]['count'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +402,6 @@ class MapDriverController extends GetxController {
|
|||||||
'token': paymentTokenWait1,
|
'token': paymentTokenWait1,
|
||||||
'driverID': box.read(BoxName.driverID).toString(),
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
});
|
});
|
||||||
print(res1);
|
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
'You will get cost of your work for this trip'.tr,
|
'You will get cost of your work for this trip'.tr,
|
||||||
@@ -458,7 +448,6 @@ class MapDriverController extends GetxController {
|
|||||||
'amount': amount.toString(),
|
'amount': amount.toString(),
|
||||||
});
|
});
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
print('paymentToken ${d['message']}');
|
|
||||||
return d['message'];
|
return d['message'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,7 +459,6 @@ class MapDriverController extends GetxController {
|
|||||||
'amount': amount.toString(),
|
'amount': amount.toString(),
|
||||||
});
|
});
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
print('paymentToken ${d['message']}');
|
|
||||||
return d['message'];
|
return d['message'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,7 +492,6 @@ class MapDriverController extends GetxController {
|
|||||||
'status': 'Finished',
|
'status': 'Finished',
|
||||||
'price': totalCost,
|
'price': totalCost,
|
||||||
});
|
});
|
||||||
print('walletChecked is $walletChecked');
|
|
||||||
if (walletChecked == 'true') {
|
if (walletChecked == 'true') {
|
||||||
paymentToken = await generateTokenPassenger(
|
paymentToken = await generateTokenPassenger(
|
||||||
((-1) * double.parse(paymentAmount)).toString());
|
((-1) * double.parse(paymentAmount)).toString());
|
||||||
@@ -524,7 +511,6 @@ class MapDriverController extends GetxController {
|
|||||||
'token': paymentToken,
|
'token': paymentToken,
|
||||||
'driverID': box.read(BoxName.driverID).toString(),
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
});
|
});
|
||||||
print('passengerWalletBurc bef ${double.parse(passengerWalletBurc)}');
|
|
||||||
if (double.parse(passengerWalletBurc) < 0) {
|
if (double.parse(passengerWalletBurc) < 0) {
|
||||||
// for zero passenger
|
// for zero passenger
|
||||||
var paymentToken1 = await generateTokenPassenger(
|
var paymentToken1 = await generateTokenPassenger(
|
||||||
@@ -534,7 +520,6 @@ class MapDriverController extends GetxController {
|
|||||||
'token': paymentToken1,
|
'token': paymentToken1,
|
||||||
'balance': ((-1) * double.parse(passengerWalletBurc)).toString()
|
'balance': ((-1) * double.parse(passengerWalletBurc)).toString()
|
||||||
});
|
});
|
||||||
print('passengerWalletBurc aft ${double.parse(passengerWalletBurc)}');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double pointsSubtraction = 0;
|
double pointsSubtraction = 0;
|
||||||
@@ -551,7 +536,6 @@ class MapDriverController extends GetxController {
|
|||||||
'token': paymentToken2,
|
'token': paymentToken2,
|
||||||
'driverID': box.read(BoxName.driverID).toString(),
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
});
|
});
|
||||||
print(res);
|
|
||||||
Future.delayed(const Duration(milliseconds: 300));
|
Future.delayed(const Duration(milliseconds: 300));
|
||||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||||
'Driver Finish Trip',
|
'Driver Finish Trip',
|
||||||
@@ -581,10 +565,8 @@ class MapDriverController extends GetxController {
|
|||||||
var res = await CRUD().get(link: AppLink.getOrderCancelStatus, payload: {
|
var res = await CRUD().get(link: AppLink.getOrderCancelStatus, payload: {
|
||||||
'order_id': rideId,
|
'order_id': rideId,
|
||||||
}); //.then((value) {
|
}); //.then((value) {
|
||||||
print('Cancel fetch--------------------');
|
|
||||||
var response = jsonDecode(res);
|
var response = jsonDecode(res);
|
||||||
canelString = response['data']['status'];
|
canelString = response['data']['status'];
|
||||||
print('cancel is $canelString');
|
|
||||||
update();
|
update();
|
||||||
if (canelString == 'Cancel') {
|
if (canelString == 'Cancel') {
|
||||||
remainingTimeTimerRideBegin = 0;
|
remainingTimeTimerRideBegin = 0;
|
||||||
@@ -613,8 +595,6 @@ class MapDriverController extends GetxController {
|
|||||||
int rideTimerFromBegin = 0;
|
int rideTimerFromBegin = 0;
|
||||||
double price = 0;
|
double price = 0;
|
||||||
void rideIsBeginPassengerTimer() async {
|
void rideIsBeginPassengerTimer() async {
|
||||||
// print('mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm');
|
|
||||||
// print(durationOfRideValue);
|
|
||||||
int durationOfRide = int.parse(durationOfRideValue);
|
int durationOfRide = int.parse(durationOfRideValue);
|
||||||
update();
|
update();
|
||||||
int infinity = 40000;
|
int infinity = 40000;
|
||||||
@@ -764,7 +744,6 @@ class MapDriverController extends GetxController {
|
|||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
data = response['routes'][0]['legs'];
|
data = response['routes'][0]['legs'];
|
||||||
print(data);
|
|
||||||
distanceBetweenDriverAndPassengerWhenConfirm =
|
distanceBetweenDriverAndPassengerWhenConfirm =
|
||||||
(data[0]['distance']['value']) / 1000;
|
(data[0]['distance']['value']) / 1000;
|
||||||
final points =
|
final points =
|
||||||
@@ -824,7 +803,6 @@ class MapDriverController extends GetxController {
|
|||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
dataDestination = response['routes'][0]['legs'];
|
dataDestination = response['routes'][0]['legs'];
|
||||||
// print(data);
|
|
||||||
final points =
|
final points =
|
||||||
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
||||||
for (int i = 0; i < points.length; i++) {
|
for (int i = 0; i < points.length; i++) {
|
||||||
@@ -892,14 +870,10 @@ class MapDriverController extends GetxController {
|
|||||||
|
|
||||||
argumentLoading() async {
|
argumentLoading() async {
|
||||||
passengerLocation = Get.arguments['passengerLocation'];
|
passengerLocation = Get.arguments['passengerLocation'];
|
||||||
print(passengerLocation);
|
|
||||||
passengerDestination = Get.arguments['passengerDestination'];
|
passengerDestination = Get.arguments['passengerDestination'];
|
||||||
print(passengerDestination);
|
|
||||||
duration = Get.arguments['Duration'];
|
duration = Get.arguments['Duration'];
|
||||||
totalCost = Get.arguments['totalCost'];
|
totalCost = Get.arguments['totalCost'];
|
||||||
passengerId = Get.arguments['passengerId'];
|
passengerId = Get.arguments['passengerId'];
|
||||||
print('passengerID argument =${Get.arguments['passengerId']} ');
|
|
||||||
print('passengerID =$passengerId ');
|
|
||||||
driverId = Get.arguments['driverId'];
|
driverId = Get.arguments['driverId'];
|
||||||
distance = Get.arguments['Distance'];
|
distance = Get.arguments['Distance'];
|
||||||
passengerName = Get.arguments['name'];
|
passengerName = Get.arguments['name'];
|
||||||
@@ -933,8 +907,6 @@ class MapDriverController extends GetxController {
|
|||||||
String lat = Get.find<LocationController>().myLocation.latitude.toString();
|
String lat = Get.find<LocationController>().myLocation.latitude.toString();
|
||||||
String lng = Get.find<LocationController>().myLocation.longitude.toString();
|
String lng = Get.find<LocationController>().myLocation.longitude.toString();
|
||||||
String origin = '$lat,$lng';
|
String origin = '$lat,$lng';
|
||||||
print('latLngpassengerLocation $latLngPassengerLocation');
|
|
||||||
print('latLngPassengerDestination $latLngPassengerDestination');
|
|
||||||
// Set the origin and destination coordinates for the Google Maps directions request.
|
// Set the origin and destination coordinates for the Google Maps directions request.
|
||||||
Future.delayed(const Duration(seconds: 1));
|
Future.delayed(const Duration(seconds: 1));
|
||||||
getMap(origin, passengerLocation);
|
getMap(origin, passengerLocation);
|
||||||
@@ -952,7 +924,6 @@ class MapDriverController extends GetxController {
|
|||||||
latlng(String passengerLocation, passengerDestination) {
|
latlng(String passengerLocation, passengerDestination) {
|
||||||
double latPassengerLocation =
|
double latPassengerLocation =
|
||||||
double.parse(passengerLocation.toString().split(',')[0]);
|
double.parse(passengerLocation.toString().split(',')[0]);
|
||||||
print('latPassengerLocation $latPassengerLocation');
|
|
||||||
double lngPassengerLocation =
|
double lngPassengerLocation =
|
||||||
double.parse(passengerLocation.toString().split(',')[1]);
|
double.parse(passengerLocation.toString().split(',')[1]);
|
||||||
double latPassengerDestination =
|
double latPassengerDestination =
|
||||||
|
|||||||
@@ -77,9 +77,7 @@ class OrderRequestController extends GetxController {
|
|||||||
} else {
|
} else {
|
||||||
box.write(BoxName.statusDriverLocation, 'off');
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
print('Error executing custom query: $e');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void getSQL() async {
|
void getSQL() async {
|
||||||
@@ -95,7 +93,6 @@ class OrderRequestController extends GetxController {
|
|||||||
AND created_at LIKE '%$todayDay%'
|
AND created_at LIKE '%$todayDay%'
|
||||||
''';
|
''';
|
||||||
List<Map<String, dynamic>> results = await sql.getCustomQuery(customQuery);
|
List<Map<String, dynamic>> results = await sql.getCustomQuery(customQuery);
|
||||||
print(results);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void startTimer(String driverID, orderID) async {
|
void startTimer(String driverID, orderID) async {
|
||||||
@@ -108,8 +105,6 @@ class OrderRequestController extends GetxController {
|
|||||||
}
|
}
|
||||||
if (remainingTime == 0) {
|
if (remainingTime == 0) {
|
||||||
if (applied == false) {
|
if (applied == false) {
|
||||||
print('applied=========================');
|
|
||||||
print(applied);
|
|
||||||
refuseOrder(orderID);
|
refuseOrder(orderID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,8 +120,6 @@ class OrderRequestController extends GetxController {
|
|||||||
}
|
}
|
||||||
if (remainingTimeSpeed == 0) {
|
if (remainingTimeSpeed == 0) {
|
||||||
if (applied == false) {
|
if (applied == false) {
|
||||||
print('applied=========================');
|
|
||||||
print(applied);
|
|
||||||
Get.back();
|
Get.back();
|
||||||
// refuseOrder(box.read(BoxName.driverID), orderID);
|
// refuseOrder(box.read(BoxName.driverID), orderID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ class MyMenuController extends GetxController {
|
|||||||
} else {
|
} else {
|
||||||
isDrawerOpen = true;
|
isDrawerOpen = true;
|
||||||
}
|
}
|
||||||
print(isDrawerOpen);
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,14 +98,12 @@ class CaptainWalletController extends GetxController {
|
|||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
walletDate = jsonDecode(res);
|
walletDate = jsonDecode(res);
|
||||||
totalAmount = walletDate['message'][0]['total_amount'] ?? '0';
|
totalAmount = walletDate['message'][0]['total_amount'] ?? '0';
|
||||||
print(totalAmount);
|
|
||||||
|
|
||||||
var res1 = await CRUD().get(
|
var res1 = await CRUD().get(
|
||||||
link: AppLink.getAllPaymentVisa,
|
link: AppLink.getAllPaymentVisa,
|
||||||
payload: {'driverID': box.read(BoxName.driverID)});
|
payload: {'driverID': box.read(BoxName.driverID)});
|
||||||
walletDateVisa = jsonDecode(res1);
|
walletDateVisa = jsonDecode(res1);
|
||||||
totalAmountVisa = walletDateVisa['message'][0]['diff'] ?? '0';
|
totalAmountVisa = walletDateVisa['message'][0]['diff'] ?? '0';
|
||||||
print(totalAmountVisa);
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -141,7 +139,6 @@ class CaptainWalletController extends GetxController {
|
|||||||
'amount': amount.toString(),
|
'amount': amount.toString(),
|
||||||
});
|
});
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
print('paymentToken ${d['message']}');
|
|
||||||
return d['message'];
|
return d['message'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +152,6 @@ class CaptainWalletController extends GetxController {
|
|||||||
});
|
});
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
paymentID = d['message'].toString();
|
paymentID = d['message'].toString();
|
||||||
print('paymentID $paymentID');
|
|
||||||
return paymentID;
|
return paymentID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,11 +44,6 @@ class CreditCardController extends GetxController {
|
|||||||
// String? expiryDate = await SecureStorage().readData(BoxName.expiryDate);
|
// String? expiryDate = await SecureStorage().readData(BoxName.expiryDate);
|
||||||
// String? cvvCode = await SecureStorage().readData(BoxName.cvvCode);
|
// String? cvvCode = await SecureStorage().readData(BoxName.cvvCode);
|
||||||
|
|
||||||
// print('cardNumber: $cardNumber');
|
|
||||||
// print('cardHolderName: $cardHolderName');
|
|
||||||
// print('expiryDate: $expiryDate');
|
|
||||||
// print('cvvCode: $cvvCode');
|
|
||||||
|
|
||||||
// if (cvvCode != null && cvvCode.isNotEmpty) {
|
// if (cvvCode != null && cvvCode.isNotEmpty) {
|
||||||
// final maskedCardNumber = DigitObscuringFormatter()
|
// final maskedCardNumber = DigitObscuringFormatter()
|
||||||
// .formatEditUpdate(
|
// .formatEditUpdate(
|
||||||
@@ -57,8 +52,6 @@ class CreditCardController extends GetxController {
|
|||||||
// )
|
// )
|
||||||
// .text;
|
// .text;
|
||||||
|
|
||||||
// print('maskedCardNumber: $maskedCardNumber');
|
|
||||||
|
|
||||||
// cardNumberController.text = maskedCardNumber;
|
// cardNumberController.text = maskedCardNumber;
|
||||||
// cardHolderNameController.text = cardHolderName ?? '';
|
// cardHolderNameController.text = cardHolderName ?? '';
|
||||||
// expiryDateController.text = expiryDate ?? '';
|
// expiryDateController.text = expiryDate ?? '';
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ class PaymobPayout extends GetxController {
|
|||||||
var decode = jsonDecode(res.body);
|
var decode = jsonDecode(res.body);
|
||||||
token = decode['access_token'];
|
token = decode['access_token'];
|
||||||
}
|
}
|
||||||
print('token = $token');
|
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,15 +54,12 @@ class PaymobPayout extends GetxController {
|
|||||||
"issuer": issuer, //"vodafone",
|
"issuer": issuer, //"vodafone",
|
||||||
"msisdn": msisdn, // "01023456789"
|
"msisdn": msisdn, // "01023456789"
|
||||||
});
|
});
|
||||||
print(body);
|
|
||||||
var res = await http.post(
|
var res = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
'https://stagingpayouts.paymobsolutions.com/api/secure/disburse/'),
|
'https://stagingpayouts.paymobsolutions.com/api/secure/disburse/'),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: body,
|
body: body,
|
||||||
);
|
);
|
||||||
print(jsonDecode(res.body));
|
|
||||||
print('-----');
|
|
||||||
var dec = jsonDecode(res.body);
|
var dec = jsonDecode(res.body);
|
||||||
if (dec['disbursement_status'] == 'successful') {
|
if (dec['disbursement_status'] == 'successful') {
|
||||||
var paymentToken = await Get.find<CaptainWalletController>()
|
var paymentToken = await Get.find<CaptainWalletController>()
|
||||||
@@ -113,9 +109,7 @@ class PaymobPayout extends GetxController {
|
|||||||
headers: headers,
|
headers: headers,
|
||||||
body: body,
|
body: body,
|
||||||
)
|
)
|
||||||
.then((value) {
|
.then((value) {});
|
||||||
print(value);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future payToWalletDriverAll(
|
Future payToWalletDriverAll(
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class PointsForRiderController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void removeLocation(int index) {
|
void removeLocation(int index) {
|
||||||
print(index);
|
|
||||||
locations.removeAt(index);
|
locations.removeAt(index);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -95,25 +94,18 @@ class WayPointController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updatePlace(int index, String input) async {
|
void updatePlace(int index, String input) async {
|
||||||
print(myLocation);
|
|
||||||
print(index);
|
|
||||||
print(input);
|
|
||||||
var url =
|
var url =
|
||||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=$input&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=$input&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
print(url);
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
// final place = input;
|
// final place = input;
|
||||||
// print(response);
|
|
||||||
// if (index == 0) {
|
// if (index == 0) {
|
||||||
List<dynamic> newList = [];
|
List<dynamic> newList = [];
|
||||||
placeListResponse.add(newList);
|
placeListResponse.add(newList);
|
||||||
newList = response['results'];
|
newList = response['results'];
|
||||||
print(newList);
|
|
||||||
placeListResponse[index].add(newList);
|
placeListResponse[index].add(newList);
|
||||||
update();
|
update();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
print(placeListResponse[index]);
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ class FeedBackController extends GetxController {
|
|||||||
'feedBack': feedbackController.text
|
'feedBack': feedbackController.text
|
||||||
});
|
});
|
||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
// print(d);
|
|
||||||
if (d['status'].toString() == 'success') {
|
if (d['status'].toString() == 'success') {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: 'Success'.tr,
|
title: 'Success'.tr,
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ class OrderHistoryController extends GetxController {
|
|||||||
var jsonDecoded = jsonDecode(res);
|
var jsonDecoded = jsonDecode(res);
|
||||||
|
|
||||||
orderHistoryListPassenger = jsonDecoded['data'];
|
orderHistoryListPassenger = jsonDecoded['data'];
|
||||||
// print(orderHistoryListPassenger);
|
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class PromosController extends GetxController {
|
|||||||
promoList = jsonDecoded['message'];
|
promoList = jsonDecoded['message'];
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
print(promoList);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class NotificationCaptainController extends GetxController {
|
|||||||
link: AppLink.getNotificationCaptain,
|
link: AppLink.getNotificationCaptain,
|
||||||
payload: {'driverID': box.read(BoxName.driverID)});
|
payload: {'driverID': box.read(BoxName.driverID)});
|
||||||
if (res == "failure") {
|
if (res == "failure") {
|
||||||
// print(res);
|
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: 'There is no notification yet'.tr,
|
title: 'There is no notification yet'.tr,
|
||||||
titleStyle: AppStyle.title,
|
titleStyle: AppStyle.title,
|
||||||
@@ -35,7 +34,6 @@ class NotificationCaptainController extends GetxController {
|
|||||||
notificationData = jsonDecode(res);
|
notificationData = jsonDecode(res);
|
||||||
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
||||||
|
|
||||||
// print(notificationData);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class PassengerNotificationController extends GetxController {
|
|||||||
link: AppLink.getNotificationPassenger,
|
link: AppLink.getNotificationPassenger,
|
||||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||||
if (res == "failure") {
|
if (res == "failure") {
|
||||||
// print(res);
|
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: 'There is no notification yet'.tr,
|
title: 'There is no notification yet'.tr,
|
||||||
titleStyle: AppStyle.title,
|
titleStyle: AppStyle.title,
|
||||||
@@ -36,7 +35,6 @@ class PassengerNotificationController extends GetxController {
|
|||||||
notificationData = jsonDecode(res);
|
notificationData = jsonDecode(res);
|
||||||
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
||||||
|
|
||||||
// print(notificationData);
|
|
||||||
isloading = false;
|
isloading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ class RideAvailableController extends GetxController {
|
|||||||
var res = await CRUD().get(link: AppLink.getRideWaiting, payload: {});
|
var res = await CRUD().get(link: AppLink.getRideWaiting, payload: {});
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
rideAvailableMap = jsonDecode(res);
|
rideAvailableMap = jsonDecode(res);
|
||||||
print(rideAvailableMap);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ class DriverWalletHistoryController extends GetxController {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
archive = jsonDecode(res)['message'];
|
archive = jsonDecode(res)['message'];
|
||||||
print(archive);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
@@ -43,7 +42,6 @@ class DriverWalletHistoryController extends GetxController {
|
|||||||
var res = await CRUD().get(
|
var res = await CRUD().get(
|
||||||
link: AppLink.getDriverWeekPaymentMove,
|
link: AppLink.getDriverWeekPaymentMove,
|
||||||
payload: {'driverID': box.read(BoxName.driverID)});
|
payload: {'driverID': box.read(BoxName.driverID)});
|
||||||
print(res);
|
|
||||||
if (res == 'failure') {
|
if (res == 'failure') {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
@@ -58,7 +56,6 @@ class DriverWalletHistoryController extends GetxController {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
weeklyList = jsonDecode(res)['message'];
|
weeklyList = jsonDecode(res)['message'];
|
||||||
print(archive);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class PassengerWalletHistoryController extends GetxController {
|
|||||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
archive = jsonDecode(res)['message'];
|
archive = jsonDecode(res)['message'];
|
||||||
print(archive);
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ class PaymentController extends GetxController {
|
|||||||
method();
|
method();
|
||||||
} else {
|
} else {
|
||||||
// Authentication failed, handle accordingly
|
// Authentication failed, handle accordingly
|
||||||
print('Authentication failed');
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Local authentication not available, proceed with payment without authentication
|
// Local authentication not available, proceed with payment without authentication
|
||||||
@@ -202,7 +201,6 @@ class PaymentController extends GetxController {
|
|||||||
|
|
||||||
// Convert the res object to a JSON object
|
// Convert the res object to a JSON object
|
||||||
final jsonResponse = jsonDecode(res);
|
final jsonResponse = jsonDecode(res);
|
||||||
print(jsonResponse);
|
|
||||||
// Check if the client_secret property exists and is not null
|
// Check if the client_secret property exists and is not null
|
||||||
if (jsonResponse.containsKey('client_secret') &&
|
if (jsonResponse.containsKey('client_secret') &&
|
||||||
jsonResponse['client_secret'] != null) {
|
jsonResponse['client_secret'] != null) {
|
||||||
@@ -230,7 +228,6 @@ class PaymentController extends GetxController {
|
|||||||
// User authenticated successfully, proceed with payment
|
// User authenticated successfully, proceed with payment
|
||||||
|
|
||||||
if (selectedAmount != 0) {
|
if (selectedAmount != 0) {
|
||||||
print(selectedAmount);
|
|
||||||
changePromoSheetDialogue();
|
changePromoSheetDialogue();
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
@@ -285,17 +282,14 @@ class PaymentController extends GetxController {
|
|||||||
],
|
],
|
||||||
note: "Contact us for any questions on your order.".tr,
|
note: "Contact us for any questions on your order.".tr,
|
||||||
onSuccess: (Map params) async {
|
onSuccess: (Map params) async {
|
||||||
print("onSuccess: $params");
|
|
||||||
addPassengerWallet();
|
addPassengerWallet();
|
||||||
changePromoSheetDialogue();
|
changePromoSheetDialogue();
|
||||||
await getPassengerWallet();
|
await getPassengerWallet();
|
||||||
},
|
},
|
||||||
onError: (error) {
|
onError: (error) {
|
||||||
print("onError: $error");
|
|
||||||
Toast.show(context, ' $error'.tr, AppColor.redColor);
|
Toast.show(context, ' $error'.tr, AppColor.redColor);
|
||||||
},
|
},
|
||||||
onCancel: (params) {
|
onCancel: (params) {
|
||||||
print('cancelled: $params');
|
|
||||||
Toast.show(context, 'Pyament Cancelled .'.tr,
|
Toast.show(context, 'Pyament Cancelled .'.tr,
|
||||||
AppColor.yellowColor);
|
AppColor.yellowColor);
|
||||||
}),
|
}),
|
||||||
@@ -307,7 +301,6 @@ class PaymentController extends GetxController {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Authentication failed, handle accordingly
|
// Authentication failed, handle accordingly
|
||||||
print('Authentication failed');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -321,7 +314,6 @@ class PaymentController extends GetxController {
|
|||||||
link: AppLink.getLicense,
|
link: AppLink.getLicense,
|
||||||
payload: {'driverID': box.read(BoxName.driverID)});
|
payload: {'driverID': box.read(BoxName.driverID)});
|
||||||
licenseDetailsMap = jsonDecode(res);
|
licenseDetailsMap = jsonDecode(res);
|
||||||
// print(licenseDetailsMap['message'][0]['name']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future createConnectAccount() async {
|
Future createConnectAccount() async {
|
||||||
@@ -331,7 +323,6 @@ class PaymentController extends GetxController {
|
|||||||
DateTime.parse(licenseDetailsMap['message'][0]['dateOfBirth']);
|
DateTime.parse(licenseDetailsMap['message'][0]['dateOfBirth']);
|
||||||
int currentTimestamp =
|
int currentTimestamp =
|
||||||
(DateTime.now().millisecondsSinceEpoch / 1000).round();
|
(DateTime.now().millisecondsSinceEpoch / 1000).round();
|
||||||
print('Current Unix timestamp: $currentTimestamp');
|
|
||||||
int day = dob.day;
|
int day = dob.day;
|
||||||
int month = dob.month;
|
int month = dob.month;
|
||||||
int year = dob.year;
|
int year = dob.year;
|
||||||
@@ -392,11 +383,9 @@ class PaymentController extends GetxController {
|
|||||||
payload: body,
|
payload: body,
|
||||||
);
|
);
|
||||||
final responseData = jsonDecode(response);
|
final responseData = jsonDecode(response);
|
||||||
// print(responseData);
|
|
||||||
final accountId = responseData['id'];
|
final accountId = responseData['id'];
|
||||||
box.write(BoxName.accountIdStripeConnect, accountId);
|
box.write(BoxName.accountIdStripeConnect, accountId);
|
||||||
await updateCaptainAccountBank();
|
await updateCaptainAccountBank();
|
||||||
print('accountId = $accountId');
|
|
||||||
return accountId;
|
return accountId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -425,10 +414,8 @@ class PaymentController extends GetxController {
|
|||||||
payload: body,
|
payload: body,
|
||||||
);
|
);
|
||||||
final responseData = jsonDecode(response);
|
final responseData = jsonDecode(response);
|
||||||
print(responseData);
|
|
||||||
final transactionId = responseData['id'];
|
final transactionId = responseData['id'];
|
||||||
|
|
||||||
print('transactionId = $transactionId');
|
|
||||||
return transactionId;
|
return transactionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,10 +426,7 @@ class PaymentController extends GetxController {
|
|||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
ip = jsonDecode(response.body)['ip'];
|
ip = jsonDecode(response.body)['ip'];
|
||||||
print(ip);
|
} else {}
|
||||||
} else {
|
|
||||||
print('Request failed with status: ${response.statusCode}');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'https://accept.paymob.com/unifiedcheckout/?publicKey=egy_pk_live_mbjDC9Ni6FSHKmsz8sOHiVk2xd7oWRve&clientSecret=egy_sk_live_c0904e9cf04506ae64f818d4e075b4a957e3713fdf7a22cb7da30a29e72442b5'
|
// 'https://accept.paymob.com/unifiedcheckout/?publicKey=egy_pk_live_mbjDC9Ni6FSHKmsz8sOHiVk2xd7oWRve&clientSecret=egy_sk_live_c0904e9cf04506ae64f818d4e075b4a957e3713fdf7a22cb7da30a29e72442b5'
|
||||||
@@ -464,16 +448,7 @@ class PaymentController extends GetxController {
|
|||||||
amountInCents: newAmount, // 19.00 EGP
|
amountInCents: newAmount, // 19.00 EGP
|
||||||
|
|
||||||
billingData: PaymobBillingData(),
|
billingData: PaymobBillingData(),
|
||||||
onPayment: (PaymobResponse response) {
|
onPayment: (PaymobResponse response) {},
|
||||||
print('Success: ${response.success}');
|
|
||||||
print('Transaction ID: ${response.transactionID}');
|
|
||||||
print('Response Code: ${response.responseCode}');
|
|
||||||
// print('Message: ${response.message}');
|
|
||||||
print(box.read(BoxName.passengerWalletTotal));
|
|
||||||
print(box.read(BoxName.name));
|
|
||||||
print(box.read(BoxName.phone));
|
|
||||||
// print();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response!.responseCode == 'APPROVED') {
|
if (response!.responseCode == 'APPROVED') {
|
||||||
@@ -515,7 +490,6 @@ class PaymentController extends GetxController {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Authentication failed, handle accordingly
|
// Authentication failed, handle accordingly
|
||||||
print('Authentication failed');
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final PaymobResponse? response = await PaymobPayment.instance.pay(
|
final PaymobResponse? response = await PaymobPayment.instance.pay(
|
||||||
@@ -523,12 +497,7 @@ class PaymentController extends GetxController {
|
|||||||
currency: currency, //"EGP",
|
currency: currency, //"EGP",
|
||||||
amountInCents: newAmount, // 19.00 EGP
|
amountInCents: newAmount, // 19.00 EGP
|
||||||
billingData: PaymobBillingData(),
|
billingData: PaymobBillingData(),
|
||||||
onPayment: (PaymobResponse response) {
|
onPayment: (PaymobResponse response) {},
|
||||||
// print('Success: ${response.success}');
|
|
||||||
// print('Transaction ID: ${response.transactionID}');
|
|
||||||
// print('Response Code: ${response.responseCode}');
|
|
||||||
// print('Message: ${response.message}');
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response!.responseCode == 'APPROVED') {
|
if (response!.responseCode == 'APPROVED') {
|
||||||
@@ -617,17 +586,7 @@ class PaymentController extends GetxController {
|
|||||||
amountInCents: newAmount, // 19.00 EGP
|
amountInCents: newAmount, // 19.00 EGP
|
||||||
|
|
||||||
billingData: PaymobBillingDataWallet(),
|
billingData: PaymobBillingDataWallet(),
|
||||||
onPayment: (PaymobResponseWallet response) {
|
onPayment: (PaymobResponseWallet response) {},
|
||||||
// print('Success: ${response.success}');
|
|
||||||
// print('Transaction ID: ${response.transactionID}');
|
|
||||||
// print('Response Code: ${response.responseCode}');
|
|
||||||
// print('Message: ${response.message}');
|
|
||||||
|
|
||||||
// print(box.read(BoxName.passengerWalletTotal));//
|
|
||||||
// print(box.read(BoxName.name));
|
|
||||||
// print(box.read(BoxName.phone));
|
|
||||||
// print();
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response!.success == true && response.responseCode == '200') {
|
if (response!.success == true && response.responseCode == '200') {
|
||||||
@@ -686,7 +645,6 @@ class PaymentController extends GetxController {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Authentication failed, handle accordingly
|
// Authentication failed, handle accordingly
|
||||||
print('Authentication failed');
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final PaymobResponse? response = await PaymobPayment.instance.pay(
|
final PaymobResponse? response = await PaymobPayment.instance.pay(
|
||||||
@@ -694,12 +652,7 @@ class PaymentController extends GetxController {
|
|||||||
currency: currency, //"EGP",
|
currency: currency, //"EGP",
|
||||||
amountInCents: newAmount, // 19.00 EGP
|
amountInCents: newAmount, // 19.00 EGP
|
||||||
billingData: PaymobBillingData(),
|
billingData: PaymobBillingData(),
|
||||||
onPayment: (PaymobResponse response) {
|
onPayment: (PaymobResponse response) {},
|
||||||
// print('Success: ${response.success}');
|
|
||||||
// print('Transaction ID: ${response.transactionID}');
|
|
||||||
// print('Response Code: ${response.responseCode}');
|
|
||||||
// print('Message: ${response.message}');
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response!.responseCode == 'APPROVED') {
|
if (response!.responseCode == 'APPROVED') {
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ class PaymobManager extends GetxController {
|
|||||||
update();
|
update();
|
||||||
return paymentKey;
|
return paymentKey;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exc==========================================");
|
|
||||||
print(e.toString());
|
|
||||||
throw Exception();
|
throw Exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,7 +44,6 @@ class PaymobManager extends GetxController {
|
|||||||
paymentToken = await PaymobManager().getPaymentKey(amount, currency);
|
paymentToken = await PaymobManager().getPaymentKey(amount, currency);
|
||||||
} on Exception catch (e) {
|
} on Exception catch (e) {
|
||||||
// Handle errors gracefully, e.g., display error message to user
|
// Handle errors gracefully, e.g., display error message to user
|
||||||
print("Error fetching payment key: $e");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,23 +68,17 @@ class PaymobManager extends GetxController {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final paymentData = response.data; // Assuming JSON response
|
final paymentData = response.data; // Assuming JSON response
|
||||||
|
|
||||||
print("redirection_url: ${paymentData['iframe_redirection_url']}");
|
|
||||||
|
|
||||||
// Navigate to success screen or display success message
|
// Navigate to success screen or display success message
|
||||||
launchUrl(Uri.parse(paymentData['iframe_redirection_url']));
|
launchUrl(Uri.parse(paymentData['iframe_redirection_url']));
|
||||||
} else {
|
} else {
|
||||||
// Payment failed: Handle errors (e.g., display error message)
|
// Payment failed: Handle errors (e.g., display error message)
|
||||||
print("Payment failed: ${response.statusCode} - ${response.data}");
|
|
||||||
}
|
}
|
||||||
} on DioError catch (e) {
|
} on DioError catch (e) {
|
||||||
// Handle network or Dio-related errors
|
// Handle network or Dio-related errors
|
||||||
print("Error making payment request: $e");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> _getStatusAfterPaid() async {
|
Future<String> _getStatusAfterPaid() async {
|
||||||
print(authanticationToken1);
|
|
||||||
print(orderId1);
|
|
||||||
final dio.Response response = await Dio().post(
|
final dio.Response response = await Dio().post(
|
||||||
"https://accept.paymob.com/api/ecommerce/orders/transaction_inquiry",
|
"https://accept.paymob.com/api/ecommerce/orders/transaction_inquiry",
|
||||||
data: {
|
data: {
|
||||||
@@ -95,8 +86,6 @@ class PaymobManager extends GetxController {
|
|||||||
"merchant_order_id": "970960",
|
"merchant_order_id": "970960",
|
||||||
"order_id": orderId1
|
"order_id": orderId1
|
||||||
});
|
});
|
||||||
print(response.data);
|
|
||||||
print(response.data['success']);
|
|
||||||
return response.data["success"];
|
return response.data["success"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,8 +112,6 @@ class PaymobManager extends GetxController {
|
|||||||
"delivery_needed": "false",
|
"delivery_needed": "false",
|
||||||
"items": [],
|
"items": [],
|
||||||
});
|
});
|
||||||
print('id is');
|
|
||||||
print(response.data["id"]);
|
|
||||||
return response.data["id"];
|
return response.data["id"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ class PaymobPayment {
|
|||||||
'api_key': _apiKey,
|
'api_key': _apiKey,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.data['token']);
|
|
||||||
|
|
||||||
return response.data['token'];
|
return response.data['token'];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -105,7 +104,6 @@ class PaymobPayment {
|
|||||||
"items": items,
|
"items": items,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.data['id']);
|
|
||||||
|
|
||||||
return response.data['id'];
|
return response.data['id'];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -138,7 +136,6 @@ class PaymobPayment {
|
|||||||
if (message != null) {
|
if (message != null) {
|
||||||
throw Exception(message);
|
throw Exception(message);
|
||||||
}
|
}
|
||||||
print(response.data['token']);
|
|
||||||
return response.data['token'];
|
return response.data['token'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ class PaymobPaymentWallet {
|
|||||||
'api_key': _apiKey,
|
'api_key': _apiKey,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.data['token']);
|
|
||||||
return response.data['token'];
|
return response.data['token'];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
rethrow;
|
rethrow;
|
||||||
@@ -104,7 +103,6 @@ class PaymobPaymentWallet {
|
|||||||
"items": items,
|
"items": items,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.data['id']);
|
|
||||||
return response.data['id'];
|
return response.data['id'];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
rethrow;
|
rethrow;
|
||||||
@@ -136,7 +134,6 @@ class PaymobPaymentWallet {
|
|||||||
// if (message != null) {
|
// if (message != null) {
|
||||||
// throw Exception(message);
|
// throw Exception(message);
|
||||||
// }
|
// }
|
||||||
print(response.data['token']);
|
|
||||||
return response.data['token'];
|
return response.data['token'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,16 +158,13 @@ class PaymobPaymentWallet {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final paymentData = response.data; // Assuming JSON response
|
final paymentData = response.data; // Assuming JSON response
|
||||||
|
|
||||||
print("redirection_url: ${paymentData['iframe_redirection_url']}");
|
|
||||||
return paymentData['iframe_redirection_url'];
|
return paymentData['iframe_redirection_url'];
|
||||||
// Navigate to success screen or display success message
|
// Navigate to success screen or display success message
|
||||||
} else {
|
} else {
|
||||||
// Payment failed: Handle errors (e.g., display error message)
|
// Payment failed: Handle errors (e.g., display error message)
|
||||||
print("Payment failed: ${response.statusCode} - ${response.data}");
|
|
||||||
}
|
}
|
||||||
} on DioError catch (e) {
|
} on DioError catch (e) {
|
||||||
// Handle network or Dio-related errors
|
// Handle network or Dio-related errors
|
||||||
print("Error making payment request: $e");
|
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ class CaptainProfileController extends GetxController {
|
|||||||
var d = jsonDecode(res);
|
var d = jsonDecode(res);
|
||||||
captainProfileData = d['message'];
|
captainProfileData = d['message'];
|
||||||
update();
|
update();
|
||||||
print(captainProfileData);
|
|
||||||
box.write(BoxName.sexDriver, d['message']['gender']);
|
box.write(BoxName.sexDriver, d['message']['gender']);
|
||||||
box.write(BoxName.dobDriver, d['message']['birthdate']);
|
box.write(BoxName.dobDriver, d['message']['birthdate']);
|
||||||
box.write(BoxName.vin, d['message']['vin']);
|
box.write(BoxName.vin, d['message']['vin']);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import 'views/home/Captin/orderCaptin/order_request_page.dart';
|
|||||||
|
|
||||||
final box = GetStorage();
|
final box = GetStorage();
|
||||||
const storage = FlutterSecureStorage();
|
const storage = FlutterSecureStorage();
|
||||||
// final PaymobPayment paymobPayment = PaymobPayment();
|
|
||||||
final PaymobPayment paymobPayment = PaymobPayment();
|
final PaymobPayment paymobPayment = PaymobPayment();
|
||||||
final PaymobPaymentWallet paymobPaymentWallet = PaymobPaymentWallet();
|
final PaymobPaymentWallet paymobPaymentWallet = PaymobPaymentWallet();
|
||||||
|
|
||||||
@@ -36,13 +36,11 @@ DbSql sql = DbSql.instance;
|
|||||||
Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||||
await Firebase.initializeApp();
|
await Firebase.initializeApp();
|
||||||
if (message.data.isNotEmpty && message.notification != null) {
|
if (message.data.isNotEmpty && message.notification != null) {
|
||||||
print(message.notification?.title);
|
|
||||||
FirebaseMessagesController().fireBaseTitles(message);
|
FirebaseMessagesController().fireBaseTitles(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> handleBackgroundNotificationClick(RemoteMessage message) async {
|
Future<void> handleBackgroundNotificationClick(RemoteMessage message) async {
|
||||||
// Perform any necessary setup or initialization
|
|
||||||
await Firebase.initializeApp();
|
await Firebase.initializeApp();
|
||||||
|
|
||||||
var myListString = message.data['DriverList'];
|
var myListString = message.data['DriverList'];
|
||||||
@@ -51,7 +49,6 @@ Future<void> handleBackgroundNotificationClick(RemoteMessage message) async {
|
|||||||
Get.to(() => OrderRequestPage(), arguments: {
|
Get.to(() => OrderRequestPage(), arguments: {
|
||||||
'myListString': myListString,
|
'myListString': myListString,
|
||||||
'DriverList': myList,
|
'DriverList': myList,
|
||||||
// 'PolylineJson': myPoints,
|
|
||||||
'body': message.notification?.body,
|
'body': message.notification?.body,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -65,15 +62,11 @@ void main() async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await GetStorage.init();
|
await GetStorage.init();
|
||||||
// Get.put(DriverCallController());
|
|
||||||
await AC().gAK();
|
|
||||||
print(
|
|
||||||
'local is ${WidgetsBinding.instance.platformDispatcher.locale.countryCode}');
|
|
||||||
|
|
||||||
print(Get.deviceLocale!.countryCode);
|
await AC().gAK();
|
||||||
|
|
||||||
Stripe.publishableKey = AK.publishableKey;
|
Stripe.publishableKey = AK.publishableKey;
|
||||||
|
|
||||||
// await LocationBackgroundController().requestLocationPermission();
|
|
||||||
if (Platform.isAndroid || Platform.isIOS) {
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
options: DefaultFirebaseOptions.currentPlatform,
|
options: DefaultFirebaseOptions.currentPlatform,
|
||||||
@@ -86,30 +79,22 @@ void main() async {
|
|||||||
FirebaseMessagesController().getNotificationSettings(),
|
FirebaseMessagesController().getNotificationSettings(),
|
||||||
FirebaseMessagesController().getToken(),
|
FirebaseMessagesController().getToken(),
|
||||||
];
|
];
|
||||||
// cameras = await availableCameras();
|
|
||||||
await Future.wait(initializationTasks);
|
await Future.wait(initializationTasks);
|
||||||
SystemChrome.setPreferredOrientations([
|
SystemChrome.setPreferredOrientations([
|
||||||
DeviceOrientation.portraitUp,
|
DeviceOrientation.portraitUp,
|
||||||
DeviceOrientation.portraitDown,
|
DeviceOrientation.portraitDown,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// PaymobPayment.instance.initialize(
|
|
||||||
// apiKey: AK
|
|
||||||
// .payMobApikey, // from dashboard Select Settings -> Account Info -> API Key
|
|
||||||
// integrationID: int.parse(AK.integrationIdPayMob),
|
|
||||||
// userTokenExpiration: 200,
|
|
||||||
// iFrameID: 837992,
|
|
||||||
// );
|
|
||||||
PaymobPayment.instance.initialize(
|
PaymobPayment.instance.initialize(
|
||||||
apiKey: AK
|
apiKey: AK.payMobApikey,
|
||||||
.payMobApikey, // from dashboard Select Settings -> Account Info -> API Key
|
|
||||||
integrationID: int.parse(AK.integrationIdPayMob),
|
integrationID: int.parse(AK.integrationIdPayMob),
|
||||||
userTokenExpiration: 200,
|
userTokenExpiration: 200,
|
||||||
iFrameID: 837992,
|
iFrameID: 837992,
|
||||||
);
|
);
|
||||||
PaymobPaymentWallet.instance.initialize(
|
PaymobPaymentWallet.instance.initialize(
|
||||||
apiKey: AK
|
apiKey: AK.payMobApikey,
|
||||||
.payMobApikey, // from dashboard Select Settings -> Account Info -> API Key
|
|
||||||
integrationID: int.parse(AK.integrationIdPayMobWallet),
|
integrationID: int.parse(AK.integrationIdPayMobWallet),
|
||||||
userTokenExpiration: 200,
|
userTokenExpiration: 200,
|
||||||
iFrameID: 837992,
|
iFrameID: 837992,
|
||||||
@@ -121,8 +106,6 @@ void main() async {
|
|||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
const MyApp({super.key});
|
const MyApp({super.key});
|
||||||
|
|
||||||
// This widget is the root of your application.
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
LocaleController localController = Get.put(LocaleController());
|
LocaleController localController = Get.put(LocaleController());
|
||||||
@@ -134,13 +117,6 @@ class MyApp extends StatelessWidget {
|
|||||||
locale: localController.language,
|
locale: localController.language,
|
||||||
theme: localController.appTheme,
|
theme: localController.appTheme,
|
||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
// routes: {'/':const HomePage()},
|
|
||||||
// home: LoginCaptin());
|
|
||||||
// getPages: [
|
|
||||||
// GetPage(name: '/', page: () => SplashScreen()),
|
|
||||||
// GetPage(
|
|
||||||
// name: '/OrderRequestPage/:id', page: () => OrderRequestPage()),
|
|
||||||
// ],
|
|
||||||
initialRoute: '/',
|
initialRoute: '/',
|
||||||
home: SplashScreen());
|
home: SplashScreen());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -645,7 +645,6 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
// sql
|
// sql
|
||||||
// .getAllData(
|
// .getAllData(
|
||||||
// TableName.faceDetectTimes)
|
// TableName.faceDetectTimes)
|
||||||
// .then((value) => print(
|
|
||||||
// value[0]['faceDetectTimes']));
|
// value[0]['faceDetectTimes']));
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
@@ -865,8 +864,7 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
kolor: AppColor.yellowColor,
|
kolor: AppColor.yellowColor,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
sql.deleteAllData(TableName.faceDetectTimes);
|
sql.deleteAllData(TableName.faceDetectTimes);
|
||||||
sql.getAllData(TableName.faceDetectTimes).then(
|
sql.getAllData(TableName.faceDetectTimes);
|
||||||
(value) => print(value[0]['faceDetectTimes']));
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ class CarLicensePage extends StatelessWidget {
|
|||||||
//3vQRyaYYSWpmv69A58ZOkxmeK6M1mgwEDlXrXlBl
|
//3vQRyaYYSWpmv69A58ZOkxmeK6M1mgwEDlXrXlBl
|
||||||
//0pALdqDDYHvzp73Q59SIgbzjG7Z2zkhJXr
|
//0pALdqDDYHvzp73Q59SIgbzjG7Z2zkhJXr
|
||||||
// String? visionApi = AK.serverPHP;
|
// String? visionApi = AK.serverPHP;
|
||||||
// print(AK.visionApi);
|
|
||||||
await carRegistrationRecognizerController.scanText();
|
await carRegistrationRecognizerController.scanText();
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ class EgyptCardAI extends StatelessWidget {
|
|||||||
right: 30,
|
right: 30,
|
||||||
left: 30,
|
left: 30,
|
||||||
child: GetBuilder<AI>(builder: (controller) {
|
child: GetBuilder<AI>(builder: (controller) {
|
||||||
print(controller.approved);
|
|
||||||
return controller.approved == false
|
return controller.approved == false
|
||||||
? Container(
|
? Container(
|
||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
@@ -641,8 +640,6 @@ class EgyptCardAI extends StatelessWidget {
|
|||||||
return GetBuilder<AI>(
|
return GetBuilder<AI>(
|
||||||
builder: (ai) {
|
builder: (ai) {
|
||||||
if (ai.responseIdCardDriverEgyptBack.isNotEmpty) {
|
if (ai.responseIdCardDriverEgyptBack.isNotEmpty) {
|
||||||
// print(ai.responseIdCardDriverEgyptBack);
|
|
||||||
|
|
||||||
// Get the tax expiry date from the response
|
// Get the tax expiry date from the response
|
||||||
final taxExpiryDate = ai.responseIdCardDriverEgyptBack['tax_expiry'];
|
final taxExpiryDate = ai.responseIdCardDriverEgyptBack['tax_expiry'];
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ class GeminiEgypt extends GetxController {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
// print(requestBody);
|
|
||||||
|
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -59,12 +58,8 @@ class GeminiEgypt extends GetxController {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(response.body);
|
var responseData = jsonDecode(response.body);
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
// print(responseData);
|
|
||||||
|
|
||||||
var result = responseData['candidates'][0]['content']['parts'][0]['text'];
|
var result = responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||||
// print(jsonEncode(result));
|
|
||||||
// print((result));
|
|
||||||
// print(result['dob']);
|
|
||||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||||
String? jsonString =
|
String? jsonString =
|
||||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||||
@@ -72,22 +67,14 @@ class GeminiEgypt extends GetxController {
|
|||||||
if (jsonString != null) {
|
if (jsonString != null) {
|
||||||
// Convert the JSON object to a String
|
// Convert the JSON object to a String
|
||||||
jsonString = jsonEncode(json.decode(jsonString));
|
jsonString = jsonEncode(json.decode(jsonString));
|
||||||
// print(jsonString);
|
|
||||||
responseIdCardDriverEgypt1 = jsonString;
|
responseIdCardDriverEgypt1 = jsonString;
|
||||||
|
|
||||||
// print(jsonDecode(responseIdCardDriverEgypt1!));
|
|
||||||
responseIdCardDriverEgypt = jsonDecode(responseIdCardDriverEgypt1!);
|
responseIdCardDriverEgypt = jsonDecode(responseIdCardDriverEgypt1!);
|
||||||
print(responseIdCardDriverEgypt);
|
|
||||||
update();
|
update();
|
||||||
return responseIdCardDriverEgypt;
|
return responseIdCardDriverEgypt;
|
||||||
} else {
|
} else {}
|
||||||
print("JSON string not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rest of your code...
|
// Rest of your code...
|
||||||
} else {
|
} else {}
|
||||||
print('Request failed with status: ${response.statusCode}');
|
|
||||||
print('Request failed with status: ${response.body}');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,10 +218,6 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
User? user = await authController
|
User? user = await authController
|
||||||
.signInWithApple();
|
.signInWithApple();
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
print(
|
|
||||||
"Successfully signed in: ${user.email}");
|
|
||||||
print(
|
|
||||||
"Successfully signed in: ${user.uid}");
|
|
||||||
box.write(BoxName.driverID, user.uid);
|
box.write(BoxName.driverID, user.uid);
|
||||||
box.write(
|
box.write(
|
||||||
BoxName.emailDriver, user.email);
|
BoxName.emailDriver, user.email);
|
||||||
@@ -233,9 +229,7 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
.toString(),
|
.toString(),
|
||||||
);
|
);
|
||||||
// Navigate to another screen or perform other actions
|
// Navigate to another screen or perform other actions
|
||||||
} else {
|
} else {}
|
||||||
print("Sign-in failed");
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
kolor: AppColor.primaryColor,
|
kolor: AppColor.primaryColor,
|
||||||
)
|
)
|
||||||
@@ -243,9 +237,6 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
// MyElevatedButton(
|
// MyElevatedButton(
|
||||||
// title: 'Sign In by Google'.tr,
|
// title: 'Sign In by Google'.tr,
|
||||||
// onPressed: () async {
|
// onPressed: () async {
|
||||||
// print(box.read(BoxName.emailDriver));
|
|
||||||
// print(box.read(BoxName.phoneDriver));
|
|
||||||
// print(box.read(BoxName.phoneVerified));
|
|
||||||
// },
|
// },
|
||||||
// kolor: AppColor.redColor,
|
// kolor: AppColor.redColor,
|
||||||
// ),
|
// ),
|
||||||
@@ -277,16 +268,13 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
// String apiKey = AK.payMobApikey;
|
// String apiKey = AK.payMobApikey;
|
||||||
// String convertedStringN = credentials.c(
|
// String convertedStringN = credentials.c(
|
||||||
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||||
// print('Converted v: $convertedStringN');
|
|
||||||
//
|
//
|
||||||
// String retrievedStringS = credentials.r(
|
// String retrievedStringS = credentials.r(
|
||||||
// credentials.r(
|
// credentials.r(
|
||||||
// credentials.r(convertedStringN, cn), cC),
|
// credentials.r(convertedStringN, cn), cC),
|
||||||
// cs);
|
// cs);
|
||||||
// print('Retrieved String: $retrievedStringS');
|
|
||||||
// //
|
// //
|
||||||
// if (retrievedStringS == apiKey) {
|
// if (retrievedStringS == apiKey) {
|
||||||
// print('same');
|
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
// icon: const Icon(
|
// icon: const Icon(
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ class HistoryDetailsPage extends StatelessWidget {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
String mapUrl =
|
String mapUrl =
|
||||||
'https://www.google.com/maps/dir/${res['start_location']}/${res['end_location']}/';
|
'https://www.google.com/maps/dir/${res['start_location']}/${res['end_location']}/';
|
||||||
print(mapUrl);
|
|
||||||
showInBrowser(mapUrl);
|
showInBrowser(mapUrl);
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ class _DriverCallPageState extends State<DriverCallPage> {
|
|||||||
.getAgoraToken(channelName: channelName, uid: uid.toString());
|
.getAgoraToken(channelName: channelName, uid: uid.toString());
|
||||||
setState(() {
|
setState(() {
|
||||||
token = res;
|
token = res;
|
||||||
print('token is $token');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,8 +62,6 @@ class _DriverCallPageState extends State<DriverCallPage> {
|
|||||||
uid = box.read(BoxName.phoneDriver) != null
|
uid = box.read(BoxName.phoneDriver) != null
|
||||||
? int.parse(box.read(BoxName.phoneDriver))
|
? int.parse(box.read(BoxName.phoneDriver))
|
||||||
: int.parse(box.read(BoxName.phone));
|
: int.parse(box.read(BoxName.phone));
|
||||||
print('remoteid is $_remoteUid');
|
|
||||||
print('uid is $uid');
|
|
||||||
// Set up an instance of Agora engine
|
// Set up an instance of Agora engine
|
||||||
initAgora();
|
initAgora();
|
||||||
}
|
}
|
||||||
@@ -76,8 +73,6 @@ class _DriverCallPageState extends State<DriverCallPage> {
|
|||||||
//create an instance of the Agora engine
|
//create an instance of the Agora engine
|
||||||
agoraEngine = createAgoraRtcEngine();
|
agoraEngine = createAgoraRtcEngine();
|
||||||
await agoraEngine.initialize(RtcEngineContext(appId: AK.agoraAppId));
|
await agoraEngine.initialize(RtcEngineContext(appId: AK.agoraAppId));
|
||||||
print('eeeeeeeeeeeeeeeeeeee');
|
|
||||||
print(agoraEngine);
|
|
||||||
// Register the event handler
|
// Register the event handler
|
||||||
agoraEngine.registerEventHandler(
|
agoraEngine.registerEventHandler(
|
||||||
RtcEngineEventHandler(
|
RtcEngineEventHandler(
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ class HelpCaptain extends StatelessWidget {
|
|||||||
// color: AppColor.greenColor,
|
// color: AppColor.greenColor,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
print(list['id']);
|
|
||||||
helpController.getindex(
|
helpController.getindex(
|
||||||
list['id'], list['helpQuestion']);
|
list['id'], list['helpQuestion']);
|
||||||
helpController.getHelpRepley(
|
helpController.getHelpRepley(
|
||||||
|
|||||||
@@ -31,15 +31,12 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
// String apiKey = 'seferface:malDev@2101';
|
// String apiKey = 'seferface:malDev@2101';
|
||||||
// String convertedStringN = credentials.c(
|
// String convertedStringN = credentials.c(
|
||||||
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||||
// print('Converted v: $convertedStringN');
|
|
||||||
//
|
//
|
||||||
// String retrievedStringS = credentials.r(
|
// String retrievedStringS = credentials.r(
|
||||||
// credentials.r(credentials.r(convertedStringN, cn), cC),
|
// credentials.r(credentials.r(convertedStringN, cn), cC),
|
||||||
// cs);
|
// cs);
|
||||||
// print('Retrieved String: $retrievedStringS');
|
|
||||||
// //
|
// //
|
||||||
// if (retrievedStringS == apiKey) {
|
// if (retrievedStringS == apiKey) {
|
||||||
// print('same');
|
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
// icon: const Icon(
|
// icon: const Icon(
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ class ZonesController extends GetxController {
|
|||||||
final double width = (southEast.longitude - southwest.longitude) * 100;
|
final double width = (southEast.longitude - southwest.longitude) * 100;
|
||||||
final double height = (northeast.latitude - southEast.latitude) * 100;
|
final double height = (northeast.latitude - southEast.latitude) * 100;
|
||||||
final double totalArea = width * height;
|
final double totalArea = width * height;
|
||||||
print(width);
|
|
||||||
print(height);
|
|
||||||
|
|
||||||
// final int numZones = (totalArea / desiredZoneArea).ceil();
|
// final int numZones = (totalArea / desiredZoneArea).ceil();
|
||||||
|
|
||||||
@@ -23,8 +21,6 @@ class ZonesController extends GetxController {
|
|||||||
((northeast.latitude - southwest.latitude) / zoneHeight).ceil();
|
((northeast.latitude - southwest.latitude) / zoneHeight).ceil();
|
||||||
final numCols =
|
final numCols =
|
||||||
((southEast.longitude - southwest.longitude) / zoneWidth).ceil();
|
((southEast.longitude - southwest.longitude) / zoneWidth).ceil();
|
||||||
print('zoneWidth = $zoneWidth');
|
|
||||||
print('zoneHeight = $zoneHeight');
|
|
||||||
List<String> zoneNames = [];
|
List<String> zoneNames = [];
|
||||||
List<LatLng> zoneCoordinates = [];
|
List<LatLng> zoneCoordinates = [];
|
||||||
|
|
||||||
@@ -67,7 +63,5 @@ class ZonesController extends GetxController {
|
|||||||
Map<String, List<LatLng>> zoneMap =
|
Map<String, List<LatLng>> zoneMap =
|
||||||
generateZoneMap(southwest, southEast, northeast);
|
generateZoneMap(southwest, southEast, northeast);
|
||||||
String jsonMap = json.encode(zoneMap);
|
String jsonMap = json.encode(zoneMap);
|
||||||
|
|
||||||
print(jsonMap);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
String mapUrl =
|
String mapUrl =
|
||||||
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/';
|
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/';
|
||||||
print(mapUrl);
|
|
||||||
showInBrowser(mapUrl);
|
showInBrowser(mapUrl);
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.map),
|
icon: const Icon(Icons.map),
|
||||||
@@ -319,7 +318,6 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
box.read(BoxName.nameDriver).toString(),
|
box.read(BoxName.nameDriver).toString(),
|
||||||
box.read(BoxName.tokenDriver).toString(),
|
box.read(BoxName.tokenDriver).toString(),
|
||||||
];
|
];
|
||||||
// print(bodyToPassenger);
|
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
'Apply Ride', 'your ride is applied'.tr,
|
'Apply Ride', 'your ride is applied'.tr,
|
||||||
@@ -365,8 +363,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
'startNameLocation': myList[29].toString(),
|
'startNameLocation': myList[29].toString(),
|
||||||
'endNameLocation': myList[30].toString(),
|
'endNameLocation': myList[30].toString(),
|
||||||
});
|
});
|
||||||
print(
|
'passengerID =${box.read(BoxName.rideArguments)}';
|
||||||
'passengerID =${box.read(BoxName.rideArguments)}');
|
|
||||||
Get.to(() => PassengerLocationMapPage(),
|
Get.to(() => PassengerLocationMapPage(),
|
||||||
arguments: box.read(BoxName.rideArguments));
|
arguments: box.read(BoxName.rideArguments));
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -153,7 +153,6 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
String mapUrl =
|
String mapUrl =
|
||||||
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/';
|
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/';
|
||||||
print(mapUrl);
|
|
||||||
showInBrowser(mapUrl);
|
showInBrowser(mapUrl);
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.map),
|
icon: const Icon(Icons.map),
|
||||||
@@ -318,7 +317,6 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
// .then((value) {
|
// .then((value) {
|
||||||
// var json = jsonDecode(res);
|
// var json = jsonDecode(res);
|
||||||
print('res $res');
|
|
||||||
if (res == "failure") {
|
if (res == "failure") {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title:
|
title:
|
||||||
@@ -350,7 +348,6 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
'order_id': body.toString(),
|
'order_id': body.toString(),
|
||||||
'status': 'Apply'
|
'status': 'Apply'
|
||||||
});
|
});
|
||||||
// print(bodyToPassenger);
|
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
'Apply Ride', 'your ride is applied'.tr,
|
'Apply Ride', 'your ride is applied'.tr,
|
||||||
@@ -361,38 +358,8 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|
||||||
// print(
|
|
||||||
// 'Arguments passed to PassengerLocationMapPage:');
|
// 'Arguments passed to PassengerLocationMapPage:');
|
||||||
// print('Passenger Location: ${myList[0]}');
|
|
||||||
// print('Passenger Destination: ${myList[1]}');
|
|
||||||
// print('Duration: ${myList[4]}');
|
|
||||||
// print('Total Cost: ${myList[26]}');
|
|
||||||
// print('Distance: ${myList[5]}');
|
|
||||||
// print('Name: ${myList[8]}');
|
|
||||||
// print('Phone: ${myList[10]}');
|
|
||||||
// print('Email: ${myList[28]}');
|
|
||||||
// print('Wallet Checked: ${myList[13]}');
|
|
||||||
// print('Token Passenger: ${myList[9]}');
|
|
||||||
// print('Direction: ${myList[29]}');
|
|
||||||
// print('Duration To Passenger: ${myList[15]}');
|
|
||||||
// print('Ride ID: ${myList[16]}');
|
|
||||||
// print('Passenger ID: ${myList[7]}');
|
|
||||||
// print('Driver ID: ${myList[18]}');
|
|
||||||
// print('Duration Of Ride Value: ${myList[19]}');
|
|
||||||
// print('Payment Amount: ${myList[2]}');
|
|
||||||
// print(
|
|
||||||
// 'Payment Method: ${myList[13] == 'true' ? 'visa' : 'cash'}');
|
// 'Payment Method: ${myList[13] == 'true' ? 'visa' : 'cash'}');
|
||||||
// print('Is Have Steps: ${myList[20]}');
|
|
||||||
// print('Step 0: ${myList[21]}');
|
|
||||||
// print('Step 1: ${myList[22]}');
|
|
||||||
// print('Step 2: ${myList[23]}');
|
|
||||||
// print('Step 3: ${myList[24]}');
|
|
||||||
// print('Step 4: ${myList[25]}');
|
|
||||||
// print('Passenger Wallet Burc: ${myList[26]}');
|
|
||||||
// print('Time Of Order: ${myList[30]}');
|
|
||||||
// print('Total Passenger: ${myList[2]}');
|
|
||||||
// print('Car Type: ${myList[31]}');
|
|
||||||
// print('Kazan: ${myList[32]}');
|
|
||||||
box.write(BoxName.rideArguments, {
|
box.write(BoxName.rideArguments, {
|
||||||
'passengerLocation': myList[0].toString(),
|
'passengerLocation': myList[0].toString(),
|
||||||
'passengerDestination': myList[1].toString(),
|
'passengerDestination': myList[1].toString(),
|
||||||
|
|||||||
@@ -103,10 +103,8 @@ class CardSeferWalletDriver extends StatelessWidget {
|
|||||||
.totalAmountVisa) -
|
.totalAmountVisa) -
|
||||||
5)
|
5)
|
||||||
.toStringAsFixed(0);
|
.toStringAsFixed(0);
|
||||||
// print(Get.find<PaymobPayout>()
|
|
||||||
// .dropdownValue
|
// .dropdownValue
|
||||||
// .toString());
|
// .toString());
|
||||||
// print(captainWalletController.phoneWallet.text
|
|
||||||
// .toString());
|
// .toString());
|
||||||
await Get.put(PaymobPayout()).payToWalletDriverAll(
|
await Get.put(PaymobPayout()).payToWalletDriverAll(
|
||||||
amountAfter5LE,
|
amountAfter5LE,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'package:SEFER/controller/functions/tts.dart';
|
import 'package:SEFER/controller/functions/tts.dart';
|
||||||
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
|
||||||
import 'package:SEFER/controller/home/payment/paymob_payout.dart';
|
import 'package:SEFER/controller/home/payment/paymob_payout.dart';
|
||||||
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
|
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -14,7 +13,6 @@ import 'package:SEFER/main.dart';
|
|||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||||
import 'package:path/path.dart';
|
|
||||||
|
|
||||||
import '../../../controller/payment/driver_payment_controller.dart';
|
import '../../../controller/payment/driver_payment_controller.dart';
|
||||||
import '../../widgets/my_scafold.dart';
|
import '../../widgets/my_scafold.dart';
|
||||||
|
|||||||
@@ -70,9 +70,7 @@ class PromosPassengerPage extends StatelessWidget {
|
|||||||
textStyle: AppStyle.title),
|
textStyle: AppStyle.title),
|
||||||
],
|
],
|
||||||
isRepeatingAnimation: true,
|
isRepeatingAnimation: true,
|
||||||
onTap: () {
|
onTap: () {},
|
||||||
print("Tap Event");
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
rides['description'],
|
rides['description'],
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
});
|
});
|
||||||
// .then((value) {
|
// .then((value) {
|
||||||
// var json = jsonDecode(res);
|
// var json = jsonDecode(res);
|
||||||
print('res $res');
|
|
||||||
if (res == "failure") {
|
if (res == "failure") {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title:
|
title:
|
||||||
@@ -156,7 +155,6 @@ class AvailableRidesPage extends StatelessWidget {
|
|||||||
'status': 'Applied'
|
'status': 'Applied'
|
||||||
});
|
});
|
||||||
|
|
||||||
// print(bodyToPassenger);
|
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
'Apply Ride',
|
'Apply Ride',
|
||||||
|
|||||||
Reference in New Issue
Block a user