12/1/1
This commit is contained in:
@@ -41,9 +41,9 @@ class HomeCaptain extends StatelessWidget {
|
||||
closeOverlayIfFound();
|
||||
checkForUpdate(context);
|
||||
getPermissionOverlay();
|
||||
|
||||
showDriverGiftClaim(context);
|
||||
// getPermissionLocation1();
|
||||
await showFirstTimeOfferNotification(context);
|
||||
// await showFirstTimeOfferNotification(context);
|
||||
});
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
@@ -424,7 +424,7 @@ showFirstTimeOfferNotification(BuildContext context) async {
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Text(
|
||||
'3000 LE'.tr,
|
||||
'300 LE'.tr,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 25,
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:SEFER/controller/home/payment/captain_wallet_controller.dart';
|
||||
import '../../../../../constant/style.dart';
|
||||
import '../../../../widgets/elevated_btn.dart';
|
||||
import '../../../../../controller/home/captin/home_captain_controller.dart';
|
||||
import '../../../../../controller/home/captin/order_request_controller.dart';
|
||||
|
||||
class ConnectWidget extends StatelessWidget {
|
||||
const ConnectWidget({
|
||||
@@ -27,14 +26,14 @@ class ConnectWidget extends StatelessWidget {
|
||||
builder: (homeCaptainController) => int.parse(
|
||||
homeCaptainController.countRefuse) >
|
||||
3 ||
|
||||
double.parse(captainWalletController.totalPoints) < -3000
|
||||
double.parse(captainWalletController.totalPoints) < -300
|
||||
? CupertinoButton(
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
// backgroundColor: CupertinoColors.destructiveRed,
|
||||
barrierDismissible: false,
|
||||
title: double.parse(captainWalletController.totalPoints) <
|
||||
-3000
|
||||
-300
|
||||
? 'You dont have Points'.tr
|
||||
: 'You Are Stopped For this Day !'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
@@ -44,7 +43,7 @@ class ConnectWidget extends StatelessWidget {
|
||||
onPressed: () async {
|
||||
double.parse(
|
||||
captainWalletController.totalPoints) <
|
||||
-3000
|
||||
-300
|
||||
? await Get.find<TextToSpeechController>()
|
||||
.speakText(
|
||||
'You must be recharge your Account'
|
||||
@@ -58,7 +57,7 @@ class ConnectWidget extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
double.parse(captainWalletController.totalPoints) <
|
||||
-3000
|
||||
-300
|
||||
? 'You must be recharge your Account'.tr
|
||||
: 'You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!'
|
||||
.tr,
|
||||
@@ -68,7 +67,7 @@ class ConnectWidget extends StatelessWidget {
|
||||
),
|
||||
confirm:
|
||||
double.parse(captainWalletController.totalPoints) <
|
||||
-3000
|
||||
-300
|
||||
? MyElevatedButton(
|
||||
title: 'Recharge my Account'.tr,
|
||||
onPressed: () {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/controller/firebase/local_notification.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/home/Captin/orderCaptin/order_request_page.dart';
|
||||
import 'package:SEFER/views/home/Captin/orderCaptin/order_speed_request.dart';
|
||||
import 'package:SEFER/views/home/Captin/orderCaptin/vip_order_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
@@ -9,6 +11,8 @@ import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import '../../../../../constant/colors.dart';
|
||||
import '../../../../../controller/home/payment/captain_wallet_controller.dart';
|
||||
import '../../../../../print.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
import '../../../../../controller/functions/location_controller.dart';
|
||||
|
||||
@@ -175,32 +179,29 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
),
|
||||
// Platform.isAndroid
|
||||
// ?
|
||||
AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(color: AppColor.blueColor),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Builder(builder: (context) {
|
||||
return IconButton(
|
||||
onPressed: () async {
|
||||
// mySnakeBarError('ad');
|
||||
Get.to(() => VipOrderPage(), arguments: {
|
||||
'myListString': 'myListString',
|
||||
'DriverList': 'myList',
|
||||
// 'PolylineJson': myPoints,
|
||||
'body': 'message.notification!.body'
|
||||
});
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.window_close,
|
||||
size: 29,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
int.parse(box.read(BoxName.carYear).toString()) > 2023
|
||||
? AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: controller.widthMapTypeAndTraffic,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(color: AppColor.blueColor),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: Builder(builder: (context) {
|
||||
return IconButton(
|
||||
onPressed: () async {
|
||||
// mySnakeBarError('ad');
|
||||
Get.to(() => VipOrderPage());
|
||||
},
|
||||
icon: const Icon(
|
||||
Octicons.watch,
|
||||
size: 29,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
);
|
||||
}),
|
||||
)
|
||||
: const SizedBox(),
|
||||
// : const SizedBox(),
|
||||
// AnimatedContainer(
|
||||
// duration: const Duration(microseconds: 200),
|
||||
@@ -212,84 +213,84 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
// child: Builder(builder: (context) {
|
||||
// return IconButton(
|
||||
// onPressed: () async {
|
||||
// // Get.to(() => LoginCaptin());
|
||||
// // print(box.read(BoxName.myList));
|
||||
// // Bubble().startBubbleHead(sendAppToBackground: true);
|
||||
// List<String> d = [
|
||||
// "30.003028,31.2419628",
|
||||
// "30.0955661,31.2665336",
|
||||
// "160.00",
|
||||
// "25.92",
|
||||
// "1488",
|
||||
// "16.93",
|
||||
// "114243034311436865474",
|
||||
// "113172279072358305645",
|
||||
// "hamza ayed",
|
||||
// "rlMbi4Hc8L1STMPE99iPKqK4Gddwv8r9qZOCadsz9qTEJZ6KLEE9ruTJI6N8dKfK4CXez5pme5WIs14-1QGo29s07fQOniZgIlJV5XFL3yqzPRSUmn3",
|
||||
// "+201023248456",
|
||||
// "1 min",
|
||||
// "1 m",
|
||||
// "false",
|
||||
// "QwUMoyUtZ0J3oR6yXKUavrB_gBl9npUZe-qZtax-Raq4QBbdKv0AmtLKm0BfBd6N_592HBv4CVa41ii4122W3hr-BCUKKzJhzZcK8m0YjbWbtpvgJRD8uD_nuMk9",
|
||||
// "0",
|
||||
// "238",
|
||||
// "false",
|
||||
// "114243034311436865474",
|
||||
// "1488",
|
||||
// "startEnd",
|
||||
// "30.049307749732176,31.274291574954987",
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "",
|
||||
// "17.73",
|
||||
// "0",
|
||||
// "hamzaayedflutter@gmail.com",
|
||||
// "الفسطاط، حي مصر القديمة، مصر",
|
||||
// " الزاوية الحمراء، محافظة القاهرة، مصر",
|
||||
// "Speed",
|
||||
// "8",
|
||||
// "5.00"
|
||||
// ];
|
||||
|
||||
// box.write(BoxName.rideArguments, {
|
||||
// 'passengerLocation': d[0].toString(),
|
||||
// 'passengerDestination': d[1].toString(),
|
||||
// 'Duration': d[4].toString(),
|
||||
// 'totalCost': d[26].toString(),
|
||||
// 'Distance': d[5].toString(),
|
||||
// 'name': d[8].toString(),
|
||||
// 'phone': d[10].toString(),
|
||||
// 'email': d[28].toString(),
|
||||
// 'WalletChecked': d[13].toString(),
|
||||
// 'tokenPassenger': d[9].toString(),
|
||||
// 'direction':
|
||||
// 'https://www.google.com/maps/dir/${d[0]}/${d[1]}/',
|
||||
// 'DurationToPassenger': d[15].toString(),
|
||||
// 'rideId': d[16].toString(),
|
||||
// 'passengerId': d[7].toString(),
|
||||
// 'driverId': d[18].toString(),
|
||||
// 'durationOfRideValue': d[19].toString(),
|
||||
// 'paymentAmount': d[2].toString(),
|
||||
// 'paymentMethod':
|
||||
// d[13].toString() == 'true' ? 'visa' : 'cash',
|
||||
// 'isHaveSteps': d[20].toString(),
|
||||
// 'step0': d[21].toString(),
|
||||
// 'step1': d[22].toString(),
|
||||
// 'step2': d[23].toString(),
|
||||
// 'step3': d[24].toString(),
|
||||
// 'step4': d[25].toString(),
|
||||
// 'passengerWalletBurc': d[26].toString(),
|
||||
// 'timeOfOrder': DateTime.now().toString(),
|
||||
// 'totalPassenger': d[2].toString(),
|
||||
// 'carType': d[31].toString(),
|
||||
// 'kazan': d[32].toString(),
|
||||
// 'startNameLocation': d[29].toString(),
|
||||
// 'endNameLocation': d[30].toString(),
|
||||
// });
|
||||
// Get.to(() => PassengerLocationMapPage(),
|
||||
// arguments: box.read(BoxName.rideArguments));
|
||||
// // Get.offAll(() => HomeCaptainController());
|
||||
// NotificationController()
|
||||
// .showTimerNotification('title', 'message', 'tone1');
|
||||
// // Get.to(() => OrderRequestPage(), arguments: {
|
||||
// // 'myListString': [
|
||||
// // "30.1068014,31.244621",
|
||||
// // "30.0664345,31.2857709",
|
||||
// // "68.56",
|
||||
// // "25.92",
|
||||
// // "1445",
|
||||
// // "11.29",
|
||||
// // "114243034311436865474",
|
||||
// // "114243034311436865474",
|
||||
// // "sefer app",
|
||||
// // "cAVvCAywQvm6LUAqF2E3sU:APA91bHusGWWBwlaKQ6A4idNTVzvakCxtFxPPrHwVR2ycMZK5IP27Tf-RDnUypure0NVGxdFf6npAV7bi4_KWZP-UKJ0Pz3lUogWWbtzO9bIPJgBP3SPCvA",
|
||||
// // "+201023248456",
|
||||
// // "0",
|
||||
// // "0",
|
||||
// // "true",
|
||||
// // "fbeWrFqeQMqorzVU9-2mIa:APA91bHWIcbxzsk3C-w7fiAZ0NRRpPuAmRgNjduS2oQ5lZ7jFEMhA7gfWQLyRWfnhcjmUA9GByyzoLxcfvb7VhcL9zSgo15hVG4DMyJ_k5di1I3oii5Pe9w",
|
||||
// // "0",
|
||||
// // "1087",
|
||||
// // "false",
|
||||
// // "114243034311436865474",
|
||||
// // "1445",
|
||||
// // "startEnd",
|
||||
// // "30.08517654446625,31.27303797751665",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "13.98",
|
||||
// // "0",
|
||||
// // "sefertraveling@gmail.com",
|
||||
// // "5 مصر اسكندريه، شبرا الخيمة، قسم أول شبرا الخيمة، محافظة القليوبية 6210011، مصر",
|
||||
// // "12 مدرسة العباسية الميكانيكية، السرايات، الوايلى، محافظة القاهرة 4391080، مصر",
|
||||
// // "Speed",
|
||||
// // "8",
|
||||
// // "5.00"
|
||||
// // ],
|
||||
// // 'DriverList': [
|
||||
// // "30.1068014,31.244621",
|
||||
// // "30.0664345,31.2857709",
|
||||
// // "68.56",
|
||||
// // "25.92",
|
||||
// // "1445",
|
||||
// // "11.29",
|
||||
// // "114243034311436865474",
|
||||
// // "114243034311436865474",
|
||||
// // "sefer app",
|
||||
// // "cAVvCAywQvm6LUAqF2E3sU:APA91bHusGWWBwlaKQ6A4idNTVzvakCxtFxPPrHwVR2ycMZK5IP27Tf-RDnUypure0NVGxdFf6npAV7bi4_KWZP-UKJ0Pz3lUogWWbtzO9bIPJgBP3SPCvA",
|
||||
// // "+201023248456",
|
||||
// // "0",
|
||||
// // "0",
|
||||
// // "true",
|
||||
// // "fbeWrFqeQMqorzVU9-2mIa:APA91bHWIcbxzsk3C-w7fiAZ0NRRpPuAmRgNjduS2oQ5lZ7jFEMhA7gfWQLyRWfnhcjmUA9GByyzoLxcfvb7VhcL9zSgo15hVG4DMyJ_k5di1I3oii5Pe9w",
|
||||
// // "0",
|
||||
// // "1087",
|
||||
// // "false",
|
||||
// // "114243034311436865474",
|
||||
// // "1445",
|
||||
// // "startEnd",
|
||||
// // "30.08517654446625,31.27303797751665",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "",
|
||||
// // "13.98",
|
||||
// // "0",
|
||||
// // "sefertraveling@gmail.com",
|
||||
// // "5 مصر اسكندريه، شبرا الخيمة، قسم أول شبرا الخيمة، محافظة القليوبية 6210011، مصر",
|
||||
// // "12 مدرسة العباسية الميكانيكية، السرايات، الوايلى، محافظة القاهرة 4391080، مصر",
|
||||
// // "Speed",
|
||||
// // "8",
|
||||
// // "5.00"
|
||||
// // ],
|
||||
// // // 'PolylineJson': myPoints,
|
||||
// // // 'body': message.notification!.body
|
||||
// // });
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.grin_tears,
|
||||
@@ -299,7 +300,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// ,
|
||||
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
|
||||
@@ -23,7 +23,7 @@ class GoogleDriverMap extends StatelessWidget {
|
||||
builder: (controller) => Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Get.height * .6,
|
||||
height: Get.height * .92,
|
||||
child: GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
zoomControlsEnabled: true,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,17 +23,6 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
Get.put(OrderRequestController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// void addCustomStartIcon() async {
|
||||
// Create the marker with the resized image
|
||||
// orderRequestController.initilizeOrderPage();
|
||||
|
||||
// }
|
||||
// double mpg = 0;
|
||||
// calculateConsumptionFuel() {
|
||||
// mpg = Get.find<HomeCaptainController>().fuelPrice /
|
||||
// 12; //todo in register car add mpg in box
|
||||
// }
|
||||
|
||||
return GetBuilder<OrderRequestController>(
|
||||
builder: (orderRequestController) {
|
||||
return MyScafolld(
|
||||
@@ -188,7 +177,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
height: 5,
|
||||
),
|
||||
Container(
|
||||
height: Get.height * .22,
|
||||
height: Get.height * .3,
|
||||
width: Get.width * .9,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../main.dart';
|
||||
import '../../../../print.dart';
|
||||
|
||||
class VipOrderPage extends StatelessWidget {
|
||||
const VipOrderPage({super.key});
|
||||
@@ -19,10 +20,58 @@ class VipOrderPage extends StatelessWidget {
|
||||
title: 'VIP Order'.tr,
|
||||
body: [
|
||||
GetBuilder<VipOrderController>(builder: (vipOrderController) {
|
||||
if (vipOrderController.isLoading) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
|
||||
if (vipOrderController.tripData.isEmpty) {
|
||||
return Center(
|
||||
child: Text('No orders available'.tr),
|
||||
);
|
||||
}
|
||||
final order = vipOrderController.tripData[0];
|
||||
Log.print('order: ${order}');
|
||||
return SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [],
|
||||
));
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Passenger Section
|
||||
_buildSectionTitle('Passenger Information'.tr),
|
||||
_buildInfoCard(
|
||||
children: [
|
||||
_buildDetailRow('Name'.tr,
|
||||
'${order['passengerName'] ?? 'Unknown'} ${order['passengerLastName'] ?? ''}'),
|
||||
_buildDetailRow(
|
||||
'Phone'.tr, order['passengerPhone'] ?? 'Unknown'),
|
||||
_buildDetailRow(
|
||||
'Gender'.tr, order['passengergender'] ?? 'Unknown'),
|
||||
_buildDetailRow('time Selected'.tr,
|
||||
order['timeSelected'] ?? 'Unknown'),
|
||||
_buildDetailRow(
|
||||
'Ride Status'.tr, order['status'] ?? 'Unknown'),
|
||||
// _buildDetailRow('Ride Status'.tr,
|
||||
// vipOrderController.myList[4] ?? 'Unknown'),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
// print(vipOrderController.myList);
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Action Buttons
|
||||
_buildActionButtons(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
})
|
||||
],
|
||||
isleading: true,
|
||||
@@ -30,39 +79,158 @@ class VipOrderPage extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildSectionTitle(String title) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0),
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoCard({required List<Widget> children}) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.2),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 5,
|
||||
offset: const Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: children,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDetailRow(String label, String value) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Text(
|
||||
value,
|
||||
style: const TextStyle(color: Colors.black54),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildActionButtons(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
onPressed: () => _onReject(context),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.red,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'Reject'.tr,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
onPressed: () => _onApply(context),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.green,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'Apply'.tr,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
void _onReject(BuildContext context) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Ride Rejected'),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onApply(BuildContext context) {
|
||||
// TODO: Implement application logic
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Ride Applied'),
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class VipOrderController extends GetxController {
|
||||
bool isLoading = false;
|
||||
final arguments = Get.arguments;
|
||||
late String body;
|
||||
List tripData = [];
|
||||
var myList;
|
||||
|
||||
initilize() {
|
||||
final myListString = arguments['myListString'];
|
||||
|
||||
if (arguments['DriverList'] == null || arguments['DriverList'].isEmpty) {
|
||||
myList = jsonDecode(myListString);
|
||||
} else {
|
||||
myList = arguments['DriverList'];
|
||||
}
|
||||
|
||||
body = arguments['body'];
|
||||
update();
|
||||
}
|
||||
|
||||
fetchOrder() async {
|
||||
var res = await CRUD().get(link: AppLink.getMishwari, payload: {
|
||||
isLoading = true; // Set loading state
|
||||
update(); // Notify listeners
|
||||
var res = await CRUD().get(link: AppLink.getMishwariDriver, payload: {
|
||||
'driverId': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
tripData = jsonDecode(res)['message'];
|
||||
update();
|
||||
} else {
|
||||
tripData = [];
|
||||
}
|
||||
isLoading = false; // Loading complete
|
||||
update(); // Notify listeners
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
await initilize();
|
||||
fetchOrder();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ class PointsCaptain extends StatelessWidget {
|
||||
box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'EGP'
|
||||
: 'JOD', () async {
|
||||
await captainWalletController.addDriverPaymentPoints(
|
||||
'visa-in', pricePoint);
|
||||
// await captainWalletController.getPaymentId(
|
||||
// 'visa-in', pricePoint);
|
||||
await captainWalletController.addDriverWallet(
|
||||
'visa-in', countPoint);
|
||||
'visa-in', countPoint, pricePoint);
|
||||
await captainWalletController.addSeferWallet(
|
||||
'visa-in', pricePoint.toString());
|
||||
await captainWalletController
|
||||
@@ -93,12 +93,11 @@ class PointsCaptain extends StatelessWidget {
|
||||
box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'EGP'
|
||||
: 'JOD', () async {
|
||||
// await captainWalletController
|
||||
// .getPaymentId('visa-in', pricePoint);
|
||||
await captainWalletController
|
||||
.addDriverPaymentPoints(
|
||||
'visa-in', pricePoint);
|
||||
await captainWalletController
|
||||
.addDriverWallet(
|
||||
'visa-in', countPoint);
|
||||
.addDriverWallet('visa-in',
|
||||
countPoint, pricePoint);
|
||||
await captainWalletController
|
||||
.addSeferWallet(
|
||||
'visa-in', pricePoint.toString());
|
||||
@@ -115,10 +114,10 @@ class PointsCaptain extends StatelessWidget {
|
||||
: await paymentController.makePaymentStripe(pricePoint,
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? 'jod' : 'egp',
|
||||
() async {
|
||||
await captainWalletController.addDriverPaymentPoints(
|
||||
'visa-in', pricePoint);
|
||||
// await captainWalletController.getPaymentId(
|
||||
// 'visa-in', pricePoint);
|
||||
await captainWalletController.addDriverWallet(
|
||||
'visa-in', countPoint);
|
||||
'visa-in', countPoint, pricePoint);
|
||||
await captainWalletController.getCaptainWalletFromBuyPoints();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -55,11 +55,11 @@ class WalletCaptain extends StatelessWidget {
|
||||
double.parse(captainWalletController
|
||||
.totalPoints
|
||||
.toString()) >
|
||||
-3000
|
||||
-300
|
||||
? AppColor.yellowColor
|
||||
: double.parse(captainWalletController.totalPoints
|
||||
.toString()) <
|
||||
-3000
|
||||
-300
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
child: InkWell(
|
||||
@@ -70,7 +70,7 @@ class WalletCaptain extends StatelessWidget {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text('Info'.tr),
|
||||
content: Text(
|
||||
'The 3000 points equal 3000 L.E for you \nSo go and gain your money'
|
||||
'The 300 points equal 300 L.E for you \nSo go and gain your money'
|
||||
.tr,
|
||||
),
|
||||
actions: <Widget>[
|
||||
@@ -99,7 +99,7 @@ class WalletCaptain extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
if (double.parse(captainWalletController.totalPoints
|
||||
.toString()) <
|
||||
-3000)
|
||||
-300)
|
||||
CupertinoButton.filled(
|
||||
child: Text('Charge your Account'.tr),
|
||||
onPressed: () {
|
||||
@@ -193,6 +193,7 @@ class WalletCaptain extends StatelessWidget {
|
||||
children: [
|
||||
_buildPromoCard(
|
||||
title: 'Morning Promo'.tr,
|
||||
timePromo: 'Morning Promo',
|
||||
count: captainWalletController
|
||||
.walletDate['message'][0]
|
||||
['morning_count'],
|
||||
@@ -204,6 +205,7 @@ class WalletCaptain extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 16), // Add space between the cards
|
||||
_buildPromoCard(
|
||||
timePromo: 'Afternoon Promo',
|
||||
title: 'Afternoon Promo'.tr,
|
||||
count: captainWalletController
|
||||
.walletDate['message'][0]
|
||||
@@ -308,12 +310,18 @@ class WalletCaptain extends StatelessWidget {
|
||||
|
||||
Widget _buildPromoCard(
|
||||
{required String title,
|
||||
required timePromo,
|
||||
required int count,
|
||||
required int maxCount,
|
||||
required String description}) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
MyDialog().getDialog(title, description, () {
|
||||
MyDialog().getDialog(title, description, () async {
|
||||
if (count == 5) {
|
||||
Get.find<CaptainWalletController>()
|
||||
.addDriverWalletFromPromo(timePromo, 50);
|
||||
}
|
||||
|
||||
Get.back();
|
||||
});
|
||||
},
|
||||
@@ -443,25 +451,25 @@ class WalletCaptain extends StatelessWidget {
|
||||
kolor: AppColor.greyColor,
|
||||
pricePoint: box.read(BoxName.countryCode) == 'Jordan' ? 5 : 80,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? '3000' : '1000',
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? '3000' : '80',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.bronze,
|
||||
pricePoint: box.read(BoxName.countryCode) == 'Jordan' ? 10 : 200,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? '1040' : '2500',
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? '1040' : '210',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.goldenBronze,
|
||||
pricePoint: box.read(BoxName.countryCode) == 'Jordan' ? 22 : 400,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? '23000' : '5100',
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? '23000' : '450',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.gold,
|
||||
pricePoint: box.read(BoxName.countryCode) == 'Jordan' ? 50 : 1000,
|
||||
countPoint:
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? '55000' : '130000',
|
||||
box.read(BoxName.countryCode) == 'Jordan' ? '55000' : '1100',
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:SEFER/constant/style.dart';
|
||||
import 'package:SEFER/controller/home/payment/captain_wallet_controller.dart';
|
||||
import 'package:SEFER/views/auth/captin/criminal_documents_page.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -52,8 +53,17 @@ class ProfileCaptain extends StatelessWidget {
|
||||
Get.to(() => CaptainsCars());
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Add criminal page'.tr,
|
||||
onPressed: () async {
|
||||
Get.to(() => CriminalDocumemtPage());
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: Get.height * .8,
|
||||
height: Get.height * .7,
|
||||
child: DriverProfileCard(
|
||||
driverId:
|
||||
controller.captainProfileData['driverID'] ??
|
||||
|
||||
Reference in New Issue
Block a user