This commit is contained in:
Hamza-Ayed
2024-02-10 00:27:19 +03:00
parent 835be01923
commit 8c99fc94e2
15 changed files with 158 additions and 127 deletions

View File

@@ -203,44 +203,36 @@ class PassengerProfilePage extends StatelessWidget {
left: 70,
bottom: 10,
right: 70,
child: MyElevatedButton(
title: 'Delete My Account'.tr,
onPressed: () {
Get.defaultDialog(
title: 'Are you sure to delete your account?'.tr,
content: GetBuilder<LogOutController>(
builder: (logOutController) {
return Form(
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,
onPressed: () async {
if (logOutController.formKey.currentState!
.validate()) {
LogOutController().deleteMyAccount(
box.read(BoxName.passengerID).toString());
await CRUD().post(
link: AppLink.passengerRemovedAccountEmail,
payload: {
'email': box.read(BoxName.email).text,
});
}
}),
cancel: MyElevatedButton(
title: 'No I want'.tr,
onPressed: () {
logOutController.emailTextController.clear();
logOutController.update();
Get.back();
}));
}),
),
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();
}));
});
}),
)
],
);