diff --git a/android/app/build.gradle b/android/app/build.gradle
index d16ca8c..7235d74 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -53,10 +53,10 @@ android {
applicationId "com.mobileapp.store.ride"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
- minSdkVersion 26
+ minSdkVersion 22
targetSdkVersion flutter.targetSdkVersion
- versionCode 21
- versionName '1.4.5'
+ versionCode 22
+ versionName '1.4.6'
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 89ece84..b667beb 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -6,7 +6,6 @@
-
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 0cf9f2b..2aba9a2 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -43,8 +43,6 @@ PODS:
- AppAuth/Core
- audio_session (0.0.1):
- Flutter
- - background_location (0.0.1):
- - Flutter
- camera_avfoundation (0.0.1):
- Flutter
- device_info_plus (0.0.1):
@@ -96,13 +94,6 @@ PODS:
- google_maps_flutter_ios (0.0.1):
- Flutter
- GoogleMaps (< 9.0)
- - google_mlkit_commons (0.7.1):
- - Flutter
- - MLKitVision
- - google_mlkit_text_recognition (0.13.0):
- - Flutter
- - google_mlkit_commons
- - GoogleMLKit/TextRecognition (~> 6.0.0)
- google_sign_in_ios (0.0.1):
- AppAuth (>= 1.7.4)
- Flutter
@@ -118,20 +109,10 @@ PODS:
- GoogleMaps/Base (7.4.0)
- GoogleMaps/Maps (7.4.0):
- GoogleMaps/Base
- - GoogleMLKit/MLKitCore (6.0.0):
- - MLKitCommon (~> 11.0.0)
- - GoogleMLKit/TextRecognition (6.0.0):
- - GoogleMLKit/MLKitCore
- - MLKitTextRecognition (~> 4.0.0)
- GoogleSignIn (7.1.0):
- AppAuth (< 2.0, >= 1.7.3)
- GTMAppAuth (< 5.0, >= 4.1.1)
- GTMSessionFetcher/Core (~> 3.3)
- - GoogleToolboxForMac/Defines (4.2.1)
- - GoogleToolboxForMac/Logger (4.2.1):
- - GoogleToolboxForMac/Defines (= 4.2.1)
- - "GoogleToolboxForMac/NSData+zlib (4.2.1)":
- - GoogleToolboxForMac/Defines (= 4.2.1)
- GoogleUtilities/AppDelegateSwizzler (7.13.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
@@ -157,8 +138,6 @@ PODS:
- GoogleUtilities/UserDefaults (7.13.2):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- - GoogleUtilitiesComponents (1.1.0):
- - GoogleUtilities/Logger
- GTMAppAuth (4.1.1):
- AppAuth/Core (~> 1.7)
- GTMSessionFetcher/Core (< 4.0, >= 3.3)
@@ -180,27 +159,6 @@ PODS:
- Flutter
- location (0.0.1):
- Flutter
- - MLImage (1.0.0-beta5)
- - MLKitCommon (11.0.0):
- - GoogleDataTransport (< 10.0, >= 9.4.1)
- - GoogleToolboxForMac/Logger (< 5.0, >= 4.2.1)
- - "GoogleToolboxForMac/NSData+zlib (< 5.0, >= 4.2.1)"
- - GoogleUtilities/UserDefaults (< 8.0, >= 7.13.0)
- - GoogleUtilitiesComponents (~> 1.0)
- - GTMSessionFetcher/Core (< 4.0, >= 3.3.2)
- - MLKitTextRecognition (4.0.0):
- - MLKitCommon (~> 11.0)
- - MLKitTextRecognitionCommon (= 3.0.0)
- - MLKitVision (~> 7.0)
- - MLKitTextRecognitionCommon (3.0.0):
- - MLKitCommon (~> 11.0)
- - MLKitVision (~> 7.0)
- - MLKitVision (7.0.0):
- - GoogleToolboxForMac/Logger (< 5.0, >= 4.2.1)
- - "GoogleToolboxForMac/NSData+zlib (< 5.0, >= 4.2.1)"
- - GTMSessionFetcher/Core (< 4.0, >= 3.3.2)
- - MLImage (= 1.0.0-beta5)
- - MLKitCommon (~> 11.0)
- nanopb (2.30909.1):
- nanopb/decode (= 2.30909.1)
- nanopb/encode (= 2.30909.1)
@@ -274,7 +232,6 @@ PODS:
DEPENDENCIES:
- agora_rtc_engine (from `.symlinks/plugins/agora_rtc_engine/ios`)
- audio_session (from `.symlinks/plugins/audio_session/ios`)
- - background_location (from `.symlinks/plugins/background_location/ios`)
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
@@ -285,8 +242,6 @@ DEPENDENCIES:
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- - google_mlkit_commons (from `.symlinks/plugins/google_mlkit_commons/ios`)
- - google_mlkit_text_recognition (from `.symlinks/plugins/google_mlkit_text_recognition/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
@@ -320,18 +275,10 @@ SPEC REPOS:
- FMDB
- GoogleDataTransport
- GoogleMaps
- - GoogleMLKit
- GoogleSignIn
- - GoogleToolboxForMac
- GoogleUtilities
- - GoogleUtilitiesComponents
- GTMAppAuth
- GTMSessionFetcher
- - MLImage
- - MLKitCommon
- - MLKitTextRecognition
- - MLKitTextRecognitionCommon
- - MLKitVision
- nanopb
- PromisesObjC
- Stripe
@@ -349,8 +296,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/agora_rtc_engine/ios"
audio_session:
:path: ".symlinks/plugins/audio_session/ios"
- background_location:
- :path: ".symlinks/plugins/background_location/ios"
camera_avfoundation:
:path: ".symlinks/plugins/camera_avfoundation/ios"
device_info_plus:
@@ -371,10 +316,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/geolocator_apple/ios"
google_maps_flutter_ios:
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
- google_mlkit_commons:
- :path: ".symlinks/plugins/google_mlkit_commons/ios"
- google_mlkit_text_recognition:
- :path: ".symlinks/plugins/google_mlkit_text_recognition/ios"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
image_cropper:
@@ -420,7 +361,6 @@ SPEC CHECKSUMS:
AgoraRtcEngine_iOS: 267c0980c1fb97e056d05b850f8629b05b6e467a
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
- background_location: 1b80c1fe3abd9912bca298618f6e365abf6f588f
camera_avfoundation: 3125e8cd1a4387f6f31c6c63abb8a55892a9eeeb
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06
@@ -437,16 +377,11 @@ SPEC CHECKSUMS:
FMDB: eae540775bf7d0c87a5af926ae37af69effe5a19
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
google_maps_flutter_ios: 590249c67f34f422122c232f2a626192adbc78ee
- google_mlkit_commons: 96aaca445520311b84a2da013dedf3427fe4cc69
- google_mlkit_text_recognition: 393c2526da49aa6c9c883e6d69100f54af011e24
google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac
- GoogleMLKit: 97ac7af399057e99182ee8edfa8249e3226a4065
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
- GoogleToolboxForMac: d1a2cbf009c453f4d6ded37c105e2f67a32206d8
GoogleUtilities: c56430aef51a1aa57b25da78c3f8397e522c67b7
- GoogleUtilitiesComponents: 679b2c881db3b615a2777504623df6122dd20afe
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd
image_cropper: a3291c624a953049bc6a02e1f8c8ceb162a24b25
@@ -455,11 +390,6 @@ SPEC CHECKSUMS:
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605
location: d5cf8598915965547c3f36761ae9cc4f4e87d22e
- MLImage: 1824212150da33ef225fbd3dc49f184cf611046c
- MLKitCommon: afec63980417d29ffbb4790529a1b0a2291699e1
- MLKitTextRecognition: c83c18ad25496f2077f6ec93c5940487ff2eb343
- MLKitTextRecognitionCommon: c0b3a63d529296a19bce1f8bc8a513644ed4d1f6
- MLKitVision: e858c5f125ecc288e4a31127928301eaba9ae0c1
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
diff --git a/key/api_key.json b/key/api_key.json
deleted file mode 100644
index a4a598c..0000000
--- a/key/api_key.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "basicAuthCredentials": "wqnmqqsjyvwv:nqrDEV@2101Br",
- "accountSIDTwillo": "ACx4qy857juj0903xuy6238q763q2fj4y1Br",
- "serverAPI": "AAAAobYrrCi:APA91xF1zwTvmSzSdaxuY6f60D8mz1ZzyIzr9od6br7GDyeCaWPRK0G0hx5SaFyx1eDvQDpQPdGk-697MWLi0zs3iYInBtBLOxswg0GecNmsl0PxE3wI-vOpwu8Vv1dkUkBniuxZYXgHBr",
- "mapAPIKEY": "AImqSsCsutRXTtSTLOFQSQkN5v7QZkGJVZbEKa0Br",
- "twilloRecoveryCode": "TQF13XUVU2NJ3VFU8JWBWYBSBr",
- "authTokenTwillo": "14u39ju4628xx8q4u18469u462u8qu75Br",
- "chatGPTkey": "zg-8T67q8YDNGAeUSXqkHowT3BrxgFJfFy3ELw6rm7A6adb0kjwBr",
- "transactionCloude": "Ahcwilomqcoib:API_EMDJX6BHQ67DBGT6WV:DG2XPU7YEN02M0VJ2FBr",
- "visionApi": "0vALyaDDYHpmv73Q59SIkxmeG7Z2mgwJXlBr",
- "stripe_publishableKe": "vg_cjzc_51O4WTODMEVlOCA5SN5j6x8vApF5CPDC3f3Pou18a74NEQAvU5AunZZEN9X2WIqsuIlUTeeh1vUqpnkijLkx3FR5g00vb4iMHGOBr",
- "secretKey": "zg_cjzc_51O4WTODMEVlOCA5SBkqiSS69bNFRsuZd2Tr5ODztYseaLvf0RdBHW3wwfP38Tv78TZ1PQiZi7jHFrrRoQy3lMHPN00Ll9WD3b2Br",
- "chatGPTkeySefer": "zg-OiL08ooza0Dvhvb3rSk2T3BrxgFJ4l9jLLSrUj0Ae5ABVlqPBr"
-}
\ No newline at end of file
diff --git a/lib/controller/admin/captain_admin_controller.dart b/lib/controller/admin/captain_admin_controller.dart
deleted file mode 100644
index f73327f..0000000
--- a/lib/controller/admin/captain_admin_controller.dart
+++ /dev/null
@@ -1,109 +0,0 @@
-import 'dart:convert';
-
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-import 'package:local_auth/local_auth.dart';
-
-import '../../constant/colors.dart';
-import '../../constant/links.dart';
-import '../functions/crud.dart';
-
-class CaptainAdminController extends GetxController {
- bool isLoading = false;
- Map captainData = {};
- Map captain = {};
- final captainController = TextEditingController();
- final captainPrizeController = TextEditingController();
- final titleNotify = TextEditingController();
- final bodyNotify = TextEditingController();
- final formCaptainKey = GlobalKey();
- final formCaptainPrizeKey = GlobalKey();
-
- Future getCaptainCount() async {
- isLoading = true;
- update();
- var res = await CRUD().get(link: AppLink.getCaptainDetails, payload: {});
- var d = jsonDecode(res);
- if (d['status'] == 'success') {
- captainData = d;
- print(captainData);
- }
-
- isLoading = false;
- update();
- }
-
- Future addCaptainPrizeToWallet() async {
- String? paymentId;
- //todo link to add wallet to captain
- for (var i = 0; i < captainData['message'].length; i++) {
- await CRUD().post(link: AppLink.addDriverPaymentPoints, payload: {
- 'driverID': captainData['message'][i]['id'],
- 'amount': captainPrizeController.text,
- 'paymentMethod': 'Prize',
- }).then((value) {
- paymentId = value['message'].toString();
- });
- await CRUD().post(link: AppLink.addPassengersWallet, payload: {
- 'driverID': captainData['message'][i]['id'],
- 'amount': captainPrizeController.text,
- 'paymentMethod': 'Prize',
- 'paymentID': paymentId.toString(),
- });
- }
-
- Get.back();
- }
-
- void addCaptainsPrizeToWalletSecure() async {
- try {
- // Check if local authentication is available
- bool isAvailable = await LocalAuthentication().isDeviceSupported();
- if (isAvailable) {
- // Authenticate the user
- bool didAuthenticate = await LocalAuthentication().authenticate(
- localizedReason: 'Use Touch ID or Face ID to confirm payment',
- );
- if (didAuthenticate) {
- // User authenticated successfully, proceed with payment
- await addCaptainPrizeToWallet();
- Get.snackbar('Prize Added', '', backgroundColor: AppColor.greenColor);
- } else {
- // Authentication failed, handle accordingly
- Get.snackbar('Authentication failed', '',
- backgroundColor: AppColor.redColor);
- // print(
- // 'Authentication failed');
- }
- } else {
- // Local authentication not available, proceed with payment without authentication
- await addCaptainPrizeToWallet();
- Get.snackbar('Prize Added', '', backgroundColor: AppColor.greenColor);
- }
- } catch (e) {
- rethrow;
- }
- }
-
- Future getCaptains() async {
- var res = await CRUD()
- .get(link: AppLink.getCaptainDetailsByEmailOrIDOrPhone, payload: {
- 'driver_id': captainController.text,
- 'driverEmail': captainController.text,
- 'driverPhone': captainController.text,
- });
- var d = jsonDecode(res);
- // print(d['message']);
- if (d['status'] == 'success') {
- captain = d;
- }
- // print(passengers);
- update();
- }
-
- @override
- void onInit() {
- getCaptainCount();
- super.onInit();
- }
-}
diff --git a/lib/controller/admin/passenger_admin_controller.dart b/lib/controller/admin/passenger_admin_controller.dart
deleted file mode 100644
index ce16916..0000000
--- a/lib/controller/admin/passenger_admin_controller.dart
+++ /dev/null
@@ -1,110 +0,0 @@
-import 'dart:convert';
-
-import 'package:flutter/material.dart';
-import 'package:get/get.dart';
-import 'package:local_auth/local_auth.dart';
-import 'package:SEFER/constant/colors.dart';
-import 'package:SEFER/constant/links.dart';
-import 'package:SEFER/controller/functions/crud.dart';
-
-class PassengerAdminController extends GetxController {
- bool isLoading = false;
- Map passengersData = {};
- Map passengers = {};
- double height = 150;
- final formPassKey = GlobalKey();
- final formPrizeKey = GlobalKey();
- final titleNotify = TextEditingController();
- final bodyNotify = TextEditingController();
- final passengerController = TextEditingController();
- final passengerPrizeController = TextEditingController();
-
- Future getPassengerCount() async {
- isLoading = true;
- update();
- var res = await CRUD().get(link: AppLink.getPassengerDetails, payload: {});
- var d = jsonDecode(res);
- if (d['status'] == 'success') {
- passengersData = d;
- }
-
- isLoading = false;
- update();
- }
-
- Future addPassengerPrizeToWallet() async {
- for (var i = 0; i < passengersData['message'].length; i++) {
- await CRUD().post(link: AppLink.addPassengersWallet, payload: {
- 'passenger_id': passengersData['message'][i]['id'],
- 'balance': passengerPrizeController.text,
- });
- }
-
- Get.back();
- }
-
- void addPassengerPrizeToWalletSecure() async {
- try {
- // Check if local authentication is available
- bool isAvailable = await LocalAuthentication().isDeviceSupported();
- if (isAvailable) {
- // Authenticate the user
- bool didAuthenticate = await LocalAuthentication().authenticate(
- localizedReason: 'Use Touch ID or Face ID to confirm payment',
- );
- if (didAuthenticate) {
- // User authenticated successfully, proceed with payment
- await addPassengerPrizeToWallet();
- Get.snackbar('Prize Added', '', backgroundColor: AppColor.greenColor);
- } else {
- // Authentication failed, handle accordingly
- Get.snackbar('Authentication failed', '',
- backgroundColor: AppColor.redColor);
- // print(
- // 'Authentication failed');
- }
- } else {
- // Local authentication not available, proceed with payment without authentication
- await addPassengerPrizeToWallet();
- Get.snackbar('Prize Added', '', backgroundColor: AppColor.greenColor);
- }
- } catch (e) {
- rethrow;
- }
- }
-
- Future getPassengers() async {
- var res = await CRUD().get(link: AppLink.getPassengerbyEmail, payload: {
- 'passengerEmail': passengerController.text,
- 'passengerId': passengerController.text,
- 'passengerphone': passengerController.text,
- });
- var d = jsonDecode(res);
- // print(d['message']);
- if (d['status'] == 'success') {
- passengers = d;
- }
- // print(passengers);
- update();
- }
-
- changeHeight() {
- if (passengers.isEmpty) {
- height = 0;
- update();
- }
- height = 150;
- update();
- }
-
- void clearPlaces() {
- passengers = {};
- update();
- }
-
- @override
- void onInit() {
- getPassengerCount();
- super.onInit();
- }
-}
diff --git a/lib/controller/admin/ride_admin_controller.dart b/lib/controller/admin/ride_admin_controller.dart
deleted file mode 100644
index 9397b79..0000000
--- a/lib/controller/admin/ride_admin_controller.dart
+++ /dev/null
@@ -1,73 +0,0 @@
-import 'dart:convert';
-
-import 'package:fl_chart/fl_chart.dart';
-import 'package:get/get.dart';
-import 'package:SEFER/constant/links.dart';
-import 'package:SEFER/controller/functions/crud.dart';
-
-import '../../models/model/admin/monthly_ride.dart';
-
-class RideAdminController extends GetxController {
- bool isLoading = false;
- late List rideData;
- late Map jsonResponse;
- List ridesDetails = [];
- var chartData;
- // late List chartDatasync;
- Future getRidesAdminDash() async {
- isLoading = true;
- update();
- var res = await CRUD().get(link: AppLink.getRidesPerMonth, payload: {});
- jsonResponse = jsonDecode(res);
- rideData = (jsonResponse['message'] as List)
- .map((item) => MonthlyDataModel.fromJson(item))
- .toList();
-
- chartData = rideData
- .map((data) => FlSpot(data.day.toDouble(), data.ridesCount.toDouble()))
- .toList();
-
- // chartDatasync = (jsonResponse['message'] as List)
- // .map((item) => ChartDataS(
- // item['year'],
- // item['month'],
- // item['day'],
- // item['rides_count'],
- // ))
- // .toList();
- isLoading = false;
- update();
- }
-
- Future getRidesDetails() async {
- // isLoading = true;
- // update();
- var res = await CRUD().get(link: AppLink.getRidesDetails, payload: {});
-
- var d = jsonDecode(res);
- ridesDetails = d['message'];
-
- // isLoading = false;
- // update();
- }
-
- @override
- void onInit() async {
- List initializationTasks = [
- getRidesAdminDash(),
- getRidesDetails(),
- ];
- // cameras = await availableCameras();
- await Future.wait(initializationTasks);
- super.onInit();
- }
-}
-
-// class ChartDataS {
-// ChartDataS(this.year, this.month, this.day, this.ridesCount);
-
-// final int year;
-// final int month;
-// final int day;
-// final int ridesCount;
-// }
diff --git a/lib/controller/admin/wallet_admin_controller.dart b/lib/controller/admin/wallet_admin_controller.dart
deleted file mode 100644
index 1f8a534..0000000
--- a/lib/controller/admin/wallet_admin_controller.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-import 'dart:convert';
-
-import 'package:get/get.dart';
-
-import '../../constant/links.dart';
-import '../functions/crud.dart';
-
-class WalletAdminController extends GetxController {
- bool isLoading = false;
-
- late Map jsonResponse;
- List walletDetails = [];
-
- Future getWalletAdminDash() async {
- isLoading = true;
- update();
- var res = await CRUD().get(link: AppLink.getRidesPerMonth, payload: {});
- jsonResponse = jsonDecode(res);
- }
-}
diff --git a/lib/controller/auth/captin/history_captain.dart b/lib/controller/auth/captin/history_captain.dart
deleted file mode 100644
index 9f55437..0000000
--- a/lib/controller/auth/captin/history_captain.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-import 'dart:convert';
-
-import 'package:SEFER/views/widgets/elevated_btn.dart';
-import 'package:get/get.dart';
-
-import '../../../constant/box_name.dart';
-import '../../../constant/links.dart';
-import '../../../main.dart';
-import '../../../views/home/Captin/history/history_details_page.dart';
-import '../../functions/crud.dart';
-
-class HistoryCaptainController extends GetxController {
- bool isloading = false;
- Map historyData = {};
- Map historyDetailsData = {};
- late String orderID;
- getOrderId(String orderId) {
- orderID = orderId;
- update();
- }
-
- getHistory() async {
- isloading = true;
- var res = await CRUD().get(
- link: AppLink.getDriverOrder,
- payload: {'driver_id': box.read(BoxName.driverID)});
- if (res != 'failure') {
- historyData = jsonDecode(res);
- print(historyData);
- isloading = false;
- update();
- } else {
- Get.defaultDialog(
- title: 'No ride yet'.tr,
- middleText: '',
- barrierDismissible: false,
- confirm: MyElevatedButton(
- title: 'Back'.tr,
- onPressed: () {
- Get.back();
- Get.back();
- }));
- }
- }
-
- getHistoryDetails(String orderId) async {
- isloading = true;
- var res = await CRUD()
- .get(link: AppLink.getRideOrderID, payload: {'id': orderId});
- historyDetailsData = jsonDecode(res);
- print(historyDetailsData);
- isloading = false;
- update();
- Get.to(() => HistoryDetailsPage());
- }
-
- @override
- void onInit() {
- getHistory();
- super.onInit();
- }
-}
diff --git a/lib/controller/auth/captin/login_captin_controller.dart b/lib/controller/auth/captin/login_captin_controller.dart
deleted file mode 100644
index 69f5668..0000000
--- a/lib/controller/auth/captin/login_captin_controller.dart
+++ /dev/null
@@ -1,118 +0,0 @@
-import 'dart:convert';
-import 'dart:math';
-
-import 'package:flutter/material.dart';
-import 'package:flutter_secure_storage/flutter_secure_storage.dart';
-import 'package:get/get.dart';
-import 'package:SEFER/constant/box_name.dart';
-import 'package:SEFER/constant/links.dart';
-import 'package:SEFER/controller/functions/crud.dart';
-import 'package:SEFER/controller/functions/secure_storage.dart';
-import 'package:SEFER/main.dart';
-import 'package:SEFER/views/auth/captin/verify_email_captain.dart';
-import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
-
-class LoginCaptinController extends GetxController {
- final formKey = GlobalKey();
- TextEditingController emailController = TextEditingController();
- TextEditingController phoneController = TextEditingController();
- TextEditingController passwordController = TextEditingController();
- bool isAgreeTerms = false;
- bool isloading = false;
- final FlutterSecureStorage _storage = const FlutterSecureStorage();
-
- void changeAgreeTerm() {
- isAgreeTerms = !isAgreeTerms;
- print(isAgreeTerms);
- update();
- }
-
- void saveAgreementTerms() {
- box.write(BoxName.agreeTerms, 'agreed');
- update();
- }
-
- void login() async {
- isloading = true;
- update();
- var res = await CRUD().get(link: AppLink.loginCaptin, payload: {
- 'email': emailController.text,
- 'phone': phoneController.text,
- 'password': passwordController.text
- });
- print(res);
- if (res == 'Failure') {
- isloading = false;
- update();
- Get.snackbar('Failure', '', backgroundColor: Colors.red);
- } else {
- var jsonDecoeded = jsonDecode(res);
- // print(jsonDecoeded);
- if (jsonDecoeded.isNotEmpty) {
- if (jsonDecoeded['status'] == 'success') {
- print(jsonDecoeded['data'][0]['verified']);
- if (jsonDecoeded['data'][0]['verified'] == '1') {
- box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
- box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
- box.write(
- BoxName.nameDriver, jsonDecoeded['data'][0]['first_name']);
- box.write(BoxName.phoneDriver, jsonDecoeded['data'][0]['phone']);
- SecureStorage()
- .saveData(BoxName.passwordDriver, passwordController.text);
- Get.offAll(() => HomeCaptain());
- isloading = false;
- update();
- print(box.read(BoxName.driverID).toString());
- print(box.read(BoxName.tokenDriver));
- await CRUD().post(link: AppLink.addTokensDriver, payload: {
- 'token': box.read(BoxName.tokenDriver),
- 'captain_id': box.read(BoxName.driverID).toString()
- }).then((value) => print('cccc'));
- } else {
- isloading = false;
- update();
- Get.defaultDialog(
- title: 'You must Verify email !.'.tr,
- middleText: '',
- backgroundColor: Colors.yellow[300],
- onConfirm: () async {
- int randomNumber = Random().nextInt(100000) + 1;
- await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
- 'email': emailController.text,
- 'token': randomNumber.toString(),
- }).then((value) => print(value));
- Get.to(() => VerifyEmailCaptainPage());
- },
- );
- }
- } else if (jsonDecoeded['status'] == 'Failure') {
- Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
- backgroundColor: Colors.redAccent);
- isloading = false;
- update();
- }
- } else {
- print('res is null');
- isloading = false;
- update();
- }
- }
- }
-
- void loginByBoxData() async {
- Get.to(() => HomeCaptain());
- await CRUD().post(link: AppLink.addTokensDriver, payload: {
- 'token': box.read(BoxName.tokenDriver).toString(),
- 'captain_id': box.read(BoxName.driverID).toString()
- });
- }
-
- @override
- void onInit() async {
- super.onInit();
-
- // if (box.read(BoxName.driverID).toString() != null) {
- // loginByBoxData();
- // }
- }
-}
diff --git a/lib/controller/auth/captin/ml_google_doc.dart b/lib/controller/auth/captin/ml_google_doc.dart
deleted file mode 100644
index 6580a6b..0000000
--- a/lib/controller/auth/captin/ml_google_doc.dart
+++ /dev/null
@@ -1,103 +0,0 @@
-import 'dart:io';
-
-import 'package:get/get.dart';
-import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
-import 'package:image_cropper/image_cropper.dart';
-import 'package:image_picker/image_picker.dart';
-import 'package:SEFER/constant/colors.dart';
-import 'package:SEFER/controller/functions/llama_ai.dart';
-
-class CarRegistrationRecognizerController extends GetxController {
- @override
- void onInit() {
- // scanText();
- super.onInit();
- }
-
- // The ImagePicker instance
- final ImagePicker _imagePicker = ImagePicker();
-
- // The GoogleMlKit TextRecognizer instance
- final TextRecognizer _textRecognizer = TextRecognizer();
-
- // The scanned text
- String? scannedText;
- String? jsonOutput;
- final List