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