2/14/1
This commit is contained in:
@@ -33,7 +33,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColor.greenColor,
|
||||
elevation: 0,
|
||||
title: Text('Captain Home'.tr),
|
||||
title: Text('Home'.tr),
|
||||
actions: [
|
||||
GetBuilder<LocationController>(
|
||||
builder: (locationController) => locationController.isLoading
|
||||
@@ -58,7 +58,19 @@ class HomeCaptain extends StatelessWidget {
|
||||
child: Text(
|
||||
orderRequestController.countRefuse.toString(),
|
||||
style: AppStyle.title,
|
||||
)))
|
||||
))),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
// NotificationController()
|
||||
// .showNotification('Order', 'hi this is', 'tone2');
|
||||
// Get.to(() => CallPage(callID: '111'));
|
||||
// MapDriverController().getDriverScam();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.call,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
drawer: DrawerCaptain(),
|
||||
|
||||
@@ -98,7 +98,11 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
controller.isSocialPressed = true;
|
||||
await controller
|
||||
.driverCallPassenger();
|
||||
|
||||
launchCommunication('phone',
|
||||
controller.phone.toString(), '');
|
||||
},
|
||||
@@ -107,22 +111,30 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
color: AppColor.blueColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
controller.isSocialPressed = true;
|
||||
await controller
|
||||
.driverCallPassenger();
|
||||
|
||||
launchCommunication(
|
||||
'whatsapp',
|
||||
controller.phone.toString(),
|
||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
'${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome.whatsapp,
|
||||
color: AppColor.greenColor,
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
controller.isSocialPressed = true;
|
||||
await controller
|
||||
.driverCallPassenger();
|
||||
|
||||
launchCommunication(
|
||||
'sms',
|
||||
controller.phone.toString(),
|
||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
'${'Hello this is Driver'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.sms_rounded,
|
||||
@@ -130,6 +142,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
)),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller.isSocialPressed = true;
|
||||
launchCommunication(
|
||||
'email',
|
||||
controller.phone.toString(),
|
||||
@@ -203,20 +216,25 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
? MyElevatedButton(
|
||||
title: 'I arrive you'.tr,
|
||||
kolor: AppColor.yellowColor,
|
||||
onPressed: () {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Hi ,I Arrive your site'
|
||||
.tr,
|
||||
'I Arrive your site'
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
[]);
|
||||
controller
|
||||
.startTimerToShowDriverWaitPassengerDuration();
|
||||
controller.isArrivedSend =
|
||||
false;
|
||||
onPressed: () async {
|
||||
if (controller
|
||||
.calculateDistanseBetweenDriverAndPassengerLocation() <
|
||||
40) {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Hi ,I Arrive your site'
|
||||
.tr,
|
||||
'I Arrive your site'
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
[]);
|
||||
controller
|
||||
.startTimerToShowDriverWaitPassengerDuration();
|
||||
controller
|
||||
.isArrivedSend =
|
||||
false;
|
||||
}
|
||||
})
|
||||
: const SizedBox()
|
||||
],
|
||||
@@ -259,21 +277,31 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
.tr,
|
||||
kolor: AppColor
|
||||
.deepPurpleAccent,
|
||||
onPressed: () async {
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Driver Cancel Your Trip'
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
title:
|
||||
'Are you sure to cancel?'
|
||||
.tr,
|
||||
'You will be pay the cost to driver or we will get it from you on next trip'
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
[]);
|
||||
await controller
|
||||
.addWaittingTimeCostFromPassengerToDriverWallet();
|
||||
controller
|
||||
.isdriverWaitTimeEnd =
|
||||
false;
|
||||
confirm:
|
||||
MyElevatedButton(
|
||||
title:
|
||||
'Yes'.tr,
|
||||
onPressed:
|
||||
() async {
|
||||
FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||
'Driver Cancel Your Trip'
|
||||
.tr,
|
||||
'You will be pay the cost to driver or we will get it from you on next trip'
|
||||
.tr,
|
||||
controller
|
||||
.tokenPassenger,
|
||||
[]);
|
||||
await controller
|
||||
.addWaittingTimeCostFromPassengerToDriverWallet();
|
||||
controller
|
||||
.isdriverWaitTimeEnd =
|
||||
false;
|
||||
}));
|
||||
})
|
||||
: const SizedBox(),
|
||||
],
|
||||
|
||||
25
lib/views/home/Captin/orderCaptin/call.dart
Normal file
25
lib/views/home/Captin/orderCaptin/call.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:ride/constant/api_key.dart';
|
||||
// import 'package:ride/constant/box_name.dart';
|
||||
// import 'package:ride/main.dart';
|
||||
// import 'package:zego_uikit_prebuilt_call/zego_uikit_prebuilt_call.dart';
|
||||
|
||||
// class CallPage extends StatelessWidget {
|
||||
// const CallPage({Key? key, required this.callID}) : super(key: key);
|
||||
// final String callID;
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return ZegoUIKitPrebuiltCall(
|
||||
// appID: AK
|
||||
// .zegoCloudAppID, // Fill in the appID that you get from ZEGOCLOUD Admin Console.
|
||||
// appSign: AK
|
||||
// .zegoCloudAppSIGN, // Fill in the appSign that you get from ZEGOCLOUD Admin Console.
|
||||
// userID: box.read(BoxName.passengerID) ?? box.read(BoxName.driverID),
|
||||
// userName: box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
|
||||
// callID: callID,
|
||||
// // You can also use groupVideo/groupVoice/oneOnOneVoice to make more types of calls.
|
||||
// config: ZegoUIKitPrebuiltCallConfig.oneOnOneVoiceCall(),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@@ -223,6 +223,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
'passengerLocation': myList[0].toString(),
|
||||
'passengerDestination': myList[1].toString(),
|
||||
'Duration': myList[4].toString(),
|
||||
'totalCost': myList[2].toString(),
|
||||
'Distance': myList[5].toString(),
|
||||
'name': myList[8].toString(),
|
||||
'phone': myList[10].toString(),
|
||||
@@ -276,8 +277,6 @@ class OrderRequestPage extends StatelessWidget {
|
||||
box.read(BoxName.nameDriver).toString(),
|
||||
box.read(BoxName.tokenDriver).toString(),
|
||||
];
|
||||
orderRequestController.refuseOrder(
|
||||
myList[16].toString(), body.toString());
|
||||
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
@@ -287,6 +286,8 @@ class OrderRequestPage extends StatelessWidget {
|
||||
// box.read(BoxName.tokenDriver).toString(),
|
||||
bodyToPassenger,
|
||||
);
|
||||
orderRequestController.refuseOrder(
|
||||
myList[16].toString(), body.toString());
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
),
|
||||
|
||||
@@ -2,8 +2,10 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/info.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
@@ -13,431 +15,476 @@ import '../../../controller/home/map_passenger_controller.dart';
|
||||
GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
Get.put(PaymentController());
|
||||
return GetBuilder<MapPassengerController>(
|
||||
builder: (controller) => controller.isBottomSheetShown &&
|
||||
controller.rideConfirm == false
|
||||
? Positioned(
|
||||
left: 5,
|
||||
bottom: 0,
|
||||
right: 5,
|
||||
child: AnimatedContainer(
|
||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
curve: Curves.easeInCirc,
|
||||
onEnd: () {
|
||||
controller.height = 250;
|
||||
},
|
||||
height: controller.heightBottomSheetShown,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Column(
|
||||
children: [
|
||||
controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Container(
|
||||
// width: Get.width * .9,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color:
|
||||
AppColor.accentColor.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .15,
|
||||
builder: (controller) =>
|
||||
controller.isBottomSheetShown && controller.rideConfirm == false
|
||||
? Positioned(
|
||||
left: 5,
|
||||
bottom: 0,
|
||||
right: 5,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
double.parse(box.read(BoxName.passengerWalletTotal)) <
|
||||
0 &&
|
||||
controller.data.isNotEmpty
|
||||
? Container(
|
||||
decoration: AppStyle.boxDecoration.copyWith(
|
||||
color: AppColor.redColor.withOpacity(.5)),
|
||||
height: 50,
|
||||
width: Get.width * .94,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/jeep.png',
|
||||
width: 50,
|
||||
fit: BoxFit.fill,
|
||||
repeat: ImageRepeat.repeatX,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8),
|
||||
child: Text(
|
||||
'Your trip cost is'.tr +
|
||||
' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||
'But you have a negative salary of'
|
||||
.tr +
|
||||
'${double.parse(box.read(BoxName.passengerWalletTotal)).toStringAsFixed(2)}'
|
||||
' in your'
|
||||
.tr +
|
||||
' ${AppInformation.appName}'
|
||||
' wallet due to a previous trip.'
|
||||
.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .55,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
controller.hours > 1
|
||||
? '${'Your Ride Duration is '.tr}${controller.hours} H and ${controller.minutes} m'
|
||||
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
// Text(
|
||||
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
Text(
|
||||
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 5, left: 5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
))
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
AnimatedContainer(
|
||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
curve: Curves.easeInCirc,
|
||||
onEnd: () {
|
||||
controller.height = 250;
|
||||
},
|
||||
height: controller.heightBottomSheetShown,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Column(
|
||||
children: [
|
||||
controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Container(
|
||||
// width: Get.width * .9,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor
|
||||
.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width * .14,
|
||||
height: Get.height * .06,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: AppColor.greenColor)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||
style: AppStyle.subtitle,
|
||||
SizedBox(
|
||||
width: Get.width * .15,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/jeep.png',
|
||||
width: 50,
|
||||
fit: BoxFit.fill,
|
||||
repeat: ImageRepeat.repeatX,
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.promoTaken
|
||||
? const Icon(
|
||||
Icons.filter_vintage_rounded,
|
||||
color: AppColor.redColor,
|
||||
SizedBox(
|
||||
width: Get.width * .55,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
controller.hours > 1
|
||||
? '${'Your Ride Duration is '.tr}${controller.hours} H and ${controller.minutes} m'
|
||||
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
// Text(
|
||||
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
Text(
|
||||
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
: const SizedBox(
|
||||
height: 0,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Container(
|
||||
// height: 130,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(15))),
|
||||
child: controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Center(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.location_on,
|
||||
color: AppColor.redColor,
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'From : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]['start_address']
|
||||
.toString(),
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.location_searching_rounded),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'To : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]['end_address'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: AppColor.accentColor,
|
||||
thickness: 1,
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(12),
|
||||
// border: Border.all(),
|
||||
),
|
||||
child: Row(
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 5, left: 5),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.monetization_on,
|
||||
color: Colors.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
Get.find<
|
||||
PaymentController>()
|
||||
.getPassengerWallet();
|
||||
},
|
||||
child: GetBuilder<
|
||||
PaymentController>(
|
||||
builder:
|
||||
(paymentController) =>
|
||||
paymentController
|
||||
.isCashChecked
|
||||
? Text(
|
||||
'CASH',
|
||||
style: AppStyle
|
||||
.title,
|
||||
)
|
||||
: Text(
|
||||
'${AppInformation.appName} Wallet',
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
Container(
|
||||
width: Get.width * .14,
|
||||
height: Get.height * .06,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: AppColor
|
||||
.greenColor)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.promoTaken
|
||||
? const Icon(
|
||||
Icons
|
||||
.filter_vintage_rounded,
|
||||
color:
|
||||
AppColor.redColor,
|
||||
)
|
||||
: const SizedBox(
|
||||
height: 0,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
GetBuilder<PaymentController>(
|
||||
builder:
|
||||
(paymentController) =>
|
||||
Container(
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons
|
||||
.qr_code_2_rounded,
|
||||
color: Colors
|
||||
.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (controller
|
||||
.promoTaken ==
|
||||
false) {
|
||||
Get.defaultDialog(
|
||||
title: 'Add Promo'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width:
|
||||
Get.width * .7,
|
||||
child:
|
||||
TextFormField(
|
||||
controller: controller.promo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Promo Code'.tr,
|
||||
hintText: 'Enter promo code'.tr,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[200],
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title:
|
||||
'Add Promo'.tr,
|
||||
onPressed:
|
||||
() async {
|
||||
controller.applyPromoCodeToPassenger();
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'You have promo!'
|
||||
.tr,
|
||||
'',
|
||||
backgroundColor:
|
||||
AppColor
|
||||
.redColor);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Add Promo'.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .95,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
controller.isCashSelectedBeforeConfirmRide ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
},
|
||||
),
|
||||
],
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Container(
|
||||
// height: 130,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(2, 2)),
|
||||
BoxShadow(
|
||||
color: AppColor.accentColor
|
||||
.withOpacity(.4),
|
||||
offset: const Offset(-2, -2))
|
||||
],
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(15))),
|
||||
child: controller.data.isEmpty
|
||||
? const SizedBox()
|
||||
: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.location_on,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'From : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]
|
||||
['start_address']
|
||||
.toString(),
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
: controller.isPassengerChosen ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.onChangedPassengersChoose();
|
||||
Get.defaultDialog(
|
||||
barrierDismissible:
|
||||
false,
|
||||
title:
|
||||
'How Many Passengers?'
|
||||
.tr,
|
||||
titleStyle:
|
||||
AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
Text(
|
||||
'Allowed up to 4 Passengers.'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
200, // Set the desired height here
|
||||
child:
|
||||
CupertinoPicker(
|
||||
itemExtent:
|
||||
32,
|
||||
onSelectedItemChanged:
|
||||
(index) {
|
||||
controller.onChangedPassengerCount(
|
||||
index +
|
||||
1);
|
||||
},
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons
|
||||
.location_searching_rounded),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
'To : '.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
controller.data[0]
|
||||
['end_address'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: AppColor.accentColor,
|
||||
thickness: 1,
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
12),
|
||||
// border: Border.all(),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.monetization_on,
|
||||
color:
|
||||
Colors.green[400],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
Get.find<
|
||||
PaymentController>()
|
||||
.getPassengerWallet();
|
||||
},
|
||||
child: GetBuilder<
|
||||
PaymentController>(
|
||||
builder: (paymentController) =>
|
||||
paymentController
|
||||
.isCashChecked
|
||||
? Text(
|
||||
'CASH',
|
||||
style: AppStyle
|
||||
.title,
|
||||
)
|
||||
: Text(
|
||||
'${AppInformation.appName} Wallet',
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 40,
|
||||
),
|
||||
GetBuilder<PaymentController>(
|
||||
builder:
|
||||
(paymentController) =>
|
||||
Container(
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
color: AppColor
|
||||
.secondaryColor,
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
12),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Text('1 Passenger'
|
||||
.tr),
|
||||
Text('2 Passengers'
|
||||
.tr),
|
||||
Text('3 Passengers'
|
||||
.tr),
|
||||
Text('4 Passengers'
|
||||
.tr),
|
||||
Icon(
|
||||
Icons
|
||||
.qr_code_2_rounded,
|
||||
color: Colors
|
||||
.green[
|
||||
400],
|
||||
),
|
||||
InkWell(
|
||||
onTap:
|
||||
() {
|
||||
if (controller.promoTaken ==
|
||||
false) {
|
||||
Get.defaultDialog(
|
||||
title: 'Add Promo'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .7,
|
||||
child: TextFormField(
|
||||
controller: controller.promo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Promo Code'.tr,
|
||||
hintText: 'Enter promo code'.tr,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[200],
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.red,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Colors.grey,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Add Promo'.tr,
|
||||
onPressed: () async {
|
||||
controller.applyPromoCodeToPassenger();
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'You have promo!'.tr,
|
||||
'',
|
||||
backgroundColor: AppColor.redColor);
|
||||
}
|
||||
},
|
||||
child:
|
||||
Text(
|
||||
'Add Promo'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Back',
|
||||
onPressed: () =>
|
||||
Get.back(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
: MyElevatedButton(
|
||||
title: 'Confirm Selection'
|
||||
.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeConfirmRide();
|
||||
},
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .95,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
controller.isCashSelectedBeforeConfirmRide ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeCashConfirmPageShown();
|
||||
},
|
||||
)
|
||||
: controller.isPassengerChosen ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.onChangedPassengersChoose();
|
||||
Get.defaultDialog(
|
||||
barrierDismissible:
|
||||
false,
|
||||
title:
|
||||
'How Many Passengers?'
|
||||
.tr,
|
||||
titleStyle:
|
||||
AppStyle
|
||||
.title,
|
||||
content:
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'Allowed up to 4 Passengers.'
|
||||
.tr,
|
||||
style: AppStyle
|
||||
.title,
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
200, // Set the desired height here
|
||||
child:
|
||||
CupertinoPicker(
|
||||
itemExtent:
|
||||
32,
|
||||
onSelectedItemChanged:
|
||||
(index) {
|
||||
controller.onChangedPassengerCount(index +
|
||||
1);
|
||||
},
|
||||
children: [
|
||||
Text('1 Passenger'.tr),
|
||||
Text('2 Passengers'.tr),
|
||||
Text('3 Passengers'.tr),
|
||||
Text('4 Passengers'.tr),
|
||||
],
|
||||
),
|
||||
),
|
||||
MyElevatedButton(
|
||||
title:
|
||||
'Back',
|
||||
onPressed:
|
||||
() =>
|
||||
Get.back(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
: MyElevatedButton(
|
||||
title:
|
||||
'Confirm Selection'
|
||||
.tr,
|
||||
onPressed: () {
|
||||
controller
|
||||
.changeConfirmRide();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox());
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox());
|
||||
}
|
||||
|
||||
class Details extends StatelessWidget {
|
||||
@@ -467,7 +514,7 @@ class Details extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'Cost for .21/km ${controller.cost.toStringAsFixed(2)} ',
|
||||
'Cost for .21/km ${controller.costDistance.toStringAsFixed(2)} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -157,6 +157,8 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
title: 'Next as Cash \$\$!'.tr,
|
||||
onPressed: () {
|
||||
paymentController.isCashChecked = true;
|
||||
paymentController.isWalletChecked = false;
|
||||
paymentController.update();
|
||||
controller.changeCashConfirmPageShown();
|
||||
},
|
||||
),
|
||||
|
||||
@@ -7,8 +7,10 @@ import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/main.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/firebase/local_notification.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../Captin/orderCaptin/call.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
@@ -99,6 +101,26 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
),
|
||||
),
|
||||
),
|
||||
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(() => CallPage(callID: '111'));
|
||||
// Get.to(() => CallPage(callID: controller.rideId));
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.call,
|
||||
size: 29,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
);
|
||||
|
||||
@@ -34,7 +34,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'You will arrive to your destination after '.tr,
|
||||
'You will arrive to your destination after timer end.'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Stack(
|
||||
@@ -45,7 +45,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
color: controller.remainingTimeTimerRideBegin < 60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 50,
|
||||
minHeight: 45,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: controller.progressTimerRideBegin.toDouble(),
|
||||
),
|
||||
@@ -61,45 +61,52 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
if (box.read(BoxName.sosPhonePassenger).toString() ==
|
||||
'') {
|
||||
Get.defaultDialog(
|
||||
title: 'You dont Add Emergency Phone Yet!'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
Form(
|
||||
key: controller.sosFormKey,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType
|
||||
.phone, // Set the keyboard type to phone
|
||||
validator: (value) {
|
||||
if (value!.isEmpty ||
|
||||
value.length != 10) {
|
||||
return 'Please enter a valid phone number'
|
||||
.tr;
|
||||
}
|
||||
// Add additional validation if needed
|
||||
return null;
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Type here',
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Add Phone'.tr,
|
||||
onPressed: () async {
|
||||
await profileController
|
||||
.updatField('sosPhone');
|
||||
box.write(
|
||||
BoxName.sosPhonePassenger,
|
||||
profileController
|
||||
.prfoileData['sosPhone']);
|
||||
}));
|
||||
onPressed: () async {
|
||||
if (box.read(BoxName.sosPhonePassenger) == null) {
|
||||
{
|
||||
await profileController.updatField(
|
||||
'sosPhone', TextInputType.phone);
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
profileController.prfoileData['sosPhone']);
|
||||
}
|
||||
// Get.defaultDialog(
|
||||
// title: 'You dont Add Emergency Phone Yet!'.tr,
|
||||
// content: Column(
|
||||
// children: [
|
||||
// Form(
|
||||
// key: controller.sosFormKey,
|
||||
// child: TextFormField(
|
||||
// keyboardType: TextInputType
|
||||
// .phone, // Set the keyboard type to phone
|
||||
// controller:
|
||||
// controller.sosPhonePassengerProfile,
|
||||
// validator: (value) {
|
||||
// if (value!.isEmpty ||
|
||||
// value.length != 10) {
|
||||
// return 'Please enter a valid phone number'
|
||||
// .tr;
|
||||
// }
|
||||
// // Add additional validation if needed
|
||||
// return null;
|
||||
// },
|
||||
// decoration: const InputDecoration(
|
||||
// border: OutlineInputBorder(),
|
||||
// hintText: 'Type here',
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// confirm: MyElevatedButton(
|
||||
// title: 'Add Phone'.tr,
|
||||
// onPressed: () async {
|
||||
// await profileController
|
||||
// .updatField('sosPhone');
|
||||
// box.write(
|
||||
// BoxName.sosPhonePassenger,
|
||||
// profileController
|
||||
// .prfoileData['sosPhone']);
|
||||
// }));
|
||||
} else {
|
||||
controller
|
||||
.sendSMS(box.read(BoxName.sosPhonePassenger));
|
||||
@@ -111,48 +118,24 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
if (box.read(BoxName.sosPhonePassenger).toString() ==
|
||||
'') {
|
||||
Get.defaultDialog(
|
||||
title: 'You dont Add Emergency Phone Yet!'.tr,
|
||||
content: Column(
|
||||
children: [
|
||||
Form(
|
||||
key: controller.sosFormKey,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType
|
||||
.phone, // Set the keyboard type to phone
|
||||
validator: (value) {
|
||||
if (value!.isEmpty ||
|
||||
value.length < 10) {
|
||||
return 'Please enter a phone number'
|
||||
.tr;
|
||||
}
|
||||
// Add additional validation if needed
|
||||
return null;
|
||||
},
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Type here',
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Add Phone'.tr,
|
||||
onPressed: () async {
|
||||
await profileController
|
||||
.updatField('sosPhone');
|
||||
box.write(
|
||||
BoxName.sosPhonePassenger,
|
||||
profileController
|
||||
.prfoileData['sosPhone']);
|
||||
}));
|
||||
onPressed: () async {
|
||||
print(box.read(BoxName.sosPhonePassenger));
|
||||
if (box.read(BoxName.sosPhonePassenger) == null ||
|
||||
box.read(BoxName.sosPhonePassenger) == 'sos') {
|
||||
{
|
||||
await profileController.updatField(
|
||||
'sosPhone', TextInputType.phone);
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
profileController.prfoileData['sosPhone']);
|
||||
}
|
||||
} else {
|
||||
controller.sendWhatsapp(
|
||||
box.read(BoxName.sosPhonePassenger).toString());
|
||||
String phoneNumber =
|
||||
box.read(BoxName.sosPhonePassenger).toString();
|
||||
phoneNumber = phoneNumber.replaceAll('0', '');
|
||||
print(phoneNumber); // Output: 798583061
|
||||
var phone =
|
||||
'+962${box.read(BoxName.sosPhonePassenger)}';
|
||||
controller.sendWhatsapp(phone);
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
|
||||
@@ -55,7 +55,8 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
subtitle: Text(
|
||||
'${controller.prfoileData['first_name']} ${controller.prfoileData['last_name']}'),
|
||||
onTap: () {
|
||||
controller.updatField('first_name');
|
||||
controller.updatField(
|
||||
'first_name', TextInputType.name);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
@@ -144,7 +145,8 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
.prfoileData['employmentType']
|
||||
.toString()),
|
||||
onTap: () {
|
||||
controller.updatField('employmentType');
|
||||
controller.updatField(
|
||||
'employmentType', TextInputType.name);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
@@ -161,7 +163,8 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
.prfoileData['maritalStatus']
|
||||
.toString()),
|
||||
onTap: () {
|
||||
controller.updatField('maritalStatus');
|
||||
controller.updatField(
|
||||
'maritalStatus', TextInputType.name);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
@@ -178,7 +181,8 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
subtitle: Text(controller.prfoileData['sosPhone']
|
||||
.toString()),
|
||||
onTap: () async {
|
||||
await controller.updatField('sosPhone');
|
||||
await controller.updatField(
|
||||
'sosPhone', TextInputType.phone);
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
controller.prfoileData['sosPhone']);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user