This commit is contained in:
Hamza-Ayed
2024-05-31 01:25:20 +03:00
parent 93adf15874
commit efec9eb6a2
8 changed files with 509 additions and 503 deletions

View File

@@ -2,8 +2,9 @@ import 'package:flutter/material.dart';
class AppColor { class AppColor {
static const Color primaryColor = Colors.black; // Slightly softer red static const Color primaryColor = Colors.black; // Slightly softer red
static const Color secondaryColor = Colors.white; static const Color secondaryColor = Color.fromARGB(255, 255, 255, 255);
static const Color accentColor = Color(0xFFD81F26); // Google Green static const Color accentColor =
Color.fromARGB(255, 185, 169, 169); // Google Green
static const Color backgroundColor = static const Color backgroundColor =
Color(0xFFF5F5F5); // Light grey background Color(0xFFF5F5F5); // Light grey background
static const Color redColor = Color(0xFFEA4335); // Google Red static const Color redColor = Color(0xFFEA4335); // Google Red

View File

@@ -81,8 +81,8 @@ class RegisterController extends GetxController {
'token': randomNumber.toString(), 'token': randomNumber.toString(),
}); });
// await smsEgyptController.sendSmsEgypt( await smsEgyptController.sendSmsEgypt(
// phoneController.text.toString(), randomNumber.toString()); phoneController.text.toString(), randomNumber.toString());
isSent = true; isSent = true;
isLoading = false; isLoading = false;
update(); update();

View File

@@ -22,7 +22,7 @@ void launchCommunication(
url = 'tel:$contactInfo'; url = 'tel:$contactInfo';
break; break;
case 'sms': case 'sms':
url = 'sms:$contactInfo?body=$encodedMessage'; url = 'sms:$contactInfo&body=$encodedMessage';
break; break;
case 'whatsapp': case 'whatsapp':
url = url =
@@ -58,8 +58,10 @@ void launchCommunication(
return; return;
} }
if (await canLaunch(url)) { print('Launching URL: $url'); // Add this line for debugging
await launch(url);
if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
} else { } else {
print('Could not launch $url'); print('Could not launch $url');
} }

View File

@@ -4,6 +4,8 @@ class MyTranslation extends Translations {
@override @override
Map<String, Map<String, String>> get keys => { Map<String, Map<String, String>> get keys => {
"ar": { "ar": {
'The driver waiting you in picked location .':
"السائق ينتظرك في موقع الركوب.",
'About Us': "نبذة عنا", 'About Us': "نبذة عنا",
"Most Secure Methods": "أساليب الأمان الأكثر فاعلية", "Most Secure Methods": "أساليب الأمان الأكثر فاعلية",
"In-App VOIP Calls": "مكالمات VOIP داخل التطبيق", "In-App VOIP Calls": "مكالمات VOIP داخل التطبيق",

View File

@@ -13,497 +13,497 @@ import '../../../controller/home/map_passenger_controller.dart';
GetBuilder<MapPassengerController> buttomSheetMapPage() { GetBuilder<MapPassengerController> buttomSheetMapPage() {
Get.put(PaymentController()); Get.put(PaymentController());
return GetBuilder<MapPassengerController>( return GetBuilder<MapPassengerController>(
builder: (controller) => controller.isBottomSheetShown && builder: (controller) =>
controller.rideConfirm == false controller.isBottomSheetShown && controller.rideConfirm == false
? Positioned( ? const Positioned(
left: 5, left: 5,
bottom: 0, bottom: 0,
right: 5, right: 5,
child: Column( child: Column(
children: [ // children: [
Row( // Row(
mainAxisAlignment: MainAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.end,
children: [ // children: [
double.parse(box.read(BoxName.passengerWalletTotal)) < // double.parse(box.read(BoxName.passengerWalletTotal)) <
0 && // 0 &&
controller.data.isNotEmpty // controller.data.isNotEmpty
? Container( // ? Container(
decoration: AppStyle.boxDecoration.copyWith( // decoration: AppStyle.boxDecoration
color: AppColor.redColor.withOpacity(.5)), // .copyWith(color: AppColor.redColor),
height: 50, // height: 50,
width: Get.width * .94, // width: Get.width * .94,
child: Padding( // child: Padding(
padding: // padding:
const EdgeInsets.symmetric(horizontal: 8), // const EdgeInsets.symmetric(horizontal: 8),
child: Text( // child: Text(
'Your trip cost is'.tr + // 'Your trip cost is'.tr +
' ${controller.totalCostPassenger.toStringAsFixed(2)} ' // ' ${controller.totalCostPassenger.toStringAsFixed(2)} '
'But you have a negative salary of' // 'But you have a negative salary of'
.tr + // .tr +
'${double.parse(box.read(BoxName.passengerWalletTotal)).toStringAsFixed(2)}' // '${double.parse(box.read(BoxName.passengerWalletTotal)).toStringAsFixed(2)}'
' in your' // ' in your'
.tr + // .tr +
' ${AppInformation.appName}' // ' ${AppInformation.appName}'
' wallet due to a previous trip.' // ' wallet due to a previous trip.'
.tr, // .tr,
style: AppStyle.subtitle, // style: AppStyle.subtitle,
), // ),
)) // ))
: const SizedBox(), // : const SizedBox(),
], // ],
), // ),
const SizedBox( // const SizedBox(
height: 5, // height: 5,
), // ),
AnimatedContainer( // AnimatedContainer(
// clipBehavior: Clip.antiAliasWithSaveLayer, // // clipBehavior: Clip.antiAliasWithSaveLayer,
curve: Curves.easeInCirc, // curve: Curves.easeInCirc,
onEnd: () { // onEnd: () {
controller.height = 250; // controller.height = 250;
}, // },
height: controller.heightBottomSheetShown, // height: controller.heightBottomSheetShown,
duration: const Duration(seconds: 2), // duration: const Duration(seconds: 2),
child: Column( // child: Column(
children: [ // children: [
controller.data.isEmpty // controller.data.isEmpty
? const SizedBox() // ? const SizedBox()
: Container( // : Container(
// width: Get.width * .9, // // width: Get.width * .9,
height: 100, // height: 100,
decoration: BoxDecoration( // decoration: BoxDecoration(
color: AppColor.secondaryColor, // color: AppColor.secondaryColor,
boxShadow: [ // boxShadow: [
const BoxShadow( // const BoxShadow(
color: AppColor.accentColor, // color: AppColor.accentColor,
offset: Offset(2, 2)), // offset: Offset(2, 2)),
BoxShadow( // BoxShadow(
color: AppColor.accentColor // color: AppColor.accentColor
.withOpacity(.4), // .withOpacity(.4),
offset: const Offset(-2, -2)) // offset: const Offset(-2, -2))
], // ],
borderRadius: const BorderRadius.all( // borderRadius: const BorderRadius.all(
Radius.circular(15))), // Radius.circular(15))),
child: ListView.builder( // child: ListView.builder(
scrollDirection: Axis.horizontal, // scrollDirection: Axis.horizontal,
itemCount: controller // itemCount: controller
.dataCarsLocationByPassenger.length - // .dataCarsLocationByPassenger.length -
1, // 1,
itemBuilder: // itemBuilder:
(BuildContext context, int index) { // (BuildContext context, int index) {
return Container( // return Container(
color: controller.gender == 'Female' // color: controller.gender == 'Female'
? const Color.fromARGB( // ? const Color.fromARGB(
255, 246, 52, 181) // 255, 246, 52, 181)
: AppColor.secondaryColor, // : AppColor.secondaryColor,
width: Get.width, // width: Get.width,
child: Row( // child: Row(
mainAxisAlignment: // mainAxisAlignment:
MainAxisAlignment.spaceBetween, // MainAxisAlignment.spaceBetween,
children: [ // children: [
SizedBox( // SizedBox(
width: Get.width * .15, // width: Get.width * .15,
child: Padding( // child: Padding(
padding: // padding:
const EdgeInsets.all(8.0), // const EdgeInsets.all(8.0),
child: Image.asset( // child: Image.asset(
'assets/images/jeep.png', // 'assets/images/jeep.png',
width: 50, // width: 50,
fit: BoxFit.fill, // fit: BoxFit.fill,
repeat: ImageRepeat.repeatX, // repeat: ImageRepeat.repeatX,
), // ),
), // ),
), // ),
SizedBox( // SizedBox(
width: Get.width * .55, // width: Get.width * .55,
child: Column( // child: Column(
crossAxisAlignment: // crossAxisAlignment:
CrossAxisAlignment.start, // CrossAxisAlignment.start,
mainAxisAlignment: // mainAxisAlignment:
MainAxisAlignment.spaceEvenly, // MainAxisAlignment.spaceEvenly,
children: [ // children: [
Text( // Text(
controller.hours > 0 // controller.hours > 0
? '${'Your Ride Duration is '.tr}${controller.hours} ${'H and'.tr} ${controller.minutes} ${'m'.tr}' // ? '${'Your Ride Duration is '.tr}${controller.hours} ${'H and'.tr} ${controller.minutes} ${'m'.tr}'
: '${'Your Ride Duration is '.tr} ${controller.minutes} m', // : '${'Your Ride Duration is '.tr} ${controller.minutes} m',
style: AppStyle.subtitle, // style: AppStyle.subtitle,
), // ),
// Text( // // Text(
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}', // // '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
// style: AppStyle.subtitle, // // style: AppStyle.subtitle,
// ), // // ),
Text( // Text(
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} ${'KM'.tr}', // '${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} ${'KM'.tr}',
style: AppStyle.subtitle, // style: AppStyle.subtitle,
) // )
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
width: Get.width * .2, // width: Get.width * .2,
child: Padding( // child: Padding(
padding: const EdgeInsets.only( // padding: const EdgeInsets.only(
right: 5, left: 5), // right: 5, left: 5),
child: Column( // child: Column(
crossAxisAlignment: // crossAxisAlignment:
CrossAxisAlignment.center, // CrossAxisAlignment.center,
children: [ // children: [
Container( // Container(
width: Get.width * .14, // width: Get.width * .14,
height: Get.height * .06, // height: Get.height * .06,
decoration: BoxDecoration( // decoration: BoxDecoration(
color: AppColor // color: AppColor
.secondaryColor, // .secondaryColor,
shape: // shape:
BoxShape.rectangle, // BoxShape.rectangle,
border: Border.all( // border: Border.all(
width: 2, // width: 2,
color: AppColor // color: AppColor
.greenColor)), // .greenColor)),
child: Center( // child: Center(
child: Text( // child: Text(
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}', // '${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
style: // style:
AppStyle.subtitle, // AppStyle.subtitle,
), // ),
), // ),
), // ),
controller.promoTaken // controller.promoTaken
? const Icon( // ? const Icon(
Icons // Icons
.filter_vintage_rounded, // .filter_vintage_rounded,
color: // color:
AppColor.redColor, // AppColor.redColor,
) // )
: const SizedBox( // : const SizedBox(
height: 0, // height: 0,
) // )
], // ],
), // ),
), // ),
), // ),
], // ],
), // ),
); // );
}, // },
), // ),
), // ),
const SizedBox( // const SizedBox(
height: 5, // height: 5,
), // ),
Container( // Container(
// height: 130, // // height: 130,
decoration: BoxDecoration( // decoration: BoxDecoration(
color: AppColor.secondaryColor, // color: AppColor.secondaryColor,
boxShadow: [ // boxShadow: [
const BoxShadow( // const BoxShadow(
color: AppColor.accentColor, // color: AppColor.accentColor,
offset: Offset(2, 2)), // offset: Offset(2, 2)),
BoxShadow( // BoxShadow(
color: AppColor.accentColor.withOpacity(.4), // color: AppColor.accentColor.withOpacity(.4),
offset: const Offset(-2, -2)) // offset: const Offset(-2, -2))
], // ],
borderRadius: // borderRadius:
const BorderRadius.all(Radius.circular(15))), // const BorderRadius.all(Radius.circular(15))),
child: controller.data.isEmpty // child: controller.data.isEmpty
? const SizedBox() // ? const SizedBox()
: Center( // : Center(
child: Padding( // child: Padding(
padding: const EdgeInsets.symmetric( // padding: const EdgeInsets.symmetric(
horizontal: 5), // horizontal: 5),
child: Column( // child: Column(
children: [ // children: [
Row( // Row(
children: [ // children: [
const Icon( // const Icon(
Icons.location_on, // Icons.location_on,
color: AppColor.redColor, // color: AppColor.redColor,
), // ),
const SizedBox( // const SizedBox(
width: 10, // width: 10,
), // ),
Text( // Text(
'From : '.tr, // 'From : '.tr,
style: AppStyle.subtitle, // style: AppStyle.subtitle,
), // ),
Text( // Text(
controller.data[0] // controller.data[0]
['start_address'] // ['start_address']
.toString(), // .toString(),
style: AppStyle.subtitle, // style: AppStyle.subtitle,
) // )
], // ],
), // ),
Row( // Row(
children: [ // children: [
const Icon(Icons // const Icon(Icons
.location_searching_rounded), // .location_searching_rounded),
const SizedBox( // const SizedBox(
width: 10, // width: 10,
), // ),
Text( // Text(
'To : '.tr, // 'To : '.tr,
style: AppStyle.subtitle, // style: AppStyle.subtitle,
), // ),
Text( // Text(
controller.data[0]['end_address'], // controller.data[0]['end_address'],
style: AppStyle.subtitle, // style: AppStyle.subtitle,
), // ),
], // ],
), // ),
const Divider( // const Divider(
color: AppColor.accentColor, // color: AppColor.accentColor,
thickness: 1, // thickness: 1,
height: 2, // height: 2,
indent: 1, // indent: 1,
), // ),
SizedBox( // SizedBox(
height: 40, // height: 40,
child: Row( // child: Row(
mainAxisAlignment: // mainAxisAlignment:
MainAxisAlignment.center, // MainAxisAlignment.center,
children: [ // children: [
Container( // Container(
decoration: BoxDecoration( // decoration: BoxDecoration(
color: // color:
AppColor.secondaryColor, // AppColor.secondaryColor,
borderRadius: // borderRadius:
BorderRadius.circular(12), // BorderRadius.circular(12),
// border: Border.all(), // // border: Border.all(),
), // ),
child: Row( // child: Row(
children: [ // children: [
Icon( // Icon(
Icons.monetization_on, // Icons.monetization_on,
color: Colors.green[400], // color: Colors.green[400],
), // ),
InkWell( // InkWell(
onTap: () async { // onTap: () async {
controller // controller
.changeCashConfirmPageShown(); // .changeCashConfirmPageShown();
Get.find< // Get.find<
PaymentController>() // PaymentController>()
.getPassengerWallet(); // .getPassengerWallet();
}, // },
child: GetBuilder< // child: GetBuilder<
PaymentController>( // PaymentController>(
builder: (paymentController) => // builder: (paymentController) =>
paymentController // paymentController
.isCashChecked // .isCashChecked
? Text( // ? Text(
'CASH', // 'CASH',
style: AppStyle // style: AppStyle
.title, // .title,
) // )
: Text( // : Text(
'${AppInformation.appName} Wallet', // '${AppInformation.appName} Wallet',
style: AppStyle // style: AppStyle
.title, // .title,
), // ),
), // ),
), // ),
], // ],
), // ),
), // ),
const SizedBox( // const SizedBox(
width: 40, // width: 40,
), // ),
GetBuilder<PaymentController>( // GetBuilder<PaymentController>(
builder: // builder:
(paymentController) => // (paymentController) =>
Container( // Container(
decoration: // decoration:
BoxDecoration( // BoxDecoration(
color: AppColor // color: AppColor
.secondaryColor, // .secondaryColor,
borderRadius: // borderRadius:
BorderRadius // BorderRadius
.circular( // .circular(
12), // 12),
), // ),
child: Row( // child: Row(
children: [ // children: [
Icon( // Icon(
Icons // Icons
.qr_code_2_rounded, // .qr_code_2_rounded,
color: Colors // color: Colors
.green[ // .green[
400], // 400],
), // ),
InkWell( // InkWell(
onTap: () { // onTap: () {
if (controller // if (controller
.promoTaken == // .promoTaken ==
false) { // false) {
Get.defaultDialog( // Get.defaultDialog(
title: 'Add Promo'.tr, // title: 'Add Promo'.tr,
titleStyle: AppStyle.title, // titleStyle: AppStyle.title,
content: Column( // content: Column(
children: [ // children: [
SizedBox( // SizedBox(
width: Get.width * .7, // width: Get.width * .7,
child: TextFormField( // child: TextFormField(
controller: controller.promo, // controller: controller.promo,
decoration: InputDecoration( // decoration: InputDecoration(
labelText: 'Promo Code'.tr, // labelText: 'Promo Code'.tr,
hintText: 'Enter promo code'.tr, // hintText: 'Enter promo code'.tr,
labelStyle: AppStyle.subtitle, // labelStyle: AppStyle.subtitle,
hintStyle: AppStyle.subtitle, // hintStyle: AppStyle.subtitle,
border: OutlineInputBorder( // border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), // borderRadius: BorderRadius.circular(10),
), // ),
filled: true, // filled: true,
fillColor: Colors.grey[200], // fillColor: Colors.grey[200],
focusedBorder: OutlineInputBorder( // focusedBorder: OutlineInputBorder(
borderSide: const BorderSide( // borderSide: const BorderSide(
color: AppColor.primaryColor, // color: AppColor.primaryColor,
width: 2.0, // width: 2.0,
), // ),
borderRadius: BorderRadius.circular(10), // borderRadius: BorderRadius.circular(10),
), // ),
errorBorder: OutlineInputBorder( // errorBorder: OutlineInputBorder(
borderSide: const BorderSide( // borderSide: const BorderSide(
color: Colors.red, // color: Colors.red,
width: 2.0, // width: 2.0,
), // ),
borderRadius: BorderRadius.circular(10), // borderRadius: BorderRadius.circular(10),
), // ),
enabledBorder: OutlineInputBorder( // enabledBorder: OutlineInputBorder(
borderSide: const BorderSide( // borderSide: const BorderSide(
color: Colors.grey, // color: Colors.grey,
width: 1.0, // width: 1.0,
), // ),
borderRadius: BorderRadius.circular(10), // borderRadius: BorderRadius.circular(10),
), // ),
), // ),
), // ),
), // ),
MyElevatedButton( // MyElevatedButton(
title: 'Add Promo'.tr, // title: 'Add Promo'.tr,
onPressed: () async { // onPressed: () async {
controller.applyPromoCodeToPassenger(); // controller.applyPromoCodeToPassenger();
}, // },
) // )
], // ],
)); // ));
} else { // } else {
Get.snackbar( // Get.snackbar(
'You have promo!' // 'You have promo!'
.tr, // .tr,
'', // '',
backgroundColor: // backgroundColor:
AppColor.redColor); // AppColor.redColor);
} // }
}, // },
child: Text( // child: Text(
'Add Promo' // 'Add Promo'
.tr, // .tr,
style: AppStyle // style: AppStyle
.title, // .title,
), // ),
), // ),
], // ],
), // ),
)), // )),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
width: Get.width * .95, // width: Get.width * .95,
child: Row( // child: Row(
mainAxisAlignment: // mainAxisAlignment:
MainAxisAlignment.center, // MainAxisAlignment.center,
children: [ // children: [
controller.isCashSelectedBeforeConfirmRide == // controller.isCashSelectedBeforeConfirmRide ==
false // false
? MyElevatedButton( // ? MyElevatedButton(
title: 'Next'.tr, // title: 'Next'.tr,
onPressed: () { // onPressed: () {
controller // controller
.changeCashConfirmPageShown(); // .changeCashConfirmPageShown();
}, // },
) // )
: // :
// controller.isPassengerChosen == // // controller.isPassengerChosen ==
// false // // false
// ? MyElevatedButton( // // ? MyElevatedButton(
// title: 'Next'.tr, // // title: 'Next'.tr,
// onPressed: () { // // onPressed: () {
// controller // // controller
// .onChangedPassengersChoose(); // // .onChangedPassengersChoose();
// Get.defaultDialog( // // Get.defaultDialog(
// barrierDismissible: // // barrierDismissible:
// false, // // false,
// title: // // title:
// 'How Many Passengers?' // // 'How Many Passengers?'
// .tr, // // .tr,
// titleStyle: // // titleStyle:
// AppStyle // // AppStyle
// .title, // // .title,
// content: // // content:
// Column( // // Column(
// children: [ // // children: [
// Text( // // Text(
// 'Allowed up to 4 Passengers.' // // 'Allowed up to 4 Passengers.'
// .tr, // // .tr,
// style: AppStyle // // style: AppStyle
// .title, // // .title,
// ), // // ),
// SizedBox( // // SizedBox(
// height: // // height:
// 200, // Set the desired height here // // 200, // Set the desired height here
// child: // // child:
// CupertinoPicker( // // CupertinoPicker(
// itemExtent: // // itemExtent:
// 32, // // 32,
// onSelectedItemChanged: // // onSelectedItemChanged:
// (index) { // // (index) {
// controller.onChangedPassengerCount(index + // // controller.onChangedPassengerCount(index +
// 1); // // 1);
// }, // // },
// children: [ // // children: [
// Text('1 Passenger'.tr), // // Text('1 Passenger'.tr),
// Text('2 Passengers'.tr), // // Text('2 Passengers'.tr),
// Text('3 Passengers'.tr), // // Text('3 Passengers'.tr),
// Text('4 Passengers'.tr), // // Text('4 Passengers'.tr),
// ], // // ],
// ), // // ),
// ), // // ),
// MyElevatedButton( // // MyElevatedButton(
// title: // // title:
// 'Back', // // 'Back',
// onPressed: // // onPressed:
// () => // // () =>
// Get.back(), // // Get.back(),
// ) // // )
// ], // // ],
// ), // // ),
// ); // // );
// }, // // },
// ) // // )
// : // // :
MyElevatedButton( // MyElevatedButton(
title: 'Confirm Selection' // title: 'Confirm Selection'
.tr, // .tr,
onPressed: () { // onPressed: () {
controller // controller
.confirmRideForFirstDriver(); // .confirmRideForFirstDriver();
}, // },
), // ),
], // ],
), // ),
) // )
], // ],
), // ),
), // ),
), // ),
), // ),
], // ],
), // ),
), // ),
], // ],
), ),
) )
: const SizedBox()); : const SizedBox());
} }
class Details extends StatelessWidget { class Details extends StatelessWidget {

View File

@@ -465,7 +465,7 @@ class BurcMoney extends StatelessWidget {
if (passengerWallet < 0.0) // Use if statement for clarity if (passengerWallet < 0.0) // Use if statement for clarity
Container( Container(
decoration: AppStyle.boxDecoration.copyWith( decoration: AppStyle.boxDecoration.copyWith(
color: AppColor.redColor.withOpacity(.5), color: AppColor.redColor.withOpacity(.3),
), ),
height: 50, height: 50,
width: Get.width, width: Get.width,

View File

@@ -279,9 +279,10 @@ class RideBeginPassenger extends StatelessWidget {
.toString(); .toString();
// phoneNumber = phoneNumber.replaceAll('0', ''); // phoneNumber = phoneNumber.replaceAll('0', '');
print(phoneNumber); // Output: 798583061 print(phoneNumber); // Output: 798583061
var phone = var phone = box.read(BoxName.countryCode) ==
// '+${box.read(BoxName.countryCode)}${box.read(BoxName.sosPhonePassenger)}'; 'Egypt'
'${box.read(BoxName.sosPhonePassenger)}'; ? '+2${box.read(BoxName.sosPhonePassenger)}'
: '+962${box.read(BoxName.sosPhonePassenger)}';
controller.sendWhatsapp(phone); controller.sendWhatsapp(phone);
} }
}, },

View File

@@ -102,7 +102,7 @@ class TimerToPassengerFromDriver extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Text( Text(
'The driver waitting you in picked location .'.tr, 'The driver waiting you in picked location .'.tr,
style: AppStyle.title, style: AppStyle.title,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),