This commit is contained in:
Hamza-Ayed
2023-10-10 13:38:52 +03:00
parent 7e33acb28a
commit bf9fce363d
6 changed files with 78 additions and 61 deletions

View File

@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<dict>
<key>GMSApiKey</key>
<string>YOUR_API_KEY</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is required to provide relevant information.</string>
<key>NSCameraUsageDescription</key>
<string>Sefer app requires access to your camera in order to scan QR codes and capture images for uploading.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Sefer app needs access to your location to provide you with accurate directions and location-based services.</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience. Your location data will be used to find the nearest available cars and connect you with the closest captain for efficient and convenient rides.</string>
<string>NO</string>
<key>CFBundleGetInfoString</key>
<string></string>
@@ -61,5 +62,5 @@
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</dict>
</plist>

View File

@@ -78,4 +78,5 @@ class AppLink {
static const String signUpCaptin = "$authCaptin/register.php";
static const String sendVerifyEmailCaptin = "$authCaptin/sendVerifyEmail.php";
static const String verifyEmailCaptin = "$authCaptin/verifyEmail.php";
static const String removeUser = "$authCaptin/removeAccount.php";
}

View File

@@ -3,6 +3,8 @@ import 'package:flutter/src/widgets/basic.dart';
import 'package:get/get.dart';
import 'package:ride/constant/box_name.dart';
import 'package:ride/constant/colors.dart';
import 'package:ride/constant/links.dart';
import 'package:ride/controller/functions/crud.dart';
import 'package:ride/main.dart';
import 'package:ride/views/lang/languages.dart';
import 'package:ride/views/widgets/elevated_btn.dart';
@@ -10,6 +12,12 @@ import 'package:ride/views/widgets/elevated_btn.dart';
import '../../constant/style.dart';
class LogOut {
Future deleteMyAccount(String id) async {
await CRUD().post(link: AppLink.removeUser, payload: {'id': id}).then(
(value) => Get.snackbar('Deleted', 'Your Account is Deleted',
backgroundColor: AppColor.redColor));
}
Future logOut() async {
Get.defaultDialog(
title: 'Are you Sure to LogOut?'.tr,

View File

View File

View File

@@ -1,8 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ride/constant/box_name.dart';
import 'package:ride/constant/style.dart';
import 'package:ride/controller/profile/profile_controller.dart';
import 'package:ride/main.dart';
import 'package:ride/views/widgets/elevated_btn.dart';
import 'package:ride/views/widgets/my_scafold.dart';
import 'package:ride/views/widgets/mycircular.dart';
@@ -17,6 +19,11 @@ class PassengerProfilePage extends StatelessWidget {
Get.put(ProfileController());
return MyScafolld(
isleading: true,
action: MyElevatedButton(
title: 'Delete My Account'.tr,
onPressed: () {
LogOut().deleteMyAccount(box.read(BoxName.pasengerID).toString());
}),
title: 'My Profile'.tr,
body: [
GetBuilder<ProfileController>(