2-10/4/1
This commit is contained in:
@@ -54,8 +54,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdk = 23
|
minSdk = 23
|
||||||
targetSdk = flutter.targetSdkVersion
|
targetSdk = flutter.targetSdkVersion
|
||||||
versionCode = 104
|
versionCode = 105
|
||||||
versionName = '1.5.04'
|
versionName = '1.5.05'
|
||||||
multiDexEnabled =true
|
multiDexEnabled =true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class BoxName {
|
|||||||
static const String phoneWallet = "phoneWallet";
|
static const String phoneWallet = "phoneWallet";
|
||||||
static const String IsSavedPhones = "IsSavedPhones";
|
static const String IsSavedPhones = "IsSavedPhones";
|
||||||
static const String carType = "carType";
|
static const String carType = "carType";
|
||||||
|
static const String carTypeOfDriver = "carTypeOfDriver";
|
||||||
static const String isFirstTime = "isFirstTime";
|
static const String isFirstTime = "isFirstTime";
|
||||||
static const String deviceInfo = "deviceInfo";
|
static const String deviceInfo = "deviceInfo";
|
||||||
static const String packagInfo = "packagInfo";
|
static const String packagInfo = "packagInfo";
|
||||||
|
|||||||
@@ -171,16 +171,21 @@ class MapDriverController extends GetxController {
|
|||||||
|
|
||||||
cancelTripFromDriverAfterApplied() async {
|
cancelTripFromDriverAfterApplied() async {
|
||||||
if (formKeyCancel.currentState!.validate()) {
|
if (formKeyCancel.currentState!.validate()) {
|
||||||
CRUD().post(link: AppLink.updateRides, payload: {
|
CRUD().post(
|
||||||
"id": rideId.toString(), // Convert to String
|
link: "${AppLink.seferCairoServer}/ride/rides/update.php",
|
||||||
"status": 'CancelFromDriverAfterApply'
|
payload: {
|
||||||
});
|
"id": rideId.toString(), // Convert to String
|
||||||
CRUD().post(link: AppLink.addCancelTripFromDriverAfterApplied, payload: {
|
"status": 'CancelFromDriverAfterApply'
|
||||||
"order_id": rideId.toString(),
|
});
|
||||||
"driver_id": box.read(BoxName.driverID).toString(),
|
CRUD().post(
|
||||||
"status": 'reject After Applied',
|
link:
|
||||||
"notes": cancelTripCotroller.text.toString()
|
"${AppLink.seferCairoServer}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php",
|
||||||
});
|
payload: {
|
||||||
|
"order_id": rideId.toString(),
|
||||||
|
"driver_id": box.read(BoxName.driverID).toString(),
|
||||||
|
"status": 'reject After Applied',
|
||||||
|
"notes": cancelTripCotroller.text.toString()
|
||||||
|
});
|
||||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||||
"Cancel Trip from driver".tr,
|
"Cancel Trip from driver".tr,
|
||||||
"Trip Cancelled from driver. We are looking for a new driver. Please wait."
|
"Trip Cancelled from driver. We are looking for a new driver. Please wait."
|
||||||
@@ -189,6 +194,38 @@ class MapDriverController extends GetxController {
|
|||||||
[],
|
[],
|
||||||
'cancel.wav',
|
'cancel.wav',
|
||||||
);
|
);
|
||||||
|
CRUD().post(
|
||||||
|
link: "${AppLink.seferGizaServer}/ride/rides/update.php",
|
||||||
|
payload: {
|
||||||
|
"id": rideId.toString(), // Convert to String
|
||||||
|
"status": 'CancelFromDriverAfterApply'
|
||||||
|
});
|
||||||
|
CRUD().post(
|
||||||
|
link: "${AppLink.seferAlexandriaServer}/ride/rides/update.php",
|
||||||
|
payload: {
|
||||||
|
"id": rideId.toString(), // Convert to String
|
||||||
|
"status": 'CancelFromDriverAfterApply'
|
||||||
|
});
|
||||||
|
|
||||||
|
CRUD().post(
|
||||||
|
link:
|
||||||
|
"${AppLink.seferGizaServer}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php",
|
||||||
|
payload: {
|
||||||
|
"order_id": rideId.toString(),
|
||||||
|
"driver_id": box.read(BoxName.driverID).toString(),
|
||||||
|
"status": 'reject After Applied',
|
||||||
|
"notes": cancelTripCotroller.text.toString()
|
||||||
|
});
|
||||||
|
CRUD().post(
|
||||||
|
link:
|
||||||
|
"${AppLink.seferAlexandriaServer}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php",
|
||||||
|
payload: {
|
||||||
|
"order_id": rideId.toString(),
|
||||||
|
"driver_id": box.read(BoxName.driverID).toString(),
|
||||||
|
"status": 'reject After Applied',
|
||||||
|
"notes": cancelTripCotroller.text.toString()
|
||||||
|
});
|
||||||
|
|
||||||
sql.insertData({
|
sql.insertData({
|
||||||
'order_id': rideId,
|
'order_id': rideId,
|
||||||
'created_at': DateTime.now().toString(),
|
'created_at': DateTime.now().toString(),
|
||||||
@@ -256,14 +293,32 @@ class MapDriverController extends GetxController {
|
|||||||
|
|
||||||
void driverGoToPassenger() async {
|
void driverGoToPassenger() async {
|
||||||
changeRideToBeginToPassenger();
|
changeRideToBeginToPassenger();
|
||||||
await CRUD().post(link: AppLink.updateRides, payload: {
|
box.write(BoxName.rideStatus, 'Applied');
|
||||||
'id': rideId,
|
update();
|
||||||
'driverGoToPassengerTime': DateTime.now().toString(),
|
await CRUD().post(
|
||||||
'status': 'Applied'
|
link: "${AppLink.seferCairoServer}/ride/rides/update.php",
|
||||||
});
|
payload: {
|
||||||
|
'id': rideId,
|
||||||
|
'driverGoToPassengerTime': DateTime.now().toString(),
|
||||||
|
'status': 'Applied'
|
||||||
|
});
|
||||||
|
CRUD().post(
|
||||||
|
link: "${AppLink.seferGizaServer}/ride/rides/update.php",
|
||||||
|
payload: {
|
||||||
|
'id': rideId,
|
||||||
|
'driverGoToPassengerTime': DateTime.now().toString(),
|
||||||
|
'status': 'Applied'
|
||||||
|
});
|
||||||
|
CRUD().post(
|
||||||
|
link: "${AppLink.seferAlexandriaServer}/ride/rides/update.php",
|
||||||
|
payload: {
|
||||||
|
'id': rideId,
|
||||||
|
'driverGoToPassengerTime': DateTime.now().toString(),
|
||||||
|
'status': 'Applied'
|
||||||
|
});
|
||||||
|
|
||||||
// Get.find<HomeCaptainController>().changeToAppliedRide('Applied');
|
// Get.find<HomeCaptainController>().changeToAppliedRide('Applied');
|
||||||
box.write(BoxName.rideStatus, 'Applied');
|
|
||||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||||
'DriverIsGoingToPassenger',
|
'DriverIsGoingToPassenger',
|
||||||
box.read(BoxName.name).toString(),
|
box.read(BoxName.name).toString(),
|
||||||
@@ -328,7 +383,7 @@ class MapDriverController extends GetxController {
|
|||||||
double _distance =
|
double _distance =
|
||||||
await calculateDistanceBetweenDriverAndPassengerLocation();
|
await calculateDistanceBetweenDriverAndPassengerLocation();
|
||||||
|
|
||||||
if (_distance < 60) {
|
if (_distance < 70) {
|
||||||
changeRideToBeginToPassenger();
|
changeRideToBeginToPassenger();
|
||||||
isPassengerInfoWindow = false;
|
isPassengerInfoWindow = false;
|
||||||
isRideStarted = true;
|
isRideStarted = true;
|
||||||
@@ -594,7 +649,8 @@ class MapDriverController extends GetxController {
|
|||||||
paymentAmount = totalCost;
|
paymentAmount = totalCost;
|
||||||
box.write(BoxName.statusDriverLocation, 'off');
|
box.write(BoxName.statusDriverLocation, 'off');
|
||||||
// changeRideToBeginToPassenger();
|
// changeRideToBeginToPassenger();
|
||||||
await CRUD().post(link: AppLink.updateRides, payload: {
|
await CRUD()
|
||||||
|
.post(link: "${AppLink.seferCairoServer}/rides/update.php", payload: {
|
||||||
'id': rideId,
|
'id': rideId,
|
||||||
'rideTimeFinish': DateTime.now().toString(),
|
'rideTimeFinish': DateTime.now().toString(),
|
||||||
'status': 'Finished',
|
'status': 'Finished',
|
||||||
|
|||||||
@@ -75,16 +75,16 @@ class OrderRequestController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void getRefusedOrderByCaptain() async {
|
void getRefusedOrderByCaptain() async {
|
||||||
DateTime today = DateTime.now();
|
// Get today's date in YYYY-MM-DD format
|
||||||
int todayDay = today.day;
|
String today = DateTime.now().toString().substring(0, 10);
|
||||||
|
|
||||||
String driverId = box.read(BoxName.driverID).toString();
|
String driverId = box.read(BoxName.driverID).toString();
|
||||||
|
|
||||||
String customQuery = '''
|
String customQuery = '''
|
||||||
SELECT COUNT(*) AS count
|
SELECT COUNT(*) AS count
|
||||||
FROM ${TableName.driverOrdersRefuse}
|
FROM ${TableName.driverOrdersRefuse}
|
||||||
WHERE driver_id = '$driverId'
|
WHERE driver_id = '$driverId'
|
||||||
AND created_at LIKE '%$todayDay%'
|
AND DATE(created_at) = '$today'
|
||||||
''';
|
''';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -114,21 +114,6 @@ class OrderRequestController extends GetxController {
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
void getSQL() async {
|
|
||||||
DateTime today = DateTime.now();
|
|
||||||
int todayDay = today.day;
|
|
||||||
|
|
||||||
String driverId = box.read(BoxName.driverID).toString();
|
|
||||||
|
|
||||||
String customQuery = '''
|
|
||||||
SELECT *
|
|
||||||
FROM ${TableName.driverOrdersRefuse}
|
|
||||||
WHERE driver_id = '$driverId'
|
|
||||||
AND created_at LIKE '%$todayDay%'
|
|
||||||
''';
|
|
||||||
List<Map<String, dynamic>> results = await sql.getCustomQuery(customQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool _timerActive = false;
|
bool _timerActive = false;
|
||||||
|
|
||||||
Future<void> startTimer(String driverID, String orderID) async {
|
Future<void> startTimer(String driverID, String orderID) async {
|
||||||
|
|||||||
@@ -1,19 +1,56 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
import 'package:SEFER/constant/style.dart';
|
||||||
|
import 'package:SEFER/controller/functions/location_controller.dart';
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
|
||||||
import '../../constant/links.dart';
|
import '../../constant/links.dart';
|
||||||
|
import '../../main.dart';
|
||||||
import '../../views/widgets/mydialoug.dart';
|
import '../../views/widgets/mydialoug.dart';
|
||||||
import '../functions/crud.dart';
|
import '../functions/crud.dart';
|
||||||
|
|
||||||
class RideAvailableController extends GetxController {
|
class RideAvailableController extends GetxController {
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
Map rideAvailableMap = {};
|
Map rideAvailableMap = {};
|
||||||
|
late LatLng southwest;
|
||||||
|
late LatLng northeast;
|
||||||
|
LatLngBounds calculateBounds(
|
||||||
|
double centerLat, double centerLng, double radius) {
|
||||||
|
// double radius = 4000; // 10 km in meters
|
||||||
|
|
||||||
|
southwest = LatLng(
|
||||||
|
centerLat - (radius / 111000),
|
||||||
|
centerLng - (radius / (111000 * cos(centerLat))),
|
||||||
|
);
|
||||||
|
|
||||||
|
northeast = LatLng(
|
||||||
|
centerLat + (radius / 111000),
|
||||||
|
centerLng + (radius / (111000 * cos(centerLat))),
|
||||||
|
);
|
||||||
|
|
||||||
|
return LatLngBounds(southwest: southwest, northeast: northeast);
|
||||||
|
}
|
||||||
|
|
||||||
getRideAvailable() async {
|
getRideAvailable() async {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
var res = await CRUD().get(link: AppLink.getRideWaiting, payload: {});
|
LatLngBounds bounds = calculateBounds(
|
||||||
|
Get.find<LocationController>().myLocation.latitude,
|
||||||
|
Get.find<LocationController>().myLocation.longitude,
|
||||||
|
4000);
|
||||||
|
var res = await CRUD().get(
|
||||||
|
link: AppLink.getRideWaiting,
|
||||||
|
payload: {
|
||||||
|
"carType": box.read(BoxName.carTypeOfDriver),
|
||||||
|
'southwestLat': bounds.southwest.latitude.toString(),
|
||||||
|
'southwestLon': bounds.southwest.longitude.toString(),
|
||||||
|
'northeastLat': bounds.northeast.latitude.toString(),
|
||||||
|
'northeastLon': bounds.northeast.longitude.toString(),
|
||||||
|
},
|
||||||
|
);
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
rideAvailableMap = jsonDecode(res);
|
rideAvailableMap = jsonDecode(res);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
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/functions/launch.dart';
|
|
||||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ class UserAccountHeader extends StatelessWidget {
|
|||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
image: NetworkImage(
|
image: NetworkImage(
|
||||||
'${AK.serverPHP}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg',
|
'${AppLink.seferCairoServer}/portrate_captain_image/${box.read(BoxName.driverID)}.jpg',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -212,82 +212,82 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
AnimatedContainer(
|
// AnimatedContainer(
|
||||||
duration: const Duration(microseconds: 200),
|
// duration: const Duration(microseconds: 200),
|
||||||
width: controller.widthMapTypeAndTraffic,
|
// width: controller.widthMapTypeAndTraffic,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
color: AppColor.secondaryColor,
|
// color: AppColor.secondaryColor,
|
||||||
border: Border.all(color: AppColor.blueColor),
|
// border: Border.all(color: AppColor.blueColor),
|
||||||
borderRadius: BorderRadius.circular(15)),
|
// borderRadius: BorderRadius.circular(15)),
|
||||||
child: Builder(builder: (context) {
|
// child: Builder(builder: (context) {
|
||||||
return IconButton(
|
// return IconButton(
|
||||||
onPressed: () async {
|
// onPressed: () async {
|
||||||
Get.to(() => LoginCaptin());
|
// Get.to(() => LoginCaptin());
|
||||||
// print(box.read(BoxName.myList));
|
// // print(box.read(BoxName.myList));
|
||||||
|
|
||||||
// List<String> d = [
|
// // List<String> d = [
|
||||||
// "30.003028,31.2419628",
|
// // "30.003028,31.2419628",
|
||||||
// "30.0955661,31.2665336",
|
// // "30.0955661,31.2665336",
|
||||||
// "160.00",
|
// // "160.00",
|
||||||
// "25.92",
|
// // "25.92",
|
||||||
// "1488",
|
// // "1488",
|
||||||
// "16.93",
|
// // "16.93",
|
||||||
// "114243034311436865474",
|
// // "114243034311436865474",
|
||||||
// "113172279072358305645",
|
// // "113172279072358305645",
|
||||||
// "hamza ayed",
|
// // "hamza ayed",
|
||||||
// "rlMbi4Hc8L1STMPE99iPKqK4Gddwv8r9qZOCadsz9qTEJZ6KLEE9ruTJI6N8dKfK4CXez5pme5WIs14-1QGo29s07fQOniZgIlJV5XFL3yqzPRSUmn3",
|
// // "rlMbi4Hc8L1STMPE99iPKqK4Gddwv8r9qZOCadsz9qTEJZ6KLEE9ruTJI6N8dKfK4CXez5pme5WIs14-1QGo29s07fQOniZgIlJV5XFL3yqzPRSUmn3",
|
||||||
// "+201023248456",
|
// // "+201023248456",
|
||||||
// "1 min",
|
// // "1 min",
|
||||||
// "1 m",
|
// // "1 m",
|
||||||
// "false",
|
// // "false",
|
||||||
// "QwUMoyUtZ0J3oR6yXKUavrB_gBl9npUZe-qZtax-Raq4QBbdKv0AmtLKm0BfBd6N_592HBv4CVa41ii4122W3hr-BCUKKzJhzZcK8m0YjbWbtpvgJRD8uD_nuMk9",
|
// // "QwUMoyUtZ0J3oR6yXKUavrB_gBl9npUZe-qZtax-Raq4QBbdKv0AmtLKm0BfBd6N_592HBv4CVa41ii4122W3hr-BCUKKzJhzZcK8m0YjbWbtpvgJRD8uD_nuMk9",
|
||||||
// "0",
|
// // "0",
|
||||||
// "238",
|
// // "238",
|
||||||
// "false",
|
// // "false",
|
||||||
// "114243034311436865474",
|
// // "114243034311436865474",
|
||||||
// "1488",
|
// // "1488",
|
||||||
// "startEnd",
|
// // "startEnd",
|
||||||
// "30.049307749732176,31.274291574954987",
|
// // "30.049307749732176,31.274291574954987",
|
||||||
// "",
|
// // "",
|
||||||
// "",
|
// // "",
|
||||||
// "",
|
// // "",
|
||||||
// "",
|
// // "",
|
||||||
// "17.73",
|
// // "17.73",
|
||||||
// "0",
|
// // "0",
|
||||||
// "hamzaayedflutter@gmail.com",
|
// // "hamzaayedflutter@gmail.com",
|
||||||
// "الفسطاط، حي مصر القديمة، مصر",
|
// // "الفسطاط، حي مصر القديمة، مصر",
|
||||||
// " الزاوية الحمراء، محافظة القاهرة، مصر",
|
// // " الزاوية الحمراء، محافظة القاهرة، مصر",
|
||||||
// "Speed",
|
// // "Speed",
|
||||||
// "8",
|
// // "8",
|
||||||
// "5.00"
|
// // "5.00"
|
||||||
// ];
|
// // ];
|
||||||
// FirebaseMessagesController().sendNotificationToDriverMAP(
|
// // FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||||
// 'Order'.tr,
|
// // 'Order'.tr,
|
||||||
// 'from: ',
|
// // 'from: ',
|
||||||
// // jsonDecode(value)['message'].toString(),
|
// // // jsonDecode(value)['message'].toString(),
|
||||||
// 'fKBBB4_1R0q18-byySHUeG:APA91bHk2RmjjMt6eKr7KQnqh4CK02yW3H5E8g_beVcQFgiCG50j9KCtSU1O8PtvS_gA5xuJLhaorDV9AeslcyLFJFf302tICKMiKgsDP5pWkF5WXNw0-4NsoD-BnJxf0-Do9Vs1Zbpq',
|
// // 'fKBBB4_1R0q18-byySHUeG:APA91bHk2RmjjMt6eKr7KQnqh4CK02yW3H5E8g_beVcQFgiCG50j9KCtSU1O8PtvS_gA5xuJLhaorDV9AeslcyLFJFf302tICKMiKgsDP5pWkF5WXNw0-4NsoD-BnJxf0-Do9Vs1Zbpq',
|
||||||
// d,
|
// // d,
|
||||||
// 'order.wav');
|
// // 'order.wav');
|
||||||
// NotificationController()
|
// // NotificationController()
|
||||||
// .showNotification('VIP Order'.tr, '', 'order', '');
|
// // .showNotification('VIP Order'.tr, '', 'order', '');
|
||||||
// try {} catch (e) {
|
// // try {} catch (e) {
|
||||||
// print('Error showing overlay: $e');
|
// // print('Error showing overlay: $e');
|
||||||
// }
|
// // }
|
||||||
// final Bubble _bubble = Bubble(showCloseButton: true);
|
// // final Bubble _bubble = Bubble(showCloseButton: true);
|
||||||
// try {
|
// // try {
|
||||||
// await _bubble.startBubbleHead(sendAppToBackground: false);
|
// // await _bubble.startBubbleHead(sendAppToBackground: false);
|
||||||
// } on PlatformException {
|
// // } on PlatformException {
|
||||||
// print('Failed to call startBubbleHead');
|
// // print('Failed to call startBubbleHead');
|
||||||
// }
|
// // }
|
||||||
},
|
// },
|
||||||
icon: const Icon(
|
// icon: const Icon(
|
||||||
FontAwesome5.grin_tears,
|
// FontAwesome5.grin_tears,
|
||||||
size: 29,
|
// size: 29,
|
||||||
color: AppColor.blueColor,
|
// color: AppColor.blueColor,
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}),
|
// }),
|
||||||
),
|
// ),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user