2/9/3
This commit is contained in:
@@ -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();
|
||||
}));
|
||||
});
|
||||
}),
|
||||
)
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user