9/11/1
This commit is contained in:
2
.env
2
.env
@@ -19,6 +19,8 @@ seferAlexandriaServer=https://seferalexandria.site/sefer
|
||||
seferPaymentServer=https://seferpw.shop/sefer
|
||||
seferCairoServer=https://sefer.click/sefer
|
||||
seferGizaServer=https://sefergiza.site/sefer
|
||||
anthropicAIkeySeferNewHamzaayedpython=zg-qbc-qvo39-vCB-WnzEwFNArO0YlTapvfhtmguKWsXJSKqg_NZSjHBYVXMZK1yUK88SobdckV0KuPaBh0c_WHtGsRO_439PBk-e2QqgkQQXrXlBl
|
||||
|
||||
privateKeyFCM='''{
|
||||
"type": "service_account",
|
||||
"project_id": "ride-b1bd8",
|
||||
|
||||
@@ -54,8 +54,8 @@ android {
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdk = 23
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = 79
|
||||
versionName = '1.5.79'
|
||||
versionCode = 83
|
||||
versionName = '1.5.83'
|
||||
multiDexEnabled =true
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'box_name.dart';
|
||||
|
||||
class AppLink {
|
||||
static final String seferPaymentServer0 = Env.seferPaymentServer;
|
||||
static final String seferPaymentServer = '${Env.seferCairoServer}/ride';
|
||||
static final String seferPaymentServer = '${Env.seferPaymentServer}/ride';
|
||||
static final String seferAlexandriaServer = Env.seferAlexandriaServer;
|
||||
static final String seferCairoServer = Env.seferCairoServer;
|
||||
static final String seferGizaServer = Env.seferGizaServer;
|
||||
|
||||
@@ -18,6 +18,7 @@ import '../../views/auth/captin/criminal_documents_page.dart';
|
||||
import '../../views/home/Captin/home_captain/home_captin.dart';
|
||||
import '../../views/home/Captin/orderCaptin/order_speed_request.dart';
|
||||
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
||||
import '../../views/home/Captin/orderCaptin/vip_order_page.dart';
|
||||
import '../auth/google_sign.dart';
|
||||
import '../functions/face_detect.dart';
|
||||
import 'access_token.dart';
|
||||
@@ -80,28 +81,28 @@ class FirebaseMessagesController extends GetxController {
|
||||
}
|
||||
});
|
||||
FirebaseMessaging.onBackgroundMessage((RemoteMessage message) async {
|
||||
if (message.notification!.title! == 'Order'.tr) {
|
||||
if (Platform.isAndroid) {
|
||||
NotificationController()
|
||||
.showNotification('Order'.tr, '', 'order', 'order_page_payload');
|
||||
}
|
||||
// await FirebaseMessagesController().showOverlayNotification(message);
|
||||
var myListString = message.data['DriverList'];
|
||||
// var points = message.data['PolylineJson'];
|
||||
// if (message.notification!.title! == 'Order'.tr) {
|
||||
// if (Platform.isAndroid) {
|
||||
// NotificationController()
|
||||
// .showNotification('Order'.tr, '', 'order', 'order_page_payload');
|
||||
// }
|
||||
// // await FirebaseMessagesController().showOverlayNotification(message);
|
||||
// var myListString = message.data['DriverList'];
|
||||
// // var points = message.data['PolylineJson'];
|
||||
|
||||
var myList = jsonDecode(myListString) as List<dynamic>;
|
||||
// var myPoints = jsonDecode(points) as List<dynamic>;
|
||||
driverToken = myList[14].toString();
|
||||
// This is for location using and uploading status
|
||||
Get.put(HomeCaptainController()).changeRideId();
|
||||
update();
|
||||
Get.to(() => OrderRequestPage(), arguments: {
|
||||
'myListString': myListString,
|
||||
'DriverList': myList,
|
||||
// 'PolylineJson': myPoints,
|
||||
'body': message.notification!.body
|
||||
});
|
||||
}
|
||||
// var myList = jsonDecode(myListString) as List<dynamic>;
|
||||
// // var myPoints = jsonDecode(points) as List<dynamic>;
|
||||
// driverToken = myList[14].toString();
|
||||
// // This is for location using and uploading status
|
||||
// Get.put(HomeCaptainController()).changeRideId();
|
||||
// update();
|
||||
// Get.to(() => OrderRequestPage(), arguments: {
|
||||
// 'myListString': myListString,
|
||||
// 'DriverList': myList,
|
||||
// // 'PolylineJson': myPoints,
|
||||
// 'body': message.notification!.body
|
||||
// });
|
||||
// }
|
||||
});
|
||||
|
||||
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
||||
@@ -138,6 +139,23 @@ class FirebaseMessagesController extends GetxController {
|
||||
// 'Cancel Trip'.tr, 'Passenger Cancel Trip'.tr, 'cancel', '');
|
||||
// }
|
||||
cancelTripDialog();
|
||||
} else if (message.notification!.title == 'VIP Order') {
|
||||
var myListString = message.data['DriverList'];
|
||||
var driverList = jsonDecode(myListString) as List<dynamic>;
|
||||
if (Platform.isAndroid) {
|
||||
NotificationController()
|
||||
.showNotification('VIP Order'.tr, '', 'order', '');
|
||||
}
|
||||
MyDialog().getDialog('VIP Order'.tr, 'midTitle', () {
|
||||
sendNotificationToPassengerToken(
|
||||
'VIP Order Accepted'.tr,
|
||||
'The driver accepted your trip'.tr,
|
||||
driverList[0],
|
||||
[driverList[1]],
|
||||
'order');
|
||||
});
|
||||
|
||||
// Get.to(const VipOrderPage());
|
||||
} else if (message.notification!.title == 'Cancel') {
|
||||
cancelTripDialog1();
|
||||
} else if (message.notification!.title! == 'token change') {
|
||||
|
||||
@@ -87,28 +87,29 @@ class LocationController extends GetxController {
|
||||
|
||||
switch (area) {
|
||||
case 'Cairo':
|
||||
endpoint = AppLink.addCarsLocationCairoEndpoint;
|
||||
box.write(BoxName.serverChosen, AppLink.seferCairoServer);
|
||||
endpoint = AppLink.addCarsLocationCairoEndpoint;
|
||||
Log.print('Endpoint: $endpoint');
|
||||
break;
|
||||
case 'Giza':
|
||||
box.write(BoxName.serverChosen, AppLink.seferGizaServer);
|
||||
endpoint = AppLink.addCarsLocationGizaEndpoint;
|
||||
Log.print('Endpoint: $endpoint');
|
||||
box.write(BoxName.serverChosen, AppLink.seferGizaServer);
|
||||
break;
|
||||
case 'Alexandria':
|
||||
endpoint = AppLink.addCarsLocationAlexandriaEndpoint;
|
||||
Log.print('Endpoint: $endpoint');
|
||||
box.write(
|
||||
BoxName.serverChosen, AppLink.seferAlexandriaServer);
|
||||
endpoint = AppLink.addCarsLocationAlexandriaEndpoint;
|
||||
Log.print('Endpoint: $endpoint');
|
||||
break;
|
||||
case 'Outside':
|
||||
// Handle cases outside of Cairo, Giza, and Alexandria
|
||||
print('Location outside Cairo, Giza, or Alexandria');
|
||||
|
||||
box.write(BoxName.serverChosen, AppLink.seferCairoServer);
|
||||
endpoint = AppLink
|
||||
.addCarsLocationCairoEndpoint; // Fallback to Cairo endpoint
|
||||
Log.print('Fallback Endpoint: $endpoint');
|
||||
box.write(BoxName.serverChosen, AppLink.seferCairoServer);
|
||||
break;
|
||||
default:
|
||||
// Handle any other unexpected cases
|
||||
|
||||
@@ -566,12 +566,14 @@ class MapDriverController extends GetxController {
|
||||
// Get.find<HomeCaptainController>().changeToAppliedRide('Finished');
|
||||
// Get.find<HomeCaptainController>().update();
|
||||
totalCost = price < 30
|
||||
? carType != 'Comfort' && carType != 'Mashwari' && carType != 'Lady'
|
||||
? carType != 'Comfort' && carType != 'Mishwar Vip' && carType != 'Lady'
|
||||
? '20'
|
||||
: '30'
|
||||
: price < double.parse(totalPricePassenger)
|
||||
? totalPricePassenger
|
||||
: carType != 'Comfort' && carType != 'Mashwari' && carType != 'Lady'
|
||||
: carType != 'Comfort' &&
|
||||
carType != 'Mishwar Vip' &&
|
||||
carType != 'Lady'
|
||||
? totalPricePassenger
|
||||
: price.toStringAsFixed(2);
|
||||
paymentAmount = totalCost;
|
||||
@@ -633,7 +635,7 @@ class MapDriverController extends GetxController {
|
||||
box.read(BoxName.driverID),
|
||||
rideId,
|
||||
box.read(BoxName.tokenDriver),
|
||||
// carType == 'Comfort' || carType == 'Mashwari'
|
||||
// carType == 'Comfort' || carType == 'Mishwar Vip'
|
||||
// ? price.toStringAsFixed(2)
|
||||
// : totalPassenger
|
||||
paymentAmount.toString()
|
||||
@@ -681,44 +683,178 @@ class MapDriverController extends GetxController {
|
||||
|
||||
int rideTimerFromBegin = 0;
|
||||
double price = 0;
|
||||
DateTime currentTime = DateTime.now();
|
||||
void rideIsBeginPassengerTimer() async {
|
||||
int durationOfRide = int.parse(durationOfRideValue);
|
||||
update();
|
||||
int infinity = 40000;
|
||||
if (carType == 'Comfort' ||
|
||||
carType == 'Mashwari' ||
|
||||
carType == 'Rayeh Gai') {
|
||||
carType == 'Mishwar Vip' ||
|
||||
carType == 'RayehGaiComfort') {
|
||||
durationOfRide = infinity;
|
||||
update();
|
||||
}
|
||||
if (carType != 'Comfort' ||
|
||||
carType != 'Mishwar Vip' ||
|
||||
carType != 'Lady' ||
|
||||
carType != 'RayehGaiComfort') {
|
||||
price = double.parse(totalCost);
|
||||
update();
|
||||
}
|
||||
for (int i = 0; i <= durationOfRide; i++) {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
recentDistanceToDash = Get.find<LocationController>().totalDistance;
|
||||
rideTimerFromBegin = i;
|
||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||
? (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'Speed'
|
||||
? (i ~/ 60) +
|
||||
|
||||
if (startNameLocation.toLowerCase().contains('airport') ||
|
||||
endNameLocation.toLowerCase().contains('airport') ||
|
||||
startNameLocation.contains('مطار') ||
|
||||
startNameLocation.contains('المطار') ||
|
||||
endNameLocation.contains('مطار') ||
|
||||
endNameLocation.contains('المطار')) {
|
||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||
20 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
|
||||
// : carType == 'Speed'
|
||||
// ? (i ~/ 60) +
|
||||
// (recentDistanceToDash *
|
||||
// Get.find<HomeCaptainController>().speedPrice)
|
||||
: carType == 'Lady'
|
||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||
20 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
// : carType == 'Delivery'
|
||||
// ? (i ~/ 60) +
|
||||
// (recentDistanceToDash *
|
||||
// Get.find<HomeCaptainController>().deliveryPrice)
|
||||
: carType == 'RayehGaiComfort'
|
||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||
20 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||
20 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().mashwariPrice);
|
||||
} else if (currentTime.hour >= 21 && currentTime.hour < 0) {
|
||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||
20 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
|
||||
// : carType == 'Speed'
|
||||
// ? (i ~/ 60) +
|
||||
// (recentDistanceToDash *
|
||||
// Get.find<HomeCaptainController>().speedPrice)
|
||||
: carType == 'Lady'
|
||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||
20 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
// : carType == 'Delivery'
|
||||
// ? (i ~/ 60) +
|
||||
// (recentDistanceToDash *
|
||||
// Get.find<HomeCaptainController>().deliveryPrice)
|
||||
: carType == 'RayehGaiComfort'
|
||||
? (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||
20 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: (i ~/ 60) * Get.find<HomeCaptainController>().latePrice +
|
||||
20 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().mashwariPrice);
|
||||
} else if (currentTime.hour >= 1 && currentTime.hour < 5) {
|
||||
if (startNameLocation.contains('club') ||
|
||||
startNameLocation.contains('nightclub') ||
|
||||
startNameLocation.contains('ديسكو') ||
|
||||
startNameLocation.contains('ملهى ليلي') ||
|
||||
startNameLocation.contains('Night club')) {
|
||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||
? (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().latePrice + .5) *
|
||||
2 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().speedPrice)
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'Lady'
|
||||
? (i ~/ 60) +
|
||||
? (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().latePrice + .5) *
|
||||
2 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'Delivery'
|
||||
? (i ~/ 60) +
|
||||
: carType == 'RayehGaiComfort'
|
||||
? (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().latePrice +
|
||||
.5) *
|
||||
2 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().deliveryPrice)
|
||||
: carType == 'Rayeh Gai'
|
||||
? (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().speedPrice)
|
||||
: (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>()
|
||||
.mashwariPrice); // $1 for each minute + $4 for each km
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().latePrice +
|
||||
.5) *
|
||||
2 +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().mashwariPrice);
|
||||
}
|
||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||
? (i ~/ 60) * (Get.find<HomeCaptainController>().latePrice + .5) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'Lady'
|
||||
? (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().latePrice + .5) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'RayehGaiComfort'
|
||||
? (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().latePrice + .5) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().latePrice + .5) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().mashwariPrice);
|
||||
} else if (currentTime.hour >= 14 && currentTime.hour <= 17) {
|
||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||
? (i ~/ 60) * (Get.find<HomeCaptainController>().heavyPrice) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'Lady'
|
||||
? (i ~/ 60) * (Get.find<HomeCaptainController>().heavyPrice) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'RayehGaiComfort'
|
||||
? (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().heavyPrice) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: (i ~/ 60) *
|
||||
(Get.find<HomeCaptainController>().heavyPrice) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().mashwariPrice);
|
||||
} else {
|
||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||
? (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'Lady'
|
||||
? (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: carType == 'RayehGaiComfort'
|
||||
? (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().comfortPrice)
|
||||
: (i ~/ 60) +
|
||||
(recentDistanceToDash *
|
||||
Get.find<HomeCaptainController>().mashwariPrice);
|
||||
}
|
||||
// $1 for each minute + $4 for each km
|
||||
price = (price * double.parse(kazan)) + price; // Add 10% tax
|
||||
speed = Get.find<LocationController>().speed * 3.6;
|
||||
progressTimerRideBegin = i / durationOfRide;
|
||||
|
||||
@@ -113,14 +113,16 @@ class MyTranslation extends Translations {
|
||||
"National Bank of Greece": "البنك الوطني اليوناني",
|
||||
"Central Bank Of Egypt": "البنك المركزي المصري",
|
||||
"ATTIJARIWAFA BANK Egypt": "البنك التجاري وفا مصر",
|
||||
"Morning Promo": "عرض الصباح",
|
||||
"Morning Promo": "بونص الصباح",
|
||||
"VIP Order": "طلب VIP", "VIP Order Accepted": "تم قبول طلب VIP.",
|
||||
"The driver accepted your trip": "السائق قبل رحلتك.",
|
||||
"this is count of your all trips in the morning promo today from 7:00am-10:00am":
|
||||
"هذا عدد جميع رحلاتك في عرض الصباح اليوم من الساعة 7:00 صباحًا حتى 10:00 صباحًا",
|
||||
"هذا عدد جميع رحلاتك في بونص الصباح اليوم من الساعة 7:00 صباحًا حتى 10:00 صباحًا",
|
||||
"Morning Promo Rides": "رحلات عرض الصباح",
|
||||
"Afternoon Promo": "عرض بعد الظهر",
|
||||
"Afternoon Promo": "بونص الظهر",
|
||||
"this is count of your all trips in the Afternoon promo today from 3:00pm-6:00 pm":
|
||||
"هذا عدد جميع رحلاتك في عرض بعد الظهر اليوم من الساعة 3:00 مساءً حتى 6:00 مساءً",
|
||||
"Afternoon Promo Rides": "رحلات عرض بعد الظهر",
|
||||
"هذا عدد جميع رحلاتك في بونص بعد الظهر اليوم من الساعة 3:00 مساءً حتى 6:00 مساءً",
|
||||
"Afternoon Promo Rides": "رحلات بونص بعد الظهر",
|
||||
"Heading your way now. Please be ready.":
|
||||
"في طريقي إليك الآن. يرجى الاستعداد.",
|
||||
"Approaching your area. Should be there in 3 minutes.":
|
||||
|
||||
@@ -36,9 +36,12 @@ final PaymobPayment paymobPayment = PaymobPayment();
|
||||
final PaymobPaymentWallet paymobPaymentWallet = PaymobPaymentWallet();
|
||||
DbSql sql = DbSql.instance;
|
||||
|
||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
@pragma('vm:entry-point')
|
||||
Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
await Firebase.initializeApp();
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
if (message.notification != null && message.notification!.title != null) {
|
||||
if (message.notification?.title == 'Order' ||
|
||||
@@ -47,7 +50,7 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
Log.print('myListString: $myListString');
|
||||
|
||||
// Decode the JSON string to a list
|
||||
var myList;
|
||||
List<dynamic> myList;
|
||||
try {
|
||||
myList = jsonDecode(myListString) as List<dynamic>;
|
||||
} catch (e) {
|
||||
@@ -55,7 +58,7 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
myList = [];
|
||||
}
|
||||
|
||||
Future.delayed(const Duration(seconds: 1));
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
NotificationController().showNotification(
|
||||
message.notification!.title.toString(),
|
||||
message.notification!.body.toString(),
|
||||
@@ -67,6 +70,7 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
if (isOverlayActive) {
|
||||
await FlutterOverlayWindow.closeOverlay();
|
||||
}
|
||||
|
||||
await FlutterOverlayWindow.showOverlay(
|
||||
enableDrag: true,
|
||||
flag: OverlayFlag.focusPointer,
|
||||
@@ -78,8 +82,6 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
);
|
||||
|
||||
await FlutterOverlayWindow.shareData(myList);
|
||||
|
||||
// Bubble().startBubbleHead(sendAppToBackground: true);
|
||||
}
|
||||
} else {
|
||||
FirebaseMessagesController().fireBaseTitles(message);
|
||||
@@ -87,8 +89,6 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
}
|
||||
}
|
||||
|
||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
@pragma('vm:entry-point')
|
||||
void overlayMain() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -105,21 +105,18 @@ void closeOverLay() {
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
WakelockPlus.enable();
|
||||
// Request location permission first
|
||||
await WakelockPlus.enable();
|
||||
|
||||
// Request location permission
|
||||
PermissionStatus status = await Permission.location.request();
|
||||
if (status.isDenied) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
getPermissionLocation();
|
||||
});
|
||||
// Handle the case when permission is denied
|
||||
// You might want to show a dialog explaining why the permission is needed
|
||||
return;
|
||||
}
|
||||
// Set up the overlay entry point
|
||||
// FlutterOverlayWindow.overlayMain = overlayMain;
|
||||
await LocationController().startLocationUpdates();
|
||||
|
||||
await LocationController().startLocationUpdates();
|
||||
await GetStorage.init();
|
||||
Stripe.publishableKey = AK.publishableKeyStripe;
|
||||
|
||||
@@ -131,12 +128,12 @@ void main() async {
|
||||
|
||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
||||
NotificationController().initNotifications();
|
||||
List<Future> initializationTasks = [
|
||||
|
||||
await Future.wait([
|
||||
FirebaseMessagesController().getNotificationSettings(),
|
||||
FirebaseMessagesController().getToken(),
|
||||
];
|
||||
]);
|
||||
|
||||
await Future.wait(initializationTasks);
|
||||
SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
@@ -160,8 +157,6 @@ void main() async {
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
LocaleController localController = Get.put(LocaleController());
|
||||
@@ -172,18 +167,14 @@ class MyApp extends StatelessWidget {
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: localController.language,
|
||||
theme: localController.appTheme,
|
||||
key: UniqueKey(),
|
||||
initialRoute: '/',
|
||||
// home: SplashScreen(),
|
||||
routes: {
|
||||
'/order': (context) => OrderRequestPage(),
|
||||
},
|
||||
getPages: [
|
||||
GetPage(name: '/', page: () => SplashScreen()),
|
||||
GetPage(
|
||||
name: '/order-page',
|
||||
page: () => OrderRequestPage(),
|
||||
arguments: box.read(BoxName.rideArguments)),
|
||||
name: '/order-page',
|
||||
page: () => OrderRequestPage(),
|
||||
arguments: box.read(BoxName.rideArguments),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import '../../../../../constant/colors.dart';
|
||||
import '../../../../../constant/links.dart';
|
||||
import '../../../../../controller/firebase/firbase_messge.dart';
|
||||
import '../../../../../print.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
@@ -270,34 +271,35 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// 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 {
|
||||
// FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
// 'Order'.tr,
|
||||
// 'from: ',
|
||||
// // jsonDecode(value)['message'].toString(),
|
||||
// 'dEugS-JOT4Ka5riF4s5TEN:APA91bEDL_W7BuEQGbyL-RMaKiMWDlURXhFuaybe5WurTUV8K5eIooSGe22yY22_U2hEZcfPr46ig1v--l00dbOGiivazxvmTyhUyQQW6lJsuIN-wordGtBxtREyeYtEKvxIa1J4ApEu',
|
||||
// 'order.wav'
|
||||
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 {
|
||||
// FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
// 'Order'.tr,
|
||||
// 'from: ',
|
||||
// // jsonDecode(value)['message'].toString(),
|
||||
// 'dEugS-JOT4Ka5riF4s5TEN:APA91bEDL_W7BuEQGbyL-RMaKiMWDlURXhFuaybe5WurTUV8K5eIooSGe22yY22_U2hEZcfPr46ig1v--l00dbOGiivazxvmTyhUyQQW6lJsuIN-wordGtBxtREyeYtEKvxIa1J4ApEu',
|
||||
// 'order.wav'
|
||||
|
||||
// // polylineCoordinates.toString()
|
||||
// );
|
||||
// },
|
||||
// icon: const Icon(
|
||||
// FontAwesome5.closed_captioning,
|
||||
// size: 29,
|
||||
// color: AppColor.blueColor,
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// // polylineCoordinates.toString()
|
||||
// );
|
||||
print(AppLink.addDriverPaymentPoints);
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.closed_captioning,
|
||||
size: 29,
|
||||
color: AppColor.blueColor,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
)),
|
||||
);
|
||||
|
||||
@@ -63,7 +63,8 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
)
|
||||
: const SizedBox(),
|
||||
mapDriverController.carType != 'Speed' &&
|
||||
mapDriverController.carType != 'Delivery'
|
||||
mapDriverController.carType != 'Delivery' &&
|
||||
mapDriverController.carType != 'Balash'
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
|
||||
16
lib/views/home/Captin/orderCaptin/vip_order_page.dart
Normal file
16
lib/views/home/Captin/orderCaptin/vip_order_page.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class VipOrderPage extends StatelessWidget {
|
||||
const VipOrderPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'VIP Order'.tr,
|
||||
body: [],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -398,26 +398,26 @@ class WalletCaptain extends StatelessWidget {
|
||||
|
||||
GetBuilder<CaptainWalletController>(
|
||||
builder: (captainWalletController) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .9,
|
||||
// height: Get.height * .1,
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
child: Stack(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
MyDialog().getDialog(
|
||||
'Morning Promo'.tr,
|
||||
"this is count of your all trips in the morning promo today from 7:00am-10:00am"
|
||||
.tr, () {
|
||||
Get.back();
|
||||
});
|
||||
},
|
||||
child: LinearProgressIndicator(
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
MyDialog().getDialog(
|
||||
'Morning Promo'.tr,
|
||||
"this is count of your all trips in the morning promo today from 7:00am-10:00am"
|
||||
.tr, () {
|
||||
Get.back();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .9,
|
||||
// height: Get.height * .1,
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
child: Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
minHeight: 35,
|
||||
color: AppColor.blueColor,
|
||||
borderRadius:
|
||||
@@ -431,53 +431,53 @@ class WalletCaptain extends StatelessWidget {
|
||||
.toString()) /
|
||||
5,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Morning Promo Rides'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
'${captainWalletController.walletDate['message'][0]['morning_count']} / 5',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Morning Promo Rides'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
'${captainWalletController.walletDate['message'][0]['morning_count']} / 5',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
GetBuilder<CaptainWalletController>(
|
||||
builder: (captainWalletController) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .9,
|
||||
// height: Get.height * .1,
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
child: Stack(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
MyDialog().getDialog(
|
||||
'Afternoon Promo'.tr,
|
||||
"this is count of your all trips in the Afternoon promo today from 3:00pm-6:00 pm"
|
||||
.tr, () {
|
||||
Get.back();
|
||||
});
|
||||
},
|
||||
child: LinearProgressIndicator(
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
MyDialog().getDialog(
|
||||
'Afternoon Promo'.tr,
|
||||
"this is count of your all trips in the Afternoon promo today from 3:00pm-6:00 pm"
|
||||
.tr, () {
|
||||
Get.back();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .9,
|
||||
// height: Get.height * .1,
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
child: Stack(
|
||||
children: [
|
||||
LinearProgressIndicator(
|
||||
minHeight: 35,
|
||||
color: AppColor.blueColor,
|
||||
borderRadius:
|
||||
@@ -491,28 +491,28 @@ class WalletCaptain extends StatelessWidget {
|
||||
.toString()) /
|
||||
5,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Afternoon Promo Rides'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
'${captainWalletController.walletDate['message'][0]['afternoon_count']} / 5',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Afternoon Promo Rides'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Text(
|
||||
'${captainWalletController.walletDate['message'][0]['afternoon_count']} / 5',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
@@ -37,15 +37,16 @@ class MyDialog extends GetxController {
|
||||
),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('Cancel', style: TextStyle(color: AppColor.redColor)),
|
||||
child: const Text('Cancel',
|
||||
style: TextStyle(color: AppColor.redColor)),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child:
|
||||
Text('OK'.tr, style: TextStyle(color: AppColor.greenColor)),
|
||||
onPressed: onPressed,
|
||||
child: Text('OK'.tr,
|
||||
style: const TextStyle(color: AppColor.greenColor)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -84,15 +85,16 @@ class MyDialogContent extends GetxController {
|
||||
),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('Cancel', style: TextStyle(color: AppColor.redColor)),
|
||||
child: const Text('Cancel',
|
||||
style: TextStyle(color: AppColor.redColor)),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child:
|
||||
Text('OK'.tr, style: TextStyle(color: AppColor.greenColor)),
|
||||
onPressed: onPressed,
|
||||
child: Text('OK'.tr,
|
||||
style: const TextStyle(color: AppColor.greenColor)),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user