This commit is contained in:
Hamza-Ayed
2024-05-02 12:07:38 +03:00
parent 8684223b6a
commit 9d3c522038
14 changed files with 601 additions and 460 deletions

View File

@@ -19,10 +19,10 @@ GetBuilder<MapPassengerController> cancelRidePage() {
return GetBuilder<MapPassengerController>(
builder: (controller) => controller.isCancelRidePageShown
? Positioned(
left: 60,
top: 40,
right: 60,
// bottom: 100,
left: Get.width * .1,
top: Get.width * .2,
right: Get.width * .1,
bottom: Get.width * .15,
child: Container(
decoration: BoxDecoration(
color: AppColor.secondaryColor,

View File

@@ -219,10 +219,11 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.passengerLocation = controller.newMyLocation;
controller.myDestination = LatLng(
double.parse(
res['geometry']['location']['lat'].toString()),
double.parse(
res['geometry']['location']['lng'].toString()));
double.parse(
res['geometry']['location']['lat'].toString()),
double.parse(
res['geometry']['location']['lng'].toString()),
);
controller.convertHintTextDestinationNewPlaces(index);
controller.placesDestination = [];

View File

@@ -12,7 +12,6 @@ import '../../../constant/colors.dart';
import '../../../constant/table_names.dart';
import '../../../controller/functions/toast.dart';
import '../../../controller/functions/tts.dart';
import 'form_search_start.dart';
class MainBottomMenuMap extends StatelessWidget {
const MainBottomMenuMap({super.key});
@@ -103,26 +102,26 @@ class MainBottomMenuMap extends StatelessWidget {
const SizedBox(
height: 10,
),
MyElevatedButton(
title: 'Get Details of Trip'.tr,
onPressed: () async {
controller.changeMainBottomMenuMap();
await controller.getMap(
'${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
'${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
);
controller.currentLocationToFormPlaces =
false;
controller.placesDestination = [];
// controller.isCancelRidePageShown = true;
controller.clearPlacesStart();
controller.clearPlacesDestination();
controller.showBottomSheet1();
Get.back();
controller.showBottomSheet1();
}),
// MyElevatedButton(
// title: 'Get Details of Trip'.tr,
// onPressed: () async {
// controller.changeMainBottomMenuMap();
//
// await controller.getMap(
// '${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
// '${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
// );
// controller.currentLocationToFormPlaces =
// false;
// controller.placesDestination = [];
// // controller.isCancelRidePageShown = true;
// controller.clearPlacesStart();
// controller.clearPlacesDestination();
//
// controller.showBottomSheet1();
// Get.back();
// controller.showBottomSheet1();
// }),
TextButton(
onPressed: () {
controller.changeMainBottomMenuMap();
@@ -303,7 +302,8 @@ class MainBottomMenuMap extends StatelessWidget {
),
Text(
controller.passengerStartLocationFromMap
? 'Pick your ride location on the map - Tap to confirm'.tr
? 'Pick or Tap to confirm'.tr
// ? 'Pick your ride location on the map - Tap to confirm'.tr
: "Click here point".tr,
style: AppStyle.title,
),
@@ -346,15 +346,16 @@ class MainBottomMenuMap extends StatelessWidget {
borderRadius: BorderRadius.circular(12),
color: AppColor.redColor,
),
child: Padding(
padding: const EdgeInsets.all(6),
child: Text(
'No Car in your site. Sorry!'.tr,
style: AppStyle.title
.copyWith(color: AppColor.secondaryColor),
),
child: null
// Padding(
// padding: const EdgeInsets.all(6),
// child: Text(
// 'No Car in your site. Sorry!'.tr,
// style: AppStyle.title
// .copyWith(color: AppColor.secondaryColor),
// ),
// ),
),
),
controller.noCarString == false
? Container(
decoration: BoxDecoration(

View File

@@ -188,56 +188,59 @@ class PassengerProfilePage extends StatelessWidget {
},
),
// const Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
title: 'Sign Out'.tr,
onPressed: () {
LogOutController().logOutPassenger();
}),
GetBuilder<LogOutController>(
builder: (logOutController) {
return MyElevatedButton(
title: 'Delete My Account'.tr,
onPressed: () {
Get.defaultDialog(
title:
'Are you sure to delete your account?'
.tr,
content: Form(
key: logOutController.formKey1,
child: MyTextForm(
controller: logOutController
.emailTextController,
label: 'Type your Email'.tr,
hint: 'Type your Email'.tr,
type:
TextInputType.emailAddress,
),
),
confirm: MyElevatedButton(
title: 'Delete My Account'.tr,
kolor: AppColor.redColor,
onPressed: () async {
await logOutController
.deletePassengerAccount();
}),
cancel: MyElevatedButton(
title: 'No I want'.tr,
onPressed: () {
logOutController
.emailTextController
.clear();
logOutController.update();
Get.back();
}));
});
}),
],
),
],
),
),
),
)),
Positioned(
left: 70,
bottom: 100,
right: 70,
child: MyElevatedButton(
title: 'Sign Out'.tr,
onPressed: () {
LogOutController().logOutPassenger();
}),
),
Positioned(
left: 70,
bottom: 10,
right: 70,
child: GetBuilder<LogOutController>(builder: (logOutController) {
return MyElevatedButton(
title: 'Delete My Account'.tr,
onPressed: () {
Get.defaultDialog(
title: 'Are you sure to delete your account?'.tr,
content: Form(
key: logOutController.formKey1,
child: MyTextForm(
controller: logOutController.emailTextController,
label: 'Type your Email'.tr,
hint: 'Type your Email'.tr,
type: TextInputType.emailAddress,
),
),
confirm: MyElevatedButton(
title: 'Delete My Account'.tr,
kolor: AppColor.redColor,
onPressed: () async {
await logOutController.deletePassengerAccount();
}),
cancel: MyElevatedButton(
title: 'No I want'.tr,
onPressed: () {
logOutController.emailTextController.clear();
logOutController.update();
Get.back();
}));
});
}),
)
],
);
}
@@ -320,64 +323,67 @@ class CountryPicker extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetBuilder<ProfileController>(builder: (controller) {
return ListView(
children: [
const SizedBox(
height: 20,
),
Text(
"Select Your Country".tr,
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
// const SizedBox(
// height: 20,
// ),
Padding(
padding: const EdgeInsets.all(10),
child: Text(
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
.tr,
style: AppStyle.title,
return Padding(
padding: const EdgeInsets.all(20),
child: ListView(
children: [
const SizedBox(
height: 20,
),
Text(
"Select Your Country".tr,
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 200,
child: CupertinoPicker(
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]
.tr, // Display translated if not English
style: AppStyle.title,
// const SizedBox(
// height: 20,
// ),
Padding(
padding: const EdgeInsets.all(10),
child: Text(
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 200,
child: CupertinoPicker(
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]
.tr, // Display translated if not English
style: AppStyle.title,
),
),
),
),
),
),
MyElevatedButton(
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.snackbar(controller.selectedCountry.toString().tr, '');
Get.off(LoginPage());
},
)
],
MyElevatedButton(
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.snackbar(controller.selectedCountry.toString().tr, '');
Get.off(LoginPage());
},
)
],
),
);
});
}
@@ -403,65 +409,68 @@ class CountryPickerFromSetting extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetBuilder<ProfileController>(builder: (controller) {
return ListView(
children: [
const SizedBox(
height: 20,
),
Text(
"Select Your Country".tr,
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
// const SizedBox(
// height: 20,
// ),
Padding(
padding: const EdgeInsets.all(10),
child: Text(
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
.tr,
style: AppStyle.title,
return Padding(
padding: const EdgeInsets.all(20.0),
child: ListView(
children: [
const SizedBox(
height: 20,
),
Text(
"Select Your Country".tr,
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 200,
child: CupertinoPicker(
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]
.tr, // Display translated if not English
style: AppStyle.title,
// const SizedBox(
// height: 20,
// ),
Padding(
padding: const EdgeInsets.all(10),
child: Text(
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 200,
child: CupertinoPicker(
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]
.tr, // Display translated if not English
style: AppStyle.title,
),
),
),
),
),
),
MyElevatedButton(
title: 'Select Country'.tr, // Use translated text for button
onPressed: () async {
loginController.saveCountryCode(controller.selectedCountry
.toString()); // No conversion needed
box.write(
BoxName.countryCode, //
controller.selectedCountry); // Already saved in English
Get.snackbar(controller.selectedCountry.toString().tr, '',
backgroundColor: AppColor.greenColor);
// Get.back();//
// Get.back();
},
)
],
MyElevatedButton(
title: 'Select Country'.tr, // Use translated text for button
onPressed: () async {
loginController.saveCountryCode(controller.selectedCountry
.toString()); // No conversion needed
box.write(
BoxName.countryCode, //
controller.selectedCountry); // Already saved in English
Get.snackbar(controller.selectedCountry.toString().tr, '',
backgroundColor: AppColor.greenColor);
// Get.back();//
// Get.back();
},
)
],
),
);
});
}