This commit is contained in:
Hamza-Ayed
2024-02-14 22:31:28 +03:00
parent bbd4ce792e
commit ea7a5bb931
28 changed files with 941 additions and 605 deletions

View File

@@ -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(