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

@@ -16,8 +16,10 @@ import '../../constant/style.dart';
class LogOutController extends GetxController {
TextEditingController checkTxtController = TextEditingController();
final formKey = GlobalKey<FormState>();
final formKey1 = GlobalKey<FormState>();
final emailTextController = TextEditingController();
Future deleteMyAccount(String id) async {
Future deleteMyAccountDriver(String id) async {
await CRUD().post(link: AppLink.removeUser, payload: {'id': id}).then(
(value) => Get.snackbar('Deleted', 'Your Account is Deleted',
backgroundColor: AppColor.redColor));
@@ -156,4 +158,18 @@ class LogOutController extends GetxController {
],
));
}
deletePassengerAccount() async {
if (formKey1.currentState!.validate()) {
if (box.read(BoxName.email).toString() == emailTextController.text) {
await CRUD().post(link: AppLink.passengerRemovedAccountEmail, payload: {
'email': box.read(BoxName.email),
});
} else {
Get.snackbar('Email Wrong'.tr, 'Email you inserted is Wrong.'.tr,
snackPosition: SnackPosition.BOTTOM,
backgroundColor: AppColor.redColor);
}
}
}
}