12/14/1
This commit is contained in:
@@ -55,6 +55,14 @@ class AppLink {
|
||||
static String getDriverPaymentPoints = "$ride/driverWallet/get.php";
|
||||
static String getDriverpaymentToday = "$ride/payment/get.php";
|
||||
static String getAllPaymentFromRide = "$ride/payment/getAllPayment.php";
|
||||
|
||||
//-----------------Passenger NotificationCaptain------------------
|
||||
static String addNotificationPassenger =
|
||||
"$ride/notificationPassenger/add.php";
|
||||
static String getNotificationPassenger =
|
||||
"$ride/notificationPassenger/get.php";
|
||||
static String updateNotificationPassenger =
|
||||
"$ride/notificationPassenger/update.php";
|
||||
//-----------------Driver NotificationCaptain------------------
|
||||
static String addNotificationCaptain = "$ride/notificationCaptain/add.php";
|
||||
static String getNotificationCaptain = "$ride/notificationCaptain/get.php";
|
||||
@@ -123,6 +131,7 @@ class AppLink {
|
||||
//==================Blog=============
|
||||
static String profile = '$server/ride/profile';
|
||||
static String getprofile = "$profile/get.php";
|
||||
static String getCaptainProfile = "$profile/getCaptainProfile.php";
|
||||
static String addprofile = "$profile/add.php";
|
||||
static String deleteprofile = "$profile/delete.php";
|
||||
static String updateprofile = "$profile/update.php";
|
||||
@@ -141,6 +150,7 @@ class AppLink {
|
||||
static String sendVerifyEmailCaptin = "$authCaptin/sendVerifyEmail.php";
|
||||
static String verifyEmailCaptin = "$authCaptin/verifyEmail.php";
|
||||
static String removeUser = "$authCaptin/removeAccount.php";
|
||||
static String deletecaptainAccounr = "$authCaptin/deletecaptainAccounr.php";
|
||||
static String updateAccountBank = "$authCaptin/updateAccountBank.php";
|
||||
static String getAccount = "$authCaptin/getAccount.php";
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ import 'dart:math';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
import 'package:ride/views/auth/login_page.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../views/auth/verify_email_page.dart';
|
||||
|
||||
@@ -30,10 +32,12 @@ class RegisterController extends GetxController {
|
||||
getBirthDate() {
|
||||
Get.defaultDialog(
|
||||
title: 'Select Date',
|
||||
titleStyle: AppStyle.title,
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
child: CalendarDatePicker(
|
||||
initialDate: DateTime.now().subtract(const Duration(days: 14 * 365)),
|
||||
initialDate:
|
||||
DateTime.now().subtract(const Duration(days: 14 * 365)),
|
||||
firstDate: DateTime.parse('1940-06-01'),
|
||||
lastDate: DateTime.now().subtract(const Duration(days: 14 * 365)),
|
||||
onDateChanged: (date) {
|
||||
@@ -42,13 +46,12 @@ class RegisterController extends GetxController {
|
||||
// Call the getOrders() function from the controller
|
||||
birthDate = dateTime.toString().split(' ')[0];
|
||||
update();
|
||||
Get.back();
|
||||
},
|
||||
|
||||
// onDateChanged: (DateTime value) {},
|
||||
),
|
||||
),
|
||||
);
|
||||
confirm: MyElevatedButton(title: 'Ok'.tr, onPressed: () => Get.back()));
|
||||
}
|
||||
|
||||
void changeGender(String value) {
|
||||
@@ -75,7 +78,7 @@ class RegisterController extends GetxController {
|
||||
'email': emailController.text.toString(),
|
||||
'phone': phoneController.text.toString(),
|
||||
'password': passwordController.text.toString(),
|
||||
'gender': gender,
|
||||
'gender': 'yet',
|
||||
'site': siteController.text,
|
||||
'birthdate': birthDate,
|
||||
});
|
||||
|
||||
@@ -1,24 +1,81 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
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/onbording_page.dart';
|
||||
import 'package:ride/views/lang/languages.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_textField.dart';
|
||||
|
||||
import '../../constant/style.dart';
|
||||
|
||||
class LogOut {
|
||||
TextEditingController checkTxtController = TextEditingController();
|
||||
final formKey = GlobalKey<FormState>();
|
||||
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 {
|
||||
checkBeforeDelete() async {
|
||||
var res = await CRUD().post(
|
||||
link: AppLink.deletecaptainAccounr,
|
||||
payload: {'id': box.read(BoxName.driverID)}).then((value) => exit(0));
|
||||
}
|
||||
|
||||
deletecaptainAccount() {
|
||||
Get.defaultDialog(
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
title: 'Are you sure to delete your account?'.tr,
|
||||
middleText:
|
||||
'Your data will be erased after 2 weeks\nAnd you will can\'t return to use app after 1 month ',
|
||||
titleStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: Get.width,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'Your data will be erased after 2 weeks\nAnd you will can\'t return to use app after 1 month'
|
||||
.tr,
|
||||
style: AppStyle.title.copyWith(color: AppColor.redColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Form(
|
||||
key: formKey,
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
child: MyTextForm(
|
||||
controller: checkTxtController,
|
||||
label: 'Enter Your First Name'.tr,
|
||||
hint: 'Enter Your First Name'.tr,
|
||||
type: TextInputType.name,
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Delete'.tr,
|
||||
onPressed: () {
|
||||
if (checkTxtController.text == box.read(BoxName.nameDriver)) {
|
||||
deletecaptainAccount();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
Future logOutPassenger() async {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you Sure to LogOut?'.tr,
|
||||
content: Row(
|
||||
@@ -42,7 +99,54 @@ class LogOut {
|
||||
box.remove(BoxName.phone);
|
||||
box.remove(BoxName.tokenFCM);
|
||||
box.remove(BoxName.tokens);
|
||||
Get.offAll(const Language());
|
||||
Get.offAll(OnBoardingPage());
|
||||
},
|
||||
child: Text(
|
||||
'Sign Out'.tr,
|
||||
style:
|
||||
AppStyle.title.copyWith(color: AppColor.secondaryColor),
|
||||
))
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Future logOutCaptain() async {
|
||||
Get.defaultDialog(
|
||||
title: 'Are you Sure to LogOut?'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
onPressed: () => Get.back(),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all(AppColor.redColor),
|
||||
),
|
||||
onPressed: () {
|
||||
// box.remove(BoxName.agreeTerms);
|
||||
box.remove(BoxName.driverID);
|
||||
box.remove(BoxName.sexDriver);
|
||||
box.remove(BoxName.dobDriver);
|
||||
box.remove(BoxName.nameDriver);
|
||||
box.remove(BoxName.emailDriver);
|
||||
box.remove(BoxName.phoneDriver);
|
||||
box.remove(BoxName.statusDriverLocation);
|
||||
box.remove(BoxName.cvvCodeDriver);
|
||||
box.remove(BoxName.lastNameDriver);
|
||||
box.remove(BoxName.passwordDriver);
|
||||
box.remove(BoxName.cardNumberDriver);
|
||||
box.remove(BoxName.expiryDateDriver);
|
||||
box.remove(BoxName.cardHolderNameDriver);
|
||||
box.remove(BoxName.vin);
|
||||
box.remove(BoxName.make);
|
||||
box.remove(BoxName.year);
|
||||
box.remove(BoxName.owner);
|
||||
box.remove(BoxName.onBoarding);
|
||||
box.remove(BoxName.agreeTerms);
|
||||
Get.offAll(OnBoardingPage());
|
||||
},
|
||||
child: Text(
|
||||
'Sign Out'.tr,
|
||||
|
||||
@@ -6,6 +6,8 @@ import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||
import 'package:location/location.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/views/home/map_page_passenger.dart';
|
||||
import '../../constant/api_key.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
@@ -273,13 +275,15 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
|
||||
changeConfirmRide() async {
|
||||
if (dataCarsLocationByPassenger != 'failure') {
|
||||
driverToken =
|
||||
dataCarsLocationByPassenger['message'][carsOrder]['token'].toString();
|
||||
PaymentController paymentController = Get.find<PaymentController>();
|
||||
rideConfirm = true;
|
||||
shouldFetch = true;
|
||||
isBottomSheetShown = false;
|
||||
timeToPassengerFromDriverAfterApplied = 60;
|
||||
driverToken =
|
||||
dataCarsLocationByPassenger['message'][carsOrder]['token'].toString();
|
||||
|
||||
update();
|
||||
// print('rideConfirm= $rideConfirm');
|
||||
|
||||
@@ -344,6 +348,15 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
}
|
||||
update();
|
||||
} else {
|
||||
Get.defaultDialog(
|
||||
title: 'No Car or Captain Found in your area.'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
middleText: 'Please Try anther time '.tr,
|
||||
middleTextStyle: AppStyle.title.copyWith(color: AppColor.yellowColor),
|
||||
confirm:
|
||||
MyElevatedButton(title: 'Ok'.tr, onPressed: () => Get.back()));
|
||||
}
|
||||
}
|
||||
|
||||
void delayAndFetchRideStatus(String rideId) {
|
||||
@@ -446,6 +459,7 @@ class MapPassengerController extends GetxController {
|
||||
});
|
||||
if (res == 'failure') {
|
||||
noCarString = true;
|
||||
dataCarsLocationByPassenger = res;
|
||||
update();
|
||||
// Get.snackbar('No Car in your site.Sorry!'.tr, '',
|
||||
// backgroundColor: AppColor.redColor);
|
||||
|
||||
@@ -5,10 +5,10 @@ import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/constant/table_names.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../functions/crud.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../main.dart';
|
||||
import '../functions/crud.dart';
|
||||
|
||||
class NotificationCaptainController extends GetxController {
|
||||
bool isloading = false;
|
||||
@@ -0,0 +1,67 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/controller/firebase/firbase_messge.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../main.dart';
|
||||
import '../../views/widgets/elevated_btn.dart';
|
||||
import '../functions/crud.dart';
|
||||
|
||||
class PassengerNotificationController extends GetxController {
|
||||
bool isloading = false;
|
||||
Map notificationData = {};
|
||||
|
||||
getNotifications() async {
|
||||
isloading = true;
|
||||
update();
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getNotificationPassenger,
|
||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||
if (res == "failure") {
|
||||
// print(res);
|
||||
Get.defaultDialog(
|
||||
title: 'There is no notification yet'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
middleText: '',
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Back',
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
Get.back();
|
||||
}));
|
||||
}
|
||||
notificationData = jsonDecode(res);
|
||||
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
||||
|
||||
// print(notificationData);
|
||||
isloading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
updateNotification(String id) async {
|
||||
await CRUD().post(
|
||||
link: AppLink.updateNotificationPassenger,
|
||||
payload: {'isShown': 'true', 'id': id},
|
||||
);
|
||||
Get.back();
|
||||
getNotifications();
|
||||
}
|
||||
|
||||
addNotificationToPassenger(String title, body) async {
|
||||
var res = CRUD().post(link: AppLink.addNotificationPassenger, payload: {
|
||||
'title': title,
|
||||
'body': body,
|
||||
});
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(title, body, 'token', []);
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getNotifications();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
@@ -38,4 +39,28 @@ class CaptainProfileController extends GetxController {
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
|
||||
Map captainProfileData = {};
|
||||
Future getProfileData() async {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getCaptainProfile,
|
||||
payload: {'id': box.read(BoxName.driverID)});
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res);
|
||||
captainProfileData = d['message'];
|
||||
update();
|
||||
print(d['message']);
|
||||
box.write(BoxName.sexDriver, d['message']['gender']);
|
||||
box.write(BoxName.dobDriver, d['message']['birthdate']);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
if (box.read(BoxName.dobDriver).toString().isEmpty) {
|
||||
getProfileData();
|
||||
}
|
||||
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/info.dart';
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:animated_text_kit/animated_text_kit.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/controller/functions/llama_ai.dart';
|
||||
import 'package:ride/env/env.dart';
|
||||
|
||||
import '../../../constant/api_key.dart';
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/char_map.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/credential.dart';
|
||||
import '../../../constant/info.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import '../../../controller/auth/captin/login_captin_controller.dart';
|
||||
@@ -197,62 +190,62 @@ class LoginCaptin extends StatelessWidget {
|
||||
displayFullTextOnTap: true,
|
||||
stopPauseOnTap: true,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
// String v =
|
||||
// await storage.read(key: BoxName.serverAPI) ?? '';
|
||||
// print(v);
|
||||
// sql.deleteAllData(TableName.faceDetectTimes);
|
||||
AC credentials = AC();
|
||||
// String apiKey = AK.secretKey;
|
||||
// // // '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';
|
||||
// credentials.gAK();
|
||||
// String? apiKeyf =
|
||||
// await storage.read(key: BoxName.chatGPTkey);
|
||||
// print(apiKeyf);
|
||||
// String convertedString = credentials.c(apiKey, s);
|
||||
// String convertedStrings = credentials.c(apiKey, s);
|
||||
// print('Converted String s: $convertedStrings');
|
||||
// String convertedStringC =
|
||||
// credentials.c(convertedStrings, c);
|
||||
// print('v: $v');
|
||||
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
||||
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
||||
String convertedStringN = credentials.c(
|
||||
credentials.c(
|
||||
credentials.c(
|
||||
'0vQRyaYYDWpsv73A5CZOknseK7S2sgwE', cs),
|
||||
cC),
|
||||
cn);
|
||||
print('Converted v: $convertedStringN');
|
||||
// //
|
||||
// String retrievedStringN =
|
||||
// credentials.r(convertedStringN, n);
|
||||
// print('Retrieved String: $retrievedStringN');
|
||||
// String retrievedStringC =
|
||||
// credentials.r(retrievedStringN, c);
|
||||
// print('Retrieved String: $retrievedStringC');
|
||||
// IconButton(
|
||||
// onPressed: () async {
|
||||
// // String v =
|
||||
// // await storage.read(key: BoxName.serverAPI) ?? '';
|
||||
// // print(v);
|
||||
// // sql.deleteAllData(TableName.faceDetectTimes);
|
||||
// AC credentials = AC();
|
||||
// // String apiKey = AK.secretKey;
|
||||
// // // // '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';
|
||||
// // credentials.gAK();
|
||||
// // String? apiKeyf =
|
||||
// // await storage.read(key: BoxName.chatGPTkey);
|
||||
// // print(apiKeyf);
|
||||
// // String convertedString = credentials.c(apiKey, s);
|
||||
// // String convertedStrings = credentials.c(apiKey, s);
|
||||
// // print('Converted String s: $convertedStrings');
|
||||
// // String convertedStringC =
|
||||
// // credentials.c(convertedStrings, c);
|
||||
// // print('v: $v');
|
||||
// // 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
||||
// // 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
|
||||
// String convertedStringN = credentials.c(
|
||||
// credentials.c(
|
||||
// credentials.c(
|
||||
// '0vQRyaYYDWpsv73A5CZOknseK7S2sgwE', cs),
|
||||
// cC),
|
||||
// cn);
|
||||
// print('Converted v: $convertedStringN');
|
||||
// // //
|
||||
// // String retrievedStringN =
|
||||
// // credentials.r(convertedStringN, n);
|
||||
// // print('Retrieved String: $retrievedStringN');
|
||||
// // String retrievedStringC =
|
||||
// // credentials.r(retrievedStringN, c);
|
||||
// // print('Retrieved String: $retrievedStringC');
|
||||
|
||||
String retrievedStringS = credentials.r(
|
||||
credentials.r(
|
||||
credentials.r(convertedStringN, cn), cC),
|
||||
cs);
|
||||
print('Retrieved String: $retrievedStringS');
|
||||
// String retrievedStringS = credentials.r(
|
||||
// credentials.r(
|
||||
// credentials.r(convertedStringN, cn), cC),
|
||||
// cs);
|
||||
// print('Retrieved String: $retrievedStringS');
|
||||
|
||||
// if (retrievedStringS == apiKey) {
|
||||
// print('same');
|
||||
// }
|
||||
// print(' AK is ' + AK.chatGPTkey); //
|
||||
// // if (retrievedStringS == apiKey) {
|
||||
// // print('same');
|
||||
// // }
|
||||
// // print(' AK is ' + AK.chatGPTkey); //
|
||||
|
||||
// print(' ENV is ' + Env.chatGPTkey); //
|
||||
// // print('storage is ' + v); //
|
||||
// print('storage is ' + apiKeyf!); //
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
),
|
||||
// // print(' ENV is ' + Env.chatGPTkey); //
|
||||
// // // print('storage is ' + v); //
|
||||
// // print('storage is ' + apiKeyf!); //
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// Icons.close,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/controller/functions/log_out.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
class LogoutCaptain extends StatelessWidget {
|
||||
@@ -9,7 +12,30 @@ class LogoutCaptain extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Log Out Page'.tr,
|
||||
body: [],
|
||||
body: [
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'Log Off'.tr,
|
||||
onPressed: () {
|
||||
LogOut().logOutCaptain();
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Delete My Account'.tr,
|
||||
onPressed: () {
|
||||
LogOut().deletecaptainAccount();
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -257,22 +257,26 @@ class RegisterPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
DropdownButton(
|
||||
value: controller.gender,
|
||||
items: [
|
||||
DropdownMenuItem(
|
||||
value: 'Male'.tr,
|
||||
child: Text('Male'.tr),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 'Female'.tr,
|
||||
child: Text('Female'.tr),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
controller.changeGender(value!);
|
||||
},
|
||||
)
|
||||
// DropdownButton(
|
||||
// value: controller.gender,
|
||||
// items: [
|
||||
// DropdownMenuItem(
|
||||
// value: 'Male'.tr,
|
||||
// child: Text('Male'.tr),
|
||||
// ),
|
||||
// DropdownMenuItem(
|
||||
// value: 'Female'.tr,
|
||||
// child: Text('Female'.tr),
|
||||
// ),
|
||||
// DropdownMenuItem(
|
||||
// value: '--'.tr,
|
||||
// child: Text('--'.tr),
|
||||
// ),
|
||||
// ],
|
||||
// onChanged: (value) {
|
||||
// controller.changeGender(value!);
|
||||
// },
|
||||
// )
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/views/lang/languages.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
class SettingsCaptain extends StatelessWidget {
|
||||
@@ -9,7 +11,31 @@ class SettingsCaptain extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Settings'.tr,
|
||||
body: [],
|
||||
body: [
|
||||
ListView(
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
leading: const Icon(Icons.language),
|
||||
title: Text(
|
||||
'Language',
|
||||
style: AppStyle.headtitle2,
|
||||
),
|
||||
onTap: () => Get.to(const Language()),
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const Icon(Icons.notifications),
|
||||
// title: const Text('Notifications'),
|
||||
// onTap: () =>
|
||||
// Navigator.pushNamed(context, '/notification-settings'),
|
||||
// ),
|
||||
// ListTile(
|
||||
// leading: const Icon(Icons.account_circle),
|
||||
// title: const Text('Account'),
|
||||
// onTap: () => Navigator.pushNamed(context, '/account-settings'),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ class PassengerProfilePage extends StatelessWidget {
|
||||
child: MyElevatedButton(
|
||||
title: 'Sign Out'.tr,
|
||||
onPressed: () {
|
||||
LogOut().logOut();
|
||||
LogOut().logOutPassenger();
|
||||
}),
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/auth/captin/notification_captain_controller.dart';
|
||||
import 'package:ride/controller/notification/notification_captain_controller.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
|
||||
@@ -3,35 +3,80 @@ import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../main.dart';
|
||||
import '../../controller/notification/passenger_notification_controller.dart';
|
||||
import '../widgets/elevated_btn.dart';
|
||||
import '../widgets/my_scafold.dart';
|
||||
import '../widgets/mycircular.dart';
|
||||
|
||||
class NotificationPage extends StatelessWidget {
|
||||
const NotificationPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(PassengerNotificationController());
|
||||
return MyScafolld(
|
||||
isleading: true,
|
||||
title: 'Notifications',
|
||||
action: IconButton(
|
||||
onPressed: () async {
|
||||
print(box.read(BoxName.tokenFCM).toString());
|
||||
// await CRUD().post(link: AppLink.addTokens, payload: {
|
||||
// 'token': box.read(BoxName.tokenFCM).toString(),
|
||||
// 'passengerID': box.read(BoxName.pasengerID).toString()
|
||||
// }).then((value) => print('cccc'));
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.add,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
body: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
GetBuilder<PassengerNotificationController>(
|
||||
builder: (notificationCaptainController) =>
|
||||
notificationCaptainController.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: SafeArea(
|
||||
child: ListView.builder(
|
||||
itemCount: notificationCaptainController
|
||||
.notificationData['message'].length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
if (notificationCaptainController
|
||||
.notificationData['message'] ==
|
||||
"No notification data found") {
|
||||
Get.defaultDialog();
|
||||
}
|
||||
var res = notificationCaptainController
|
||||
.notificationData['message'][index];
|
||||
return Card(
|
||||
elevation: 4,
|
||||
color: res['isShown'] == 'true'
|
||||
? AppColor.secondaryColor.withOpacity(.5)
|
||||
: AppColor.secondaryColor.withOpacity(.9),
|
||||
child: ListTile(
|
||||
onTap: () {
|
||||
Get.defaultDialog(
|
||||
title: res['title'],
|
||||
titleStyle: AppStyle.title,
|
||||
content: SizedBox(
|
||||
width: Get.width * .8,
|
||||
// height: Get.height * .4,
|
||||
child: Text(
|
||||
res['body'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok',
|
||||
onPressed: () {
|
||||
notificationCaptainController
|
||||
.updateNotification(
|
||||
res['id'].toString());
|
||||
}));
|
||||
},
|
||||
leading: res['isShown'] == 'true'
|
||||
? const Icon(
|
||||
Icons.notifications_off_outlined)
|
||||
: const Icon(Icons.notifications_active),
|
||||
title: Text(
|
||||
res['title'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
subtitle: Text(
|
||||
res['body'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,10 @@ class MyScafolld extends StatelessWidget {
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.body,
|
||||
this.action = const Icon(Icons.clear),
|
||||
this.action = const Icon(
|
||||
Icons.clear,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
required this.isleading,
|
||||
});
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class MyTextForm extends StatelessWidget {
|
||||
hintText: hint.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || value.length != 10) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter $label.'.tr;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -161,6 +161,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
calendar_builder:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: calendar_builder
|
||||
sha256: "4b94a20d7e8136b84cd62fb7c7752f4a723b67a4b7ed3c3c14c2615e6e6a4653"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.6"
|
||||
camera:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@@ -48,6 +48,7 @@ dependencies:
|
||||
image_cropper: ^4.0.1
|
||||
envied: ^0.5.2
|
||||
cached_network_image: ^3.3.0
|
||||
calendar_builder: ^0.0.6
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user