This commit is contained in:
Hamza Aleghwairyeen
2024-04-16 10:22:01 +03:00
parent a2d4cd845c
commit 24b3804045
18 changed files with 457 additions and 226 deletions

View File

@@ -89,8 +89,10 @@ class RateDriverFromPassenger extends StatelessWidget {
Text(
'Exclusive offers and discounts always with the Sefer app'
.tr,
style: AppStyle.title
.copyWith(color: AppColor.redColor),
style: AppStyle.title.copyWith(
color: AppColor.redColor,
),
textAlign: TextAlign.center,
)
],
),

View File

@@ -84,6 +84,7 @@ class RatePassenger extends StatelessWidget {
Text(
'Exclusive offers and discounts always with the Sefer app'
.tr,
textAlign: TextAlign.center,
style: AppStyle.title
.copyWith(color: AppColor.redColor),
)

View File

@@ -1,3 +1,4 @@
import 'package:SEFER/constant/api_key.dart';
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
@@ -196,64 +197,29 @@ class LoginCaptin extends StatelessWidget {
displayFullTextOnTap: true,
stopPauseOnTap: true,
),
IconButton(
onPressed: () async {
// // String v =
// // await storage.read(key: BoxName.serverAPI) ?? '';
// // print(v);
// // sql.deleteAllData(TableName.faceDetectTimes);
// AC credentials = AC();
// String apiKey =
// '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(
// credentials.c(
// credentials.c(
// 'ASCeQiScKwmkMyjlrr7l0tT57Br2yPRAgm5xZndjnusED53JA0us1DbqJaJXDVWFCtAHapjVqA5FEEPL',
// cs),
// cC),
// cn);
// 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(
// credentials.r(
// credentials.r(convertedStringN, cn), cC),
// cs);
// print('Retrieved String: $retrievedStringS');
//
// if (retrievedStringS == apiKey) {
// print('same');
// }
// print(' AK is ' + AK.chatGPTkey); //
//
// print(' ENV is ' + Env.chatGPTkey); //
// // print('storage is ' + v); //
// print('storage is ' + apiKeyf!); //
},
icon: const Icon(
Icons.close,
color: AppColor.blueColor,
),
),
// IconButton(
// onPressed: () async {
// AC credentials = AC();
// String apiKey = AK.payMobApikey;
// String convertedStringN = credentials.c(
// credentials.c(credentials.c(apiKey, cs), cC), cn);
// print('Converted v: $convertedStringN');
//
// String retrievedStringS = credentials.r(
// credentials.r(
// credentials.r(convertedStringN, cn), cC),
// cs);
// print('Retrieved String: $retrievedStringS');
// //
// if (retrievedStringS == apiKey) {
// print('same');
// }
// },
// icon: const Icon(
// Icons.close,
// color: AppColor.blueColor,
// ),
// ),
],
),
)

View File

@@ -1,5 +1,5 @@
import 'package:SEFER/controller/payment/paymob.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
@@ -52,18 +52,9 @@ class HomeCaptain extends StatelessWidget {
orderRequestController.getRefusedOrderByCaptain(),
icon: const Icon(Icons.get_app)),
),
GetBuilder<OrderRequestController>(
builder: (orderRequestController) => MyCircleContainer(
child: Text(
orderRequestController.countRefuse.toString(),
style: AppStyle.title,
))),
IconButton(
onPressed: () {
// NotificationController()
// .showNotification('Order', 'hi this is', 'tone2');
// Get.to(() => CallPage(callID: '111'));
// MapDriverController().getDriverScam();
PaymobManager().getPaymentKey(100, 'EGP');
},
icon: const Icon(
Icons.call,

View File

@@ -7,6 +7,7 @@ import 'package:vibration/vibration.dart';
import '../../../../constant/colors.dart';
import '../../../../constant/style.dart';
import '../../../../controller/home/captin/home_captain_controller.dart';
import '../../../../controller/home/captin/map_driver_controller.dart';
import '../../../widgets/elevated_btn.dart';
@@ -134,9 +135,15 @@ GetBuilder<MapDriverController> driverEndRideBar() {
),
Container(
decoration: AppStyle.boxDecoration1,
child: Text(
mapDriverController.carType,
style: AppStyle.title,
child: InkWell(
onTap: () {
print(Get.find<HomeCaptainController>()
.comfortPrice);
},
child: Text(
mapDriverController.carType,
style: AppStyle.title,
),
),
)
],

View File

@@ -34,7 +34,7 @@ class MapPagePassenger extends StatelessWidget {
child: Stack(
children: [
GoogleMapPassengerWidget(),
leftMainMenuIcons(),
leftMainMenuIcons(), PaymobPackage(),
const PickerIconOnMap(),
// PickerAnimtionContainerFormPlaces(),
const MainBottomMenuMap(),

View File

@@ -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:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/main.dart';
import 'package:paymob_payment/paymob_payment.dart';
import '../../../constant/colors.dart';
import '../../../controller/functions/tts.dart';
import '../../../controller/home/map_passenger_controller.dart';
import '../Captin/home_captain/driver_call_page.dart';
GetBuilder<MapPassengerController> leftMainMenuIcons() {
final textToSpeechController = Get.put(TextToSpeechController());
@@ -17,121 +17,146 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
builder: (controller) => Positioned(
top: 85,
left: 6,
child: Column(
children: [
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
border: Border.all(),
color: AppColor.secondaryColor,
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.changeMapType();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.satellite_alt,
size: 29,
child: Builder(builder: (context) {
return Column(
children: [
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
border: Border.all(),
color: AppColor.secondaryColor,
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.changeMapType();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.satellite_alt,
size: 29,
),
),
),
),
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.changeMapTraffic();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.streetview_sharp,
size: 29,
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.changeMapTraffic();
// Toast.show(context, 'This is a toast message!');
},
icon: const Icon(
Icons.streetview_sharp,
size: 29,
),
),
),
),
const SizedBox(
height: 5,
),
// if (Platform.isIOS)
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.mapController?.animateCamera(
CameraUpdate.newLatLng(LatLng(
controller.passengerLocation.latitude,
controller.passengerLocation.longitude)));
},
icon: const Icon(
Icons.location_on,
size: 29,
const SizedBox(
height: 5,
),
// if (Platform.isIOS)
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
controller.mapController?.animateCamera(
CameraUpdate.newLatLng(LatLng(
controller.passengerLocation.latitude,
controller.passengerLocation.longitude)));
},
icon: const Icon(
Icons.location_on,
size: 29,
),
),
),
),
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
textToSpeechController.speakText(
'''hello this is ${box.read(BoxName.name)}''');
},
icon: const Icon(
Icons.voice_chat,
size: 29,
const SizedBox(
height: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
textToSpeechController.speakText(
'''hello this is ${box.read(BoxName.name)}''');
},
icon: const Icon(
Icons.voice_chat,
size: 29,
),
),
),
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
// NotificationController()
// .showNotification('Order', 'hi this is', 'tone1');
// Get.to(() => DriverCallPage());
// print(controller.carLocationsModels);
// controller.getKazanPercent();
// PassengerCallPage(
// channelName: '',
// token: '',
// remoteID: '',
// )
// Get.to(() => const CallPage());
// print(box.read(BoxName.lang));
},
icon: const Icon(
Icons.call,
size: 29,
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
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()
// .showNotification('Order', 'hi this is', 'tone1');
// Get.to(() => DriverCallPage());
// print(controller.carLocationsModels);
// controller.getKazanPercent();
// PassengerCallPage(
// channelName: '',
// token: '',
// remoteID: '',
// )
// Get.to(() => const CallPage());
// print(box.read(BoxName.lang));
},
icon: const Icon(
Icons.call,
size: 29,
),
),
),
),
],
)),
],
);
})),
);
}
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'),
));
}
}

View File

@@ -305,14 +305,14 @@ class CountryPicker extends StatelessWidget {
final ProfileController controller = Get.put(ProfileController());
final List<String> countryOptions = [
'Jordan'.tr,
'USA'.tr,
'Eygpt'.tr,
'Turkey'.tr,
'Saudi Arabia'.tr,
'Qatar'.tr,
'Bahrain'.tr,
'Kuwait'.tr,
'Jordan',
'USA',
'Egypt',
'Turkey',
'Saudi Arabia',
'Qatar',
'Bahrain',
'Kuwait',
];
CountryPicker({Key? key}) : super(key: key);
@@ -341,27 +341,33 @@ class CountryPicker extends StatelessWidget {
itemExtent: 32,
onSelectedItemChanged: (int index) {
controller.setCountry(countryOptions[index]);
box.write(BoxName.countryCode,
countryOptions[index]); // Save in English
},
children: List.generate(
countryOptions.length,
(index) => Center(
child: Text(
countryOptions[index],
countryOptions[index]
.tr, // Display translated if not English
style: AppStyle.title,
),
),
),
),
),
MyElevatedButton(
title: 'Select Country'.tr,
onPressed: () {
Get.find<LoginController>()
.saveCountryCode(controller.selectedCountry.toString());
box.write(
BoxName.countryCode, controller.selectedCountry.toString());
Get.off(LoginPage());
})
title: 'Select Country'.tr, // Use translated text for button
onPressed: () {
Get.find<LoginController>().saveCountryCode(controller
.selectedCountry
.toString()); // No conversion needed
box.write(BoxName.countryCode,
controller.selectedCountry); // Already saved in English
Get.off(LoginPage());
},
)
],
);
});