3/27/4
This commit is contained in:
@@ -59,6 +59,11 @@ class AppLink {
|
|||||||
static String adddriverScam = "$ride/driver_scam/add.php";
|
static String adddriverScam = "$ride/driver_scam/add.php";
|
||||||
static String getdriverScam = "$ride/driver_scam/get.php";
|
static String getdriverScam = "$ride/driver_scam/get.php";
|
||||||
|
|
||||||
|
/////////---getKazanPercent===////////////
|
||||||
|
static String getKazanPercent = "$ride/kazan/get.php";
|
||||||
|
static String addKazanPercent = "$ride/kazan/add.php";
|
||||||
|
|
||||||
|
|
||||||
////-----------------DriverPayment------------------
|
////-----------------DriverPayment------------------
|
||||||
static String addDriverpayment = "$ride/payment/add.php";
|
static String addDriverpayment = "$ride/payment/add.php";
|
||||||
static String addDriverPaymentPoints = "$ride/driverPayment/add.php";
|
static String addDriverPaymentPoints = "$ride/driverPayment/add.php";
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import '../../functions/location_controller.dart';
|
|||||||
class OrderRequestController extends GetxController {
|
class OrderRequestController extends GetxController {
|
||||||
double progress = 0;
|
double progress = 0;
|
||||||
double progressSpeed = 0;
|
double progressSpeed = 0;
|
||||||
int duration = 10;
|
int duration = 11;
|
||||||
int durationSpeed = 20;
|
int durationSpeed = 20;
|
||||||
int remainingTime = 0;
|
int remainingTime = 0;
|
||||||
int remainingTimeSpeed = 0;
|
int remainingTimeSpeed = 0;
|
||||||
@@ -121,7 +121,7 @@ class OrderRequestController extends GetxController {
|
|||||||
'status': 'Refused',
|
'status': 'Refused',
|
||||||
'driver_id': box.read(BoxName.driverID),
|
'driver_id': box.read(BoxName.driverID),
|
||||||
});
|
});
|
||||||
Get.back();
|
|
||||||
// applied = true;
|
// applied = true;
|
||||||
sql.insertData({
|
sql.insertData({
|
||||||
'order_id': orderID,
|
'order_id': orderID,
|
||||||
@@ -131,6 +131,7 @@ class OrderRequestController extends GetxController {
|
|||||||
getRefusedOrderByCaptain();
|
getRefusedOrderByCaptain();
|
||||||
box.write(BoxName.statusDriverLocation, 'off');
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
update();
|
update();
|
||||||
|
Get.back();
|
||||||
// Get.offAll(HomeCaptain());
|
// Get.offAll(HomeCaptain());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'dart:math' as math;
|
|||||||
|
|
||||||
import 'package:SEFER/controller/functions/tts.dart';
|
import 'package:SEFER/controller/functions/tts.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
@@ -15,7 +14,6 @@ import 'package:location/location.dart';
|
|||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
import 'package:SEFER/constant/style.dart';
|
||||||
import 'package:SEFER/controller/home/points_for_rider_controller.dart';
|
import 'package:SEFER/controller/home/points_for_rider_controller.dart';
|
||||||
import 'package:SEFER/views/home/map_page_passenger.dart';
|
|
||||||
import 'package:SEFER/views/home/map_widget.dart/form_serch_multiy_point.dart';
|
import 'package:SEFER/views/home/map_widget.dart/form_serch_multiy_point.dart';
|
||||||
import '../../constant/api_key.dart';
|
import '../../constant/api_key.dart';
|
||||||
import '../../constant/box_name.dart';
|
import '../../constant/box_name.dart';
|
||||||
@@ -201,6 +199,7 @@ class MapPassengerController extends GetxController {
|
|||||||
late String driverToken;
|
late String driverToken;
|
||||||
int carsOrder = 0;
|
int carsOrder = 0;
|
||||||
int wayPointIndex = 0;
|
int wayPointIndex = 0;
|
||||||
|
late double kazan;
|
||||||
String? mapAPIKEY;
|
String? mapAPIKEY;
|
||||||
late double totalME = 0;
|
late double totalME = 0;
|
||||||
late double tax = 0;
|
late double tax = 0;
|
||||||
@@ -2144,15 +2143,12 @@ class MapPassengerController extends GetxController {
|
|||||||
'passengerWalletTotal----- ${box.read(BoxName.passengerWalletTotal)}');
|
'passengerWalletTotal----- ${box.read(BoxName.passengerWalletTotal)}');
|
||||||
|
|
||||||
update();
|
update();
|
||||||
if (currentTime.hour >= 22) {
|
if (currentTime.hour >= 22 && currentTime.hour < 5) {
|
||||||
costDistance = distance * 3.7;
|
costDistance = distance * 3.9;
|
||||||
update();
|
|
||||||
} else if (currentTime.hour < 5) {
|
|
||||||
costDistance = distance * 3.8;
|
|
||||||
update();
|
update();
|
||||||
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
||||||
if (averageDuration > 2.5) {
|
if (averageDuration > 2.5) {
|
||||||
costDistance = distance * 3.9;
|
costDistance = distance * 4;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
costDistance = distance * 3.5;
|
costDistance = distance * 3.5;
|
||||||
@@ -2173,15 +2169,15 @@ class MapPassengerController extends GetxController {
|
|||||||
// update();
|
// update();
|
||||||
// }
|
// }
|
||||||
var totalDriver1 = costDistance + costDuration;
|
var totalDriver1 = costDistance + costDuration;
|
||||||
totalCostPassenger = totalDriver1 + (totalDriver1 * .16);
|
totalCostPassenger = totalDriver1 + (totalDriver1 * kazan / 100);
|
||||||
totalPassenger = totalCostPassenger;
|
totalPassenger = totalCostPassenger;
|
||||||
totalPassengerComfort = totalCostPassenger + (totalCostPassenger * .2);
|
totalPassengerComfort = totalCostPassenger + (totalCostPassenger * .2);
|
||||||
totalPassengerComfortDiscount =
|
totalPassengerComfortDiscount =
|
||||||
totalPassengerComfort + totalPassengerComfort * 12 / 100;
|
totalPassengerComfort + totalPassengerComfort * (kazan - 4) / 100;
|
||||||
totalPassengerMotoDelivery =
|
totalPassengerMotoDelivery =
|
||||||
totalCostPassenger - (totalCostPassenger * .35);
|
totalCostPassenger - (totalCostPassenger * .35);
|
||||||
totalDriver = totalDriver1 + (totalDriver1 * .16);
|
totalDriver = totalDriver1 + (totalDriver1 * kazan / 100);
|
||||||
tax = totalCostPassenger * .16;
|
tax = totalCostPassenger * kazan / 100;
|
||||||
totalME = totalCostPassenger - tax;
|
totalME = totalCostPassenger - tax;
|
||||||
|
|
||||||
if (totalCostPassenger < 1) {
|
if (totalCostPassenger < 1) {
|
||||||
@@ -2295,6 +2291,15 @@ class MapPassengerController extends GetxController {
|
|||||||
recentPlaces = await sql.getAllData(TableName.recentLocations);
|
recentPlaces = await sql.getAllData(TableName.recentLocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getKazanPercent() async {
|
||||||
|
var res = await CRUD().get(link: AppLink.getKazanPercent);
|
||||||
|
if (res != 'failure') {
|
||||||
|
kazan = double.parse(jsonDecode(res)['message'][0]['kazan']);
|
||||||
|
print(res);
|
||||||
|
print(kazan);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||||
@@ -2302,6 +2307,7 @@ class MapPassengerController extends GetxController {
|
|||||||
readyWayPoints();
|
readyWayPoints();
|
||||||
await getLocation();
|
await getLocation();
|
||||||
await addToken();
|
await addToken();
|
||||||
|
await getKazanPercent();
|
||||||
await startMarkerReloading();
|
await startMarkerReloading();
|
||||||
// await getCarsLocationByPassenger();
|
// await getCarsLocationByPassenger();
|
||||||
// await getNearestDriverByPassengerLocation();
|
// await getNearestDriverByPassengerLocation();
|
||||||
|
|||||||
@@ -369,9 +369,11 @@ class MyTranslation extends Translations {
|
|||||||
'Verify Email For Driver': "التحقق من البريد الإلكتروني للسائق",
|
'Verify Email For Driver': "التحقق من البريد الإلكتروني للسائق",
|
||||||
'Admin DashBoard': "لوحة تحكم المدير",
|
'Admin DashBoard': "لوحة تحكم المدير",
|
||||||
'Your name': "إسمك",
|
'Your name': "إسمك",
|
||||||
|
'your ride is applied': 'تم قبول الطلب',
|
||||||
'Your password': "كلمة المرور الخاصة بك",
|
'Your password': "كلمة المرور الخاصة بك",
|
||||||
'H and': 'ساعه و',
|
'H and': 'ساعه و',
|
||||||
'LE': 'جنيه',
|
'LE': 'جنيه',
|
||||||
|
'JOD': 'دينار',
|
||||||
'm': 'دقيقه',
|
'm': 'دقيقه',
|
||||||
"We search nearst Driver to you": "بنبحث عن أقرب سائق ليك",
|
"We search nearst Driver to you": "بنبحث عن أقرب سائق ليك",
|
||||||
"please wait till driver accept your order":
|
"please wait till driver accept your order":
|
||||||
@@ -385,7 +387,7 @@ class MyTranslation extends Translations {
|
|||||||
'The driver on your way': 'الكابتن في طريقه اليك',
|
'The driver on your way': 'الكابتن في طريقه اليك',
|
||||||
'Total price from ': 'المبلغ المطلوب من ',
|
'Total price from ': 'المبلغ المطلوب من ',
|
||||||
'Order Details Speed': 'طلب سريع',
|
'Order Details Speed': 'طلب سريع',
|
||||||
'Order Applied': "نفذ الطلب",
|
'Order Applied': "تم قبول الطلب",
|
||||||
'accepted your order': 'قبل طلبك',
|
'accepted your order': 'قبل طلبك',
|
||||||
'We regret to inform you that another driver has accepted this order.':
|
'We regret to inform you that another driver has accepted this order.':
|
||||||
'نأسف لإبلاغك بأن سائقًا آخر قد قبل هذا الطلب',
|
'نأسف لإبلاغك بأن سائقًا آخر قد قبل هذا الطلب',
|
||||||
@@ -466,7 +468,7 @@ class MyTranslation extends Translations {
|
|||||||
'Distance from Passenger to destination is ':
|
'Distance from Passenger to destination is ':
|
||||||
"المسافة من الراكب إلى الوجهة هي ",
|
"المسافة من الراكب إلى الوجهة هي ",
|
||||||
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
'Cost Of Trip IS ': "تكلفة الرحلة هي ",
|
||||||
'Accept Order': "تم قبول الطلب",
|
'Accept Order': "اقبل الطلب",
|
||||||
'rejct your order.': "رفض طلبك.",
|
'rejct your order.': "رفض طلبك.",
|
||||||
'Bottom Bar Example': "مثال لشريط الأسفل",
|
'Bottom Bar Example': "مثال لشريط الأسفل",
|
||||||
'Statistics': "الإحصائيات",
|
'Statistics': "الإحصائيات",
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|||||||
@@ -208,15 +208,18 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
Icons.arrow_circle_up,
|
Icons.arrow_circle_up,
|
||||||
color: AppColor.greenColor,
|
color: AppColor.greenColor,
|
||||||
),
|
),
|
||||||
Text(myList[12] +
|
Text(
|
||||||
|
myList[12] +
|
||||||
' ' +
|
' ' +
|
||||||
'KM'.tr +
|
'KM'.tr +
|
||||||
' ${myList[11]} ' +
|
' ${myList[11]} ' +
|
||||||
'm'.tr),
|
'm'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
myList[30],
|
myList[29],
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -224,24 +227,36 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.arrow_circle_down,
|
Icons.arrow_circle_down,
|
||||||
color: AppColor.redColor,
|
color: AppColor.redColor,
|
||||||
),
|
),
|
||||||
Text(myList[5] + ' ' + 'KM'.tr),
|
Text(
|
||||||
|
myList[5] +
|
||||||
|
' ' +
|
||||||
|
'KM'.tr +
|
||||||
|
' ${myList[11]} ' +
|
||||||
|
'm'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
myList[31],
|
myList[30] + ' ' + 'KM'.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
@@ -300,36 +315,36 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
// padding: const EdgeInsets.all(8.0),
|
||||||
child: RichText(
|
// child: RichText(
|
||||||
text: TextSpan(
|
// text: TextSpan(
|
||||||
text: 'Distance from Passenger to destination is '.tr,
|
// text: 'Distance from Passenger to destination is '.tr,
|
||||||
style: AppStyle.title,
|
// style: AppStyle.title,
|
||||||
children: [
|
// children: [
|
||||||
TextSpan(
|
// TextSpan(
|
||||||
text: myList[5].toString(),
|
// text: myList[5].toString(),
|
||||||
style: AppStyle.headTitle2),
|
// style: AppStyle.headTitle2),
|
||||||
TextSpan(text: ' KM'.tr, style: AppStyle.title),
|
// TextSpan(text: ' KM'.tr, style: AppStyle.title),
|
||||||
]),
|
// ]),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
// padding: const EdgeInsets.all(8.0),
|
||||||
child: RichText(
|
// child: RichText(
|
||||||
text: TextSpan(
|
// text: TextSpan(
|
||||||
text: 'Duration of Trip is '.tr,
|
// text: 'Duration of Trip is '.tr,
|
||||||
style: AppStyle.title,
|
// style: AppStyle.title,
|
||||||
children: [
|
// children: [
|
||||||
TextSpan(
|
// TextSpan(
|
||||||
text: hours > 1
|
// text: hours > 1
|
||||||
? '${'Your Ride Duration is '.tr}$hours${' H and'.tr} $minutes m'
|
// ? '${'Your Ride Duration is '.tr}$hours${' H and'.tr} $minutes m'
|
||||||
: '${'Your Ride Duration is '.tr} $minutes m',
|
// : '${'Your Ride Duration is '.tr} $minutes m',
|
||||||
style: AppStyle.title),
|
// style: AppStyle.title),
|
||||||
TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
// TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
||||||
]),
|
// ]),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -365,8 +380,8 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
// print(bodyToPassenger);
|
// print(bodyToPassenger);
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
'Apply Ride',
|
'Apply Ride','your ride is applied'.tr,
|
||||||
arguments['DriverList'][9].toString(),
|
// arguments['DriverList'][9].toString(),
|
||||||
arguments['DriverList'][9].toString(),
|
arguments['DriverList'][9].toString(),
|
||||||
// box.read(BoxName.tokenDriver).toString(),
|
// box.read(BoxName.tokenDriver).toString(),
|
||||||
bodyToPassenger,
|
bodyToPassenger,
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
// NotificationController()
|
// NotificationController()
|
||||||
// .showNotification('Order', 'hi this is', 'tone1');
|
// .showNotification('Order', 'hi this is', 'tone1');
|
||||||
// Get.to(() => DriverCallPage());
|
// Get.to(() => DriverCallPage());
|
||||||
print(controller.carLocationsModels);
|
// print(controller.carLocationsModels);
|
||||||
|
controller.getKazanPercent();
|
||||||
// PassengerCallPage(
|
// PassengerCallPage(
|
||||||
// channelName: '',
|
// channelName: '',
|
||||||
// token: '',
|
// token: '',
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ flutter:
|
|||||||
assets:
|
assets:
|
||||||
- assets/
|
- assets/
|
||||||
- assets/images/
|
- assets/images/
|
||||||
- assets/lottie/
|
|
||||||
- assets/fonts/
|
- assets/fonts/
|
||||||
- shorebird.yaml
|
- shorebird.yaml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user