4/16/1
This commit is contained in:
4
.env
4
.env
@@ -23,3 +23,7 @@ geminiApi=QOmqZsQYm08vOqjI7klVJfvP4WBFEoemjgy396iXrXlBl
|
|||||||
geminiApiMasa=QOmqZsQIdM4BRsKmaDJOP7dZp5-c6NWfch7PAlQXrXlBl
|
geminiApiMasa=QOmqZsQIdM4BRsKmaDJOP7dZp5-c6NWfch7PAlQXrXlBl
|
||||||
agoraAppId=71880f2j636509j24y5294480y30u848XrXlBl
|
agoraAppId=71880f2j636509j24y5294480y30u848XrXlBl
|
||||||
agoraAppCertificate=j17q944u49390q758u1649448q2y6xfuXrXlBl
|
agoraAppCertificate=j17q944u49390q758u1649448q2y6xfuXrXlBl
|
||||||
|
usernamePayMob=37319104052XrXlBl
|
||||||
|
passwordPayMob='g@nkD2#99!hD_.wXrXlBl'
|
||||||
|
integrationIdPayMob=0552355XrXlBl
|
||||||
|
payMobApikey='MDrGqKEWS1rVqHvEPDvPjJ7vZDBExrO7S3BEBgrlfUwTA3i5RnP5ZnvoL3M2S9rEBgrlNTdexH5pTPf7NJrvy1reZJv1Tn7zf7vTIDywjHg1C7Ley38HTDyNA3v7TPfdxJrax1rwPmPtMJyzqKEYZeghq3MuLUrFH3A1AgHcH15CZ9UaZTLOxnw0BTdzHHrBArisZerUMUUzZ1BnBeEijHvNjYLnS1BUICMhSmPhA15ifHyVqKEMHWyKLbyuIPvcH9UeL3vZyDf=XrXlBl'
|
||||||
@@ -42,4 +42,12 @@ class AK {
|
|||||||
a.r(a.r(a.r(Env.payPalClientIdLive, cn), cC), cs);
|
a.r(a.r(a.r(Env.payPalClientIdLive, cn), cC), cs);
|
||||||
static final String payPalSecretLive =
|
static final String payPalSecretLive =
|
||||||
a.r(a.r(a.r(Env.payPalSecretLive, cn), cC), cs);
|
a.r(a.r(a.r(Env.payPalSecretLive, cn), cC), cs);
|
||||||
|
static final String integrationIdPayMob =
|
||||||
|
a.r(a.r(a.r(Env.integrationIdPayMob, cn), cC), cs);
|
||||||
|
static final String passwordPayMob =
|
||||||
|
a.r(a.r(a.r(Env.passwordPayMob, cn), cC), cs);
|
||||||
|
static final String usernamePayMob =
|
||||||
|
a.r(a.r(a.r(Env.usernamePayMob, cn), cC), cs);
|
||||||
|
static final String payMobApikey =
|
||||||
|
a.r(a.r(a.r(Env.payMobApikey, cn), cC), cs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,6 +190,33 @@ class CRUD {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<dynamic> postPayMob({
|
||||||
|
required String link,
|
||||||
|
Map<String, dynamic>? payload,
|
||||||
|
}) async {
|
||||||
|
// String? basicAuthCredentials =
|
||||||
|
// await storage.read(key: BoxName.basicAuthCredentials);
|
||||||
|
var url = Uri.parse(
|
||||||
|
link,
|
||||||
|
);
|
||||||
|
var response = await http.post(url,
|
||||||
|
body: payload, headers: {'Content-Type': 'application/json'});
|
||||||
|
print(response.request);
|
||||||
|
print(payload);
|
||||||
|
|
||||||
|
var jsonData = jsonDecode(response.body);
|
||||||
|
// print(jsonData);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
if (jsonData['status'] == 'success') {
|
||||||
|
return response.body;
|
||||||
|
} else {
|
||||||
|
return (jsonData['status']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return response.statusCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sendEmail(
|
sendEmail(
|
||||||
String link,
|
String link,
|
||||||
Map<String, String>? payload,
|
Map<String, String>? payload,
|
||||||
|
|||||||
@@ -248,19 +248,22 @@ class HomeCaptainController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getKazanPercent() async {
|
getKazanPercent() async {
|
||||||
var res = await CRUD().get(link: AppLink.getKazanPercent);
|
var res = await CRUD().get(
|
||||||
|
link: AppLink.getKazanPercent,
|
||||||
|
payload: {'country': box.read(BoxName.countryCode).toString()},
|
||||||
|
);
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
kazan = double.parse(jsonDecode(res)['message'][0]['kazan']);
|
var json = jsonDecode(res);
|
||||||
naturePrice = double.parse(jsonDecode(res)['message'][0]['naturePrice']);
|
kazan = double.parse(json['message'][0]['kazan']);
|
||||||
heavyPrice = double.parse(jsonDecode(res)['message'][0]['heavyPrice']);
|
naturePrice = double.parse(json['message'][0]['naturePrice']);
|
||||||
latePrice = double.parse(jsonDecode(res)['message'][0]['latePrice']);
|
heavyPrice = double.parse(json['message'][0]['heavyPrice']);
|
||||||
comfortPrice =
|
latePrice = double.parse(json['message'][0]['latePrice']);
|
||||||
double.parse(jsonDecode(res)['message'][0]['comfortPrice']);
|
comfortPrice = double.parse(json['message'][0]['comfortPrice']);
|
||||||
speedPrice = double.parse(jsonDecode(res)['message'][0]['speedPrice']);
|
speedPrice = double.parse(json['message'][0]['speedPrice']);
|
||||||
deliveryPrice =
|
deliveryPrice = double.parse(json['message'][0]['deliveryPrice']);
|
||||||
double.parse(jsonDecode(res)['message'][0]['deliveryPrice']);
|
mashwariPrice = double.parse(json['message'][0]['freePrice']);
|
||||||
mashwariPrice = double.parse(jsonDecode(res)['message'][0]['freePrice']);
|
fuelPrice = double.parse(json['message'][0]['fuelPrice']);
|
||||||
fuelPrice = double.parse(jsonDecode(res)['message'][0]['fuelPrice']);
|
print(json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2489,17 +2489,16 @@ class MapPassengerController extends GetxController {
|
|||||||
);
|
);
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
// print(jsonDecode(res));
|
// print(jsonDecode(res));
|
||||||
kazan = double.parse(jsonDecode(res)['message'][0]['kazan']);
|
var json = jsonDecode(res);
|
||||||
naturePrice = double.parse(jsonDecode(res)['message'][0]['naturePrice']);
|
kazan = double.parse(json['message'][0]['kazan']);
|
||||||
heavyPrice = double.parse(jsonDecode(res)['message'][0]['heavyPrice']);
|
naturePrice = double.parse(json['message'][0]['naturePrice']);
|
||||||
latePrice = double.parse(jsonDecode(res)['message'][0]['latePrice']);
|
heavyPrice = double.parse(json['message'][0]['heavyPrice']);
|
||||||
fuelPrice = double.parse(jsonDecode(res)['message'][0]['fuelPrice']);
|
latePrice = double.parse(json['message'][0]['latePrice']);
|
||||||
comfortPrice =
|
comfortPrice = double.parse(json['message'][0]['comfortPrice']);
|
||||||
double.parse(jsonDecode(res)['message'][0]['comfortPrice']);
|
speedPrice = double.parse(json['message'][0]['speedPrice']);
|
||||||
speedPrice = double.parse(jsonDecode(res)['message'][0]['speedPrice']);
|
deliveryPrice = double.parse(json['message'][0]['deliveryPrice']);
|
||||||
mashwariPrice = double.parse(jsonDecode(res)['message'][0]['freePrice']);
|
mashwariPrice = double.parse(json['message'][0]['freePrice']);
|
||||||
deliveryPrice =
|
fuelPrice = double.parse(json['message'][0]['fuelPrice']);
|
||||||
double.parse(jsonDecode(res)['message'][0]['deliveryPrice']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:flutter_stripe/flutter_stripe.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:local_auth/local_auth.dart';
|
import 'package:local_auth/local_auth.dart';
|
||||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||||
|
import 'package:paymob_payment/paymob_payment.dart';
|
||||||
|
|
||||||
import '../../constant/box_name.dart';
|
import '../../constant/box_name.dart';
|
||||||
import '../../constant/colors.dart';
|
import '../../constant/colors.dart';
|
||||||
@@ -457,6 +458,42 @@ class PaymentController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> payWithPayMob(
|
||||||
|
BuildContext context, String amount, currency) async {
|
||||||
|
try {
|
||||||
|
final PaymobResponse? response = await PaymobPayment.instance.pay(
|
||||||
|
context: context,
|
||||||
|
currency: currency, //"EGP",
|
||||||
|
amountInCents: amount, // 19.00 EGP
|
||||||
|
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') {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Payment Successful',
|
||||||
|
content: const Text('The payment was approved.'),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Payment Failed',
|
||||||
|
content:
|
||||||
|
const Text('The payment was not approved. Please try again.'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Error',
|
||||||
|
content: const Text('An error occurred during the payment process.'),
|
||||||
|
);
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
timestamp = now.millisecondsSinceEpoch;
|
timestamp = now.millisecondsSinceEpoch;
|
||||||
|
|||||||
129
lib/controller/payment/paymob.dart
Normal file
129
lib/controller/payment/paymob.dart
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
|
import 'package:dio/dio.dart' as dio;
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
import '../../constant/api_key.dart';
|
||||||
|
import '../../main.dart';
|
||||||
|
|
||||||
|
class PaymobManager extends GetxController {
|
||||||
|
String authanticationToken1 = "";
|
||||||
|
String orderId1 = "";
|
||||||
|
|
||||||
|
Future<String> getPaymentKey(int amount, String currency) async {
|
||||||
|
try {
|
||||||
|
String authanticationToken = await _getAuthanticationToken();
|
||||||
|
|
||||||
|
int orderId = await _getOrderId(
|
||||||
|
authanticationToken: authanticationToken,
|
||||||
|
amount: (100 * amount).toString(),
|
||||||
|
currency: currency,
|
||||||
|
);
|
||||||
|
|
||||||
|
String paymentKey = await _getPaymentKey(
|
||||||
|
authanticationToken: authanticationToken,
|
||||||
|
amount: (100 * amount).toString(),
|
||||||
|
currency: currency,
|
||||||
|
orderId: orderId.toString(),
|
||||||
|
);
|
||||||
|
authanticationToken1 = authanticationToken.toString();
|
||||||
|
orderId1 = orderId.toString();
|
||||||
|
update();
|
||||||
|
return paymentKey;
|
||||||
|
} catch (e) {
|
||||||
|
print("Exc==========================================");
|
||||||
|
print(e.toString());
|
||||||
|
throw Exception();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> payWithPayMob(int amount, String currency) async {
|
||||||
|
String key = await PaymobManager().getPaymentKey(amount, currency);
|
||||||
|
await launchUrl(
|
||||||
|
Uri.parse(
|
||||||
|
'https://accept.paymob.com/api/acceptance/iframes/837992?payment_token=$key'),
|
||||||
|
);
|
||||||
|
|
||||||
|
// String paymentStatus = await _getStatusAfterPaid();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> _getStatusAfterPaid() async {
|
||||||
|
print(authanticationToken1);
|
||||||
|
print(orderId1);
|
||||||
|
final dio.Response response = await Dio().post(
|
||||||
|
"https://accept.paymob.com/api/ecommerce/orders/transaction_inquiry",
|
||||||
|
data: {
|
||||||
|
"auth_token": authanticationToken1,
|
||||||
|
"merchant_order_id": "970960",
|
||||||
|
"order_id": orderId1
|
||||||
|
});
|
||||||
|
print(response.data);
|
||||||
|
print(response.data['success']);
|
||||||
|
return response.data["success"];
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> _getAuthanticationToken() async {
|
||||||
|
final dio.Response response =
|
||||||
|
await Dio().post("https://accept.paymob.com/api/auth/tokens", data: {
|
||||||
|
"api_key": AK.payMobApikey,
|
||||||
|
'username': AK.usernamePayMob,
|
||||||
|
"password": AK.passwordPayMob,
|
||||||
|
});
|
||||||
|
return response.data["token"];
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> _getOrderId({
|
||||||
|
required String authanticationToken,
|
||||||
|
required String amount,
|
||||||
|
required String currency,
|
||||||
|
}) async {
|
||||||
|
final dio.Response response = await Dio()
|
||||||
|
.post("https://accept.paymob.com/api/ecommerce/orders", data: {
|
||||||
|
"auth_token": authanticationToken,
|
||||||
|
"amount_cents": amount,
|
||||||
|
"currency": currency,
|
||||||
|
"delivery_needed": "false",
|
||||||
|
"items": [],
|
||||||
|
});
|
||||||
|
print('id is');
|
||||||
|
print(response.data["id"]);
|
||||||
|
return response.data["id"];
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> _getPaymentKey({
|
||||||
|
required String authanticationToken,
|
||||||
|
required String orderId,
|
||||||
|
required String amount,
|
||||||
|
required String currency,
|
||||||
|
}) async {
|
||||||
|
final dio.Response response = await Dio()
|
||||||
|
.post("https://accept.paymob.com/api/acceptance/payment_keys", data: {
|
||||||
|
"expiration": 200,
|
||||||
|
"auth_token": authanticationToken.toString(),
|
||||||
|
"order_id": orderId.toString(),
|
||||||
|
"integration_id": int.parse(AK.integrationIdPayMob),
|
||||||
|
"lock_order_when_paid": "false",
|
||||||
|
"amount_cents": amount,
|
||||||
|
"currency": currency,
|
||||||
|
"billing_data": {
|
||||||
|
"first_name": box.read(BoxName.nameDriver) ?? box.read(BoxName.name),
|
||||||
|
"last_name": box.read(BoxName.lastNameDriver) ?? box.read(BoxName.name),
|
||||||
|
"email": box.read(BoxName.emailDriver) ?? box.read(BoxName.email),
|
||||||
|
"phone_number":
|
||||||
|
box.read(BoxName.phoneDriver) ?? box.read(BoxName.phone),
|
||||||
|
"apartment": "NA",
|
||||||
|
"floor": "NA",
|
||||||
|
"street": "NA",
|
||||||
|
"building": "NA",
|
||||||
|
"shipping_method": "NA",
|
||||||
|
"postal_code": "NA",
|
||||||
|
"city": "NA",
|
||||||
|
"country": box.read(BoxName.countryCode),
|
||||||
|
"state": "NA"
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data["token"];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:background_location/background_location.dart';
|
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -9,6 +8,7 @@ import 'package:flutter_stripe/flutter_stripe.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get_storage/get_storage.dart';
|
import 'package:get_storage/get_storage.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:paymob_payment/paymob_payment.dart';
|
||||||
import 'package:wakelock_plus/wakelock_plus.dart';
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||||
import 'constant/api_key.dart';
|
import 'constant/api_key.dart';
|
||||||
import 'constant/box_name.dart';
|
import 'constant/box_name.dart';
|
||||||
@@ -17,7 +17,6 @@ import 'constant/info.dart';
|
|||||||
import 'controller/firebase/firbase_messge.dart';
|
import 'controller/firebase/firbase_messge.dart';
|
||||||
import 'controller/firebase/local_notification.dart';
|
import 'controller/firebase/local_notification.dart';
|
||||||
import 'controller/functions/location_background_controller.dart';
|
import 'controller/functions/location_background_controller.dart';
|
||||||
import 'controller/functions/location_controller.dart';
|
|
||||||
import 'controller/local/local_controller.dart';
|
import 'controller/local/local_controller.dart';
|
||||||
import 'controller/local/translations.dart';
|
import 'controller/local/translations.dart';
|
||||||
import 'firebase_options.dart';
|
import 'firebase_options.dart';
|
||||||
@@ -26,6 +25,8 @@ import 'splash_screen_page.dart';
|
|||||||
|
|
||||||
final box = GetStorage();
|
final box = GetStorage();
|
||||||
const storage = FlutterSecureStorage();
|
const storage = FlutterSecureStorage();
|
||||||
|
final PaymobPayment paymobPayment = PaymobPayment();
|
||||||
|
|
||||||
DbSql sql = DbSql.instance;
|
DbSql sql = DbSql.instance;
|
||||||
@pragma('vm:entry-point')
|
@pragma('vm:entry-point')
|
||||||
Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||||
@@ -82,6 +83,13 @@ void main() async {
|
|||||||
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,
|
||||||
|
);
|
||||||
|
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,8 +89,10 @@ class RateDriverFromPassenger extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'Exclusive offers and discounts always with the Sefer app'
|
'Exclusive offers and discounts always with the Sefer app'
|
||||||
.tr,
|
.tr,
|
||||||
style: AppStyle.title
|
style: AppStyle.title.copyWith(
|
||||||
.copyWith(color: AppColor.redColor),
|
color: AppColor.redColor,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class RatePassenger extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
'Exclusive offers and discounts always with the Sefer app'
|
'Exclusive offers and discounts always with the Sefer app'
|
||||||
.tr,
|
.tr,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
style: AppStyle.title
|
style: AppStyle.title
|
||||||
.copyWith(color: AppColor.redColor),
|
.copyWith(color: AppColor.redColor),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:SEFER/constant/api_key.dart';
|
||||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -196,64 +197,29 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
displayFullTextOnTap: true,
|
displayFullTextOnTap: true,
|
||||||
stopPauseOnTap: true,
|
stopPauseOnTap: true,
|
||||||
),
|
),
|
||||||
IconButton(
|
// IconButton(
|
||||||
onPressed: () async {
|
// onPressed: () async {
|
||||||
// // String v =
|
|
||||||
// // await storage.read(key: BoxName.serverAPI) ?? '';
|
|
||||||
// // print(v);
|
|
||||||
// // sql.deleteAllData(TableName.faceDetectTimes);
|
|
||||||
// AC credentials = AC();
|
// AC credentials = AC();
|
||||||
// String apiKey =
|
// String apiKey = AK.payMobApikey;
|
||||||
// 'Qfrhx9d5YVHiy4uEuK4wiFc9kIuFFlvc5A6WVzPK';
|
|
||||||
// // // // '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';
|
|
||||||
// // credentials.gAK();
|
|
||||||
// String? apiKeyf =
|
|
||||||
// await storage.read(key: BoxName.chatGPTkey);
|
|
||||||
// print(apiKeyf);
|
|
||||||
// String convertedString = credentials.c(apiKey, s);
|
|
||||||
// String convertedStrings = credentials.c(apiKey, s);
|
|
||||||
// print('Converted String s: $convertedStrings');
|
|
||||||
// String convertedStringC =
|
|
||||||
// credentials.c(convertedStrings, c);
|
|
||||||
// print('v: $v');
|
|
||||||
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
|
||||||
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
|
||||||
// String convertedStringN = credentials.c(
|
// String convertedStringN = credentials.c(
|
||||||
// credentials.c(
|
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||||
// credentials.c(
|
|
||||||
// 'ASCeQiScKwmkMyjlrr7l0tT57Br2yPRAgm5xZndjnusED53JA0us1DbqJaJXDVWFCtAHapjVqA5FEEPL',
|
|
||||||
// cs),
|
|
||||||
// cC),
|
|
||||||
// cn);
|
|
||||||
// print('Converted v: $convertedStringN');
|
// print('Converted v: $convertedStringN');
|
||||||
// //
|
//
|
||||||
// String retrievedStringN =
|
|
||||||
// credentials.r(convertedStringN, n);
|
|
||||||
// print('Retrieved String: $retrievedStringN');
|
|
||||||
// String retrievedStringC =
|
|
||||||
// credentials.r(retrievedStringN, c);
|
|
||||||
// print('Retrieved String: $retrievedStringC');
|
|
||||||
|
|
||||||
// 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');
|
// print('Retrieved String: $retrievedStringS');
|
||||||
//
|
// //
|
||||||
// if (retrievedStringS == apiKey) {
|
// if (retrievedStringS == apiKey) {
|
||||||
// print('same');
|
// print('same');
|
||||||
// }
|
// }
|
||||||
// print(' AK is ' + AK.chatGPTkey); //
|
// },
|
||||||
//
|
// icon: const Icon(
|
||||||
// print(' ENV is ' + Env.chatGPTkey); //
|
// Icons.close,
|
||||||
// // print('storage is ' + v); //
|
// color: AppColor.blueColor,
|
||||||
// print('storage is ' + apiKeyf!); //
|
// ),
|
||||||
},
|
// ),
|
||||||
icon: const Icon(
|
|
||||||
Icons.close,
|
|
||||||
color: AppColor.blueColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import 'package:SEFER/controller/payment/paymob.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
@@ -52,18 +52,9 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
orderRequestController.getRefusedOrderByCaptain(),
|
orderRequestController.getRefusedOrderByCaptain(),
|
||||||
icon: const Icon(Icons.get_app)),
|
icon: const Icon(Icons.get_app)),
|
||||||
),
|
),
|
||||||
GetBuilder<OrderRequestController>(
|
|
||||||
builder: (orderRequestController) => MyCircleContainer(
|
|
||||||
child: Text(
|
|
||||||
orderRequestController.countRefuse.toString(),
|
|
||||||
style: AppStyle.title,
|
|
||||||
))),
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// NotificationController()
|
PaymobManager().getPaymentKey(100, 'EGP');
|
||||||
// .showNotification('Order', 'hi this is', 'tone2');
|
|
||||||
// Get.to(() => CallPage(callID: '111'));
|
|
||||||
// MapDriverController().getDriverScam();
|
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.call,
|
Icons.call,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:vibration/vibration.dart';
|
|||||||
|
|
||||||
import '../../../../constant/colors.dart';
|
import '../../../../constant/colors.dart';
|
||||||
import '../../../../constant/style.dart';
|
import '../../../../constant/style.dart';
|
||||||
|
import '../../../../controller/home/captin/home_captain_controller.dart';
|
||||||
import '../../../../controller/home/captin/map_driver_controller.dart';
|
import '../../../../controller/home/captin/map_driver_controller.dart';
|
||||||
import '../../../widgets/elevated_btn.dart';
|
import '../../../widgets/elevated_btn.dart';
|
||||||
|
|
||||||
@@ -134,10 +135,16 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
print(Get.find<HomeCaptainController>()
|
||||||
|
.comfortPrice);
|
||||||
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
mapDriverController.carType,
|
mapDriverController.carType,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class MapPagePassenger extends StatelessWidget {
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
GoogleMapPassengerWidget(),
|
GoogleMapPassengerWidget(),
|
||||||
leftMainMenuIcons(),
|
leftMainMenuIcons(), PaymobPackage(),
|
||||||
const PickerIconOnMap(),
|
const PickerIconOnMap(),
|
||||||
// PickerAnimtionContainerFormPlaces(),
|
// PickerAnimtionContainerFormPlaces(),
|
||||||
const MainBottomMenuMap(),
|
const MainBottomMenuMap(),
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import 'dart:io';
|
import 'package:SEFER/controller/payment/payment_controller.dart';
|
||||||
|
import 'package:SEFER/controller/payment/paymob.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
|
import 'package:paymob_payment/paymob_payment.dart';
|
||||||
|
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../controller/functions/tts.dart';
|
import '../../../controller/functions/tts.dart';
|
||||||
import '../../../controller/home/map_passenger_controller.dart';
|
import '../../../controller/home/map_passenger_controller.dart';
|
||||||
import '../Captin/home_captain/driver_call_page.dart';
|
|
||||||
|
|
||||||
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||||
final textToSpeechController = Get.put(TextToSpeechController());
|
final textToSpeechController = Get.put(TextToSpeechController());
|
||||||
@@ -17,7 +17,8 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
builder: (controller) => Positioned(
|
builder: (controller) => Positioned(
|
||||||
top: 85,
|
top: 85,
|
||||||
left: 6,
|
left: 6,
|
||||||
child: Column(
|
child: Builder(builder: (context) {
|
||||||
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
duration: const Duration(microseconds: 200),
|
duration: const Duration(microseconds: 200),
|
||||||
@@ -111,7 +112,12 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
border: Border.all(),
|
border: Border.all(),
|
||||||
borderRadius: BorderRadius.circular(15)),
|
borderRadius: BorderRadius.circular(15)),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
|
// await PaymobManager().payWithPayMob(100, 'EGP');
|
||||||
|
await Get.find<PaymentController>()
|
||||||
|
.payWithPayMob(context, '11', 'EGP');
|
||||||
|
// Initiates a payment with a card using the FlutterPaymob instance
|
||||||
|
|
||||||
// NotificationController()
|
// NotificationController()
|
||||||
// .showNotification('Order', 'hi this is', 'tone1');
|
// .showNotification('Order', 'hi this is', 'tone1');
|
||||||
// Get.to(() => DriverCallPage());
|
// Get.to(() => DriverCallPage());
|
||||||
@@ -132,6 +138,25 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)),
|
);
|
||||||
|
})),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class PaymobPackage extends StatelessWidget {
|
||||||
|
const PaymobPackage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
await Get.find<PaymentController>()
|
||||||
|
.payWithPayMob(context, '11', 'EGP');
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
child: Text('pay'),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -305,14 +305,14 @@ class CountryPicker extends StatelessWidget {
|
|||||||
final ProfileController controller = Get.put(ProfileController());
|
final ProfileController controller = Get.put(ProfileController());
|
||||||
|
|
||||||
final List<String> countryOptions = [
|
final List<String> countryOptions = [
|
||||||
'Jordan'.tr,
|
'Jordan',
|
||||||
'USA'.tr,
|
'USA',
|
||||||
'Eygpt'.tr,
|
'Egypt',
|
||||||
'Turkey'.tr,
|
'Turkey',
|
||||||
'Saudi Arabia'.tr,
|
'Saudi Arabia',
|
||||||
'Qatar'.tr,
|
'Qatar',
|
||||||
'Bahrain'.tr,
|
'Bahrain',
|
||||||
'Kuwait'.tr,
|
'Kuwait',
|
||||||
];
|
];
|
||||||
|
|
||||||
CountryPicker({Key? key}) : super(key: key);
|
CountryPicker({Key? key}) : super(key: key);
|
||||||
@@ -341,27 +341,33 @@ class CountryPicker extends StatelessWidget {
|
|||||||
itemExtent: 32,
|
itemExtent: 32,
|
||||||
onSelectedItemChanged: (int index) {
|
onSelectedItemChanged: (int index) {
|
||||||
controller.setCountry(countryOptions[index]);
|
controller.setCountry(countryOptions[index]);
|
||||||
|
box.write(BoxName.countryCode,
|
||||||
|
countryOptions[index]); // Save in English
|
||||||
},
|
},
|
||||||
children: List.generate(
|
children: List.generate(
|
||||||
countryOptions.length,
|
countryOptions.length,
|
||||||
(index) => Center(
|
(index) => Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
countryOptions[index],
|
countryOptions[index]
|
||||||
|
.tr, // Display translated if not English
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: 'Select Country'.tr,
|
title: 'Select Country'.tr, // Use translated text for button
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.find<LoginController>()
|
Get.find<LoginController>().saveCountryCode(controller
|
||||||
.saveCountryCode(controller.selectedCountry.toString());
|
.selectedCountry
|
||||||
box.write(
|
.toString()); // No conversion needed
|
||||||
BoxName.countryCode, controller.selectedCountry.toString());
|
box.write(BoxName.countryCode,
|
||||||
|
controller.selectedCountry); // Already saved in English
|
||||||
Get.off(LoginPage());
|
Get.off(LoginPage());
|
||||||
})
|
},
|
||||||
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
16
pubspec.lock
16
pubspec.lock
@@ -361,6 +361,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.0"
|
version: "7.0.0"
|
||||||
|
dio:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: dio
|
||||||
|
sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.4.3+1"
|
||||||
envied:
|
envied:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -1464,6 +1472,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "2.2.1"
|
||||||
|
paymob_payment:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: paymob_payment
|
||||||
|
sha256: "5a7f6ef9c1d538b5bdff52e757f09a97755b0c0cabe9f5098a13cc005477584c"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.1+1"
|
||||||
permission_handler:
|
permission_handler:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ dependencies:
|
|||||||
background_location: ^0.13.0
|
background_location: ^0.13.0
|
||||||
flutter_sound: ^9.2.13
|
flutter_sound: ^9.2.13
|
||||||
record: ^5.0.5
|
record: ^5.0.5
|
||||||
|
dio: ^5.4.3+1
|
||||||
|
paymob_payment: ^0.0.1+1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user