10/26/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 = 109
|
versionCode = 111
|
||||||
versionName = '1.5.09'
|
versionName = '1.5.11'
|
||||||
multiDexEnabled =true
|
multiDexEnabled =true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
assets/images/arrow.png
Normal file
BIN
assets/images/arrow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB |
BIN
assets/images/s.png
Normal file
BIN
assets/images/s.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
assets/order1.wav
Normal file
BIN
assets/order1.wav
Normal file
Binary file not shown.
@@ -20,7 +20,9 @@ class Bubble {
|
|||||||
|
|
||||||
/// puts app in background and shows floaty-bubble head
|
/// puts app in background and shows floaty-bubble head
|
||||||
Future<void> startBubbleHead({bool sendAppToBackground = true}) async {
|
Future<void> startBubbleHead({bool sendAppToBackground = true}) async {
|
||||||
ByteData bytes = await rootBundle.load('assets/images/logo1.png');
|
ByteData bytes = await rootBundle.load(
|
||||||
|
'assets/images/s.png',
|
||||||
|
);
|
||||||
var buffer = bytes.buffer;
|
var buffer = bytes.buffer;
|
||||||
var encodedImage = base64.encode(Uint8List.view(buffer));
|
var encodedImage = base64.encode(Uint8List.view(buffer));
|
||||||
await _channel.invokeMethod('startBubbleHead', {
|
await _channel.invokeMethod('startBubbleHead', {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>12.0</string>
|
<string>12.0</string>
|
||||||
<key>UIBackgroundModes</key>
|
<key>UIBackgroundModes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>fetch</string>
|
<string>fetch</string>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>67</string>
|
<string>70</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>4.0.67</string>
|
<string>4.0.70</string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
<string>NO</string>
|
<string>NO</string>
|
||||||
<key>GMSApiKey</key>
|
<key>GMSApiKey</key>
|
||||||
|
|||||||
@@ -272,6 +272,8 @@ class AppLink {
|
|||||||
static String authCaptin = '$server/auth/captin';
|
static String authCaptin = '$server/auth/captin';
|
||||||
static String loginCaptin = "$authCaptin/login.php";
|
static String loginCaptin = "$authCaptin/login.php";
|
||||||
static String loginFromGoogleCaptin = "$authCaptin/loginFromGoogle.php";
|
static String loginFromGoogleCaptin = "$authCaptin/loginFromGoogle.php";
|
||||||
|
static String loginUsingCredentialsWithoutGoogle =
|
||||||
|
"$authCaptin/loginUsingCredentialsWithoutGoogle.php";
|
||||||
static String packageInfo = "$server/auth/packageInfo.php";
|
static String packageInfo = "$server/auth/packageInfo.php";
|
||||||
static String signUpCaptin = "$authCaptin/register.php";
|
static String signUpCaptin = "$authCaptin/register.php";
|
||||||
static String addCriminalDocuments = "$authCaptin/addCriminalDocuments.php";
|
static String addCriminalDocuments = "$authCaptin/addCriminalDocuments.php";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
import 'package:SEFER/controller/functions/location_background_controller.dart';
|
import 'package:SEFER/controller/functions/location_background_controller.dart';
|
||||||
@@ -25,7 +26,10 @@ class LoginDriverController extends GetxController {
|
|||||||
TextEditingController emailController = TextEditingController();
|
TextEditingController emailController = TextEditingController();
|
||||||
TextEditingController phoneController = TextEditingController();
|
TextEditingController phoneController = TextEditingController();
|
||||||
TextEditingController passwordController = TextEditingController();
|
TextEditingController passwordController = TextEditingController();
|
||||||
|
TextEditingController passwordController2 = TextEditingController();
|
||||||
bool isAgreeTerms = false;
|
bool isAgreeTerms = false;
|
||||||
|
bool isGoogleDashOpen = false;
|
||||||
|
bool isGoogleLogin = false;
|
||||||
bool isloading = false;
|
bool isloading = false;
|
||||||
late int isTest = 1;
|
late int isTest = 1;
|
||||||
final FlutterSecureStorage _storage = const FlutterSecureStorage();
|
final FlutterSecureStorage _storage = const FlutterSecureStorage();
|
||||||
@@ -35,6 +39,11 @@ class LoginDriverController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void changeGoogleDashOpen() {
|
||||||
|
isGoogleDashOpen = !isGoogleDashOpen;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
box.read(BoxName.isTest) == null ||
|
box.read(BoxName.isTest) == null ||
|
||||||
@@ -80,6 +89,32 @@ class LoginDriverController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String generateUniqueIdFromEmail(String email) {
|
||||||
|
// Step 1: Extract the local part of the email
|
||||||
|
String localPart = email.split('@')[0];
|
||||||
|
|
||||||
|
// Step 2: Replace invalid characters (if any)
|
||||||
|
String cleanLocalPart = localPart.replaceAll(RegExp(r'[^a-zA-Z0-9]'), '');
|
||||||
|
|
||||||
|
// Step 3: Ensure it does not exceed 24 characters
|
||||||
|
if (cleanLocalPart.length > 24) {
|
||||||
|
cleanLocalPart = cleanLocalPart.substring(0, 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 4: Generate a random suffix if needed
|
||||||
|
String suffix = generateRandomSuffix(24 - cleanLocalPart.length);
|
||||||
|
|
||||||
|
return cleanLocalPart + suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
String generateRandomSuffix(int length) {
|
||||||
|
const String chars =
|
||||||
|
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||||
|
Random random = Random();
|
||||||
|
return List.generate(length, (index) => chars[random.nextInt(chars.length)])
|
||||||
|
.join('');
|
||||||
|
}
|
||||||
|
|
||||||
loginUsingCredentials(String driverID, email) async {
|
loginUsingCredentials(String driverID, email) async {
|
||||||
isloading = true;
|
isloading = true;
|
||||||
update();
|
update();
|
||||||
@@ -207,6 +242,135 @@ class LoginDriverController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loginUsingCredentialsWithoutGoogle(String password, email) async {
|
||||||
|
isloading = true;
|
||||||
|
isGoogleLogin = true;
|
||||||
|
update();
|
||||||
|
var res = await CRUD()
|
||||||
|
.get(link: AppLink.loginUsingCredentialsWithoutGoogle, payload: {
|
||||||
|
'email': email,
|
||||||
|
'password': password,
|
||||||
|
});
|
||||||
|
box.write(BoxName.emailDriver, email.toString());
|
||||||
|
print(res);
|
||||||
|
if (res == 'failure') {
|
||||||
|
//Failure
|
||||||
|
if (box.read(BoxName.phoneVerified).toString() == '1') {
|
||||||
|
Get.offAll(() => EgyptCardAI());
|
||||||
|
} else {
|
||||||
|
Get.offAll(() => SmsSignupEgypt());
|
||||||
|
}
|
||||||
|
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
// Get.snackbar('Failure', '', backgroundColor: Colors.red);
|
||||||
|
} else {
|
||||||
|
var jsonDecoeded = jsonDecode(res);
|
||||||
|
if (jsonDecoeded.isNotEmpty) {
|
||||||
|
if (jsonDecoeded['status'] == 'success' &&
|
||||||
|
jsonDecoeded['data'][0]['is_verified'].toString() == '1') {
|
||||||
|
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
||||||
|
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
||||||
|
box.write(BoxName.isTest, '1');
|
||||||
|
box.write(BoxName.gender, jsonDecoeded['data'][0]['gender']);
|
||||||
|
box.write(BoxName.phoneVerified,
|
||||||
|
jsonDecoeded['data'][0]['is_verified'].toString());
|
||||||
|
box.write(BoxName.phoneDriver, jsonDecoeded['data'][0]['phone']);
|
||||||
|
box.write(BoxName.nameArabic, jsonDecoeded['data'][0]['name_arabic']);
|
||||||
|
box.write(
|
||||||
|
BoxName.bankCodeDriver, jsonDecoeded['data'][0]['bankCode']);
|
||||||
|
box.write(BoxName.accountBankNumberDriver,
|
||||||
|
jsonDecoeded['data'][0]['accountBank']);
|
||||||
|
box.write(
|
||||||
|
BoxName.nameDriver,
|
||||||
|
'${jsonDecoeded['data'][0]['first_name']}'
|
||||||
|
' ${jsonDecoeded['data'][0]['last_name']}');
|
||||||
|
if ((jsonDecoeded['data'][0]['model'].toString().contains('دراجه') ||
|
||||||
|
jsonDecoeded['data'][0]['make'].toString().contains('دراجه '))) {
|
||||||
|
if (jsonDecoeded['data'][0]['gender'].toString() == 'Male') {
|
||||||
|
box.write(BoxName.carTypeOfDriver, 'Scooter');
|
||||||
|
} else {
|
||||||
|
box.write(BoxName.carTypeOfDriver, 'Pink Bike');
|
||||||
|
}
|
||||||
|
} else if (int.parse(jsonDecoeded['data'][0]['year'].toString()) >
|
||||||
|
2017) {
|
||||||
|
if (jsonDecoeded['data'][0]['gender'].toString() != 'Male') {
|
||||||
|
box.write(BoxName.carTypeOfDriver, 'Lady');
|
||||||
|
} else {
|
||||||
|
box.write(BoxName.carTypeOfDriver, 'Comfort');
|
||||||
|
}
|
||||||
|
} else if (int.parse(jsonDecoeded['data'][0]['year'].toString()) >
|
||||||
|
2002 &&
|
||||||
|
int.parse(jsonDecoeded['data'][0]['year'].toString()) < 2017) {
|
||||||
|
box.write(BoxName.carTypeOfDriver, 'Speed');
|
||||||
|
} else if (int.parse(jsonDecoeded['data'][0]['year'].toString()) <
|
||||||
|
2002) {
|
||||||
|
box.write(BoxName.carTypeOfDriver, 'Awfar Car');
|
||||||
|
}
|
||||||
|
updateAppTester(AppInformation.appName);
|
||||||
|
|
||||||
|
var token = await CRUD().get(
|
||||||
|
link: AppLink.getDriverToken,
|
||||||
|
payload: {'captain_id': box.read(BoxName.driverID).toString()});
|
||||||
|
|
||||||
|
if (token != 'failure') {
|
||||||
|
if (jsonDecode(token)['data'][0]['token'] !=
|
||||||
|
box.read(BoxName.tokenDriver)) {
|
||||||
|
Get.put(FirebaseMessagesController())
|
||||||
|
.sendNotificationToAnyWithoutData(
|
||||||
|
'token change'.tr,
|
||||||
|
'change device'.tr,
|
||||||
|
jsonDecode(token)['data'][0]['token'].toString(),
|
||||||
|
'promo.wav');
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'you will use this device?'.tr,
|
||||||
|
middleText: '',
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Ok'.tr,
|
||||||
|
onPressed: () async {
|
||||||
|
await CRUD()
|
||||||
|
.post(link: AppLink.addTokensDriver, payload: {
|
||||||
|
'token': box.read(BoxName.tokenDriver),
|
||||||
|
'captain_id': box.read(BoxName.driverID).toString()
|
||||||
|
});
|
||||||
|
CRUD().post(
|
||||||
|
link:
|
||||||
|
"${AppLink.seferAlexandriaServer}/ride/firebase/addDriver.php",
|
||||||
|
payload: {
|
||||||
|
'token': box.read(BoxName.tokenDriver),
|
||||||
|
'captain_id':
|
||||||
|
box.read(BoxName.driverID).toString()
|
||||||
|
});
|
||||||
|
CRUD().post(
|
||||||
|
link:
|
||||||
|
"${AppLink.seferGizaServer}/ride/firebase/addDriver.php",
|
||||||
|
payload: {
|
||||||
|
'token': box.read(BoxName.tokenDriver),
|
||||||
|
'captain_id':
|
||||||
|
box.read(BoxName.driverID).toString()
|
||||||
|
});
|
||||||
|
Get.back();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Get.off(() => HomeCaptain());
|
||||||
|
// Get.off(() => LoginCaptin());
|
||||||
|
} else {
|
||||||
|
Get.offAll(() => SmsSignupEgypt());
|
||||||
|
// Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
|
||||||
|
// backgroundColor: Colors.redAccent);
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Get.snackbar('failure'.tr, '', backgroundColor: AppColor.redColor);
|
||||||
|
isloading = false;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void loginByBoxData() async {
|
void loginByBoxData() async {
|
||||||
Get.to(() => HomeCaptain());
|
Get.to(() => HomeCaptain());
|
||||||
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
await CRUD().post(link: AppLink.addTokensDriver, payload: {
|
||||||
|
|||||||
@@ -296,10 +296,19 @@ class RegisterCaptainController extends GetxController {
|
|||||||
// link: AppLink.updateAccountBank,
|
// link: AppLink.updateAccountBank,
|
||||||
// payload: {'phone': '+2${phoneController.text}'});
|
// payload: {'phone': '+2${phoneController.text}'});
|
||||||
// if (res1 != 'failure') {
|
// if (res1 != 'failure') {
|
||||||
await Get.put(LoginDriverController()).loginUsingCredentials(
|
Get.find<LoginDriverController>().isGoogleLogin == true
|
||||||
box.read(BoxName.driverID).toString(),
|
? await Get.put(LoginDriverController())
|
||||||
box.read(BoxName.emailDriver).toString(),
|
.loginUsingCredentialsWithoutGoogle(
|
||||||
);
|
Get.find<LoginDriverController>()
|
||||||
|
.passwordController
|
||||||
|
.text
|
||||||
|
.toString(),
|
||||||
|
box.read(BoxName.emailDriver).toString(),
|
||||||
|
)
|
||||||
|
: await Get.put(LoginDriverController()).loginUsingCredentials(
|
||||||
|
box.read(BoxName.driverID).toString(),
|
||||||
|
box.read(BoxName.emailDriver).toString(),
|
||||||
|
);
|
||||||
// Get.to(EgyptCardAI());
|
// Get.to(EgyptCardAI());
|
||||||
// } else {
|
// } else {
|
||||||
// Get.snackbar('title', 'message');
|
// Get.snackbar('title', 'message');
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:google_sign_in/google_sign_in.dart';
|
|||||||
|
|
||||||
import '../../onbording_page.dart';
|
import '../../onbording_page.dart';
|
||||||
import '../../views/auth/captin/ai_page.dart';
|
import '../../views/auth/captin/ai_page.dart';
|
||||||
|
import '../functions/add_error.dart';
|
||||||
|
|
||||||
class GoogleSignInHelper {
|
class GoogleSignInHelper {
|
||||||
static final GoogleSignIn _googleSignIn = GoogleSignIn(
|
static final GoogleSignIn _googleSignIn = GoogleSignIn(
|
||||||
@@ -81,7 +82,6 @@ class GoogleSignInHelper {
|
|||||||
// Get.snackbar('Google Sign-In error', '$error',
|
// Get.snackbar('Google Sign-In error', '$error',
|
||||||
// backgroundColor: AppColor.redColor);
|
// backgroundColor: AppColor.redColor);
|
||||||
// // Log error details
|
// // Log error details
|
||||||
// print('Google Sign-In error: $error');
|
|
||||||
// return null;
|
// return null;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -97,9 +97,6 @@ class GoogleSignInHelper {
|
|||||||
final emailDriver =
|
final emailDriver =
|
||||||
box.read(BoxName.emailDriver)?.toString() ?? 'Unknown Email';
|
box.read(BoxName.emailDriver)?.toString() ?? 'Unknown Email';
|
||||||
|
|
||||||
// print('Driver ID: $driverID');
|
|
||||||
// print('Email Driver: $emailDriver');
|
|
||||||
|
|
||||||
await Get.find<LoginDriverController>()
|
await Get.find<LoginDriverController>()
|
||||||
.loginUsingCredentials(driverID, emailDriver);
|
.loginUsingCredentials(driverID, emailDriver);
|
||||||
}
|
}
|
||||||
@@ -109,26 +106,10 @@ class GoogleSignInHelper {
|
|||||||
Get.snackbar('Google Sign-In error', '$error',
|
Get.snackbar('Google Sign-In error', '$error',
|
||||||
backgroundColor: AppColor.redColor);
|
backgroundColor: AppColor.redColor);
|
||||||
addError(error.toString(), 'GoogleSignInAccount?> signInFromLogin()');
|
addError(error.toString(), 'GoogleSignInAccount?> signInFromLogin()');
|
||||||
print('Google Sign-In error: $error');
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addError(String error, where) async {
|
|
||||||
CRUD().post(link: AppLink.addError, payload: {
|
|
||||||
'error': error.toString(), // Example error description
|
|
||||||
'userId': box.read(BoxName.driverID) ??
|
|
||||||
box.read(BoxName.passengerID), // Example user ID
|
|
||||||
'userType': box.read(BoxName.driverID) != null
|
|
||||||
? 'Driver'
|
|
||||||
: 'passenger', // Example user type
|
|
||||||
'phone': box.read(BoxName.phone) ??
|
|
||||||
box.read(BoxName.phoneDriver), // Example phone number
|
|
||||||
|
|
||||||
'device': where
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Method to handle Google Sign-Out
|
// Method to handle Google Sign-Out
|
||||||
static Future<void> signOut() async {
|
static Future<void> signOut() async {
|
||||||
try {
|
try {
|
||||||
@@ -172,10 +153,7 @@ class GoogleSignInHelper {
|
|||||||
box.write(BoxName.emailDriver, user.email);
|
box.write(BoxName.emailDriver, user.email);
|
||||||
// box.write(BoxName.nameDriver, user.displayName);
|
// box.write(BoxName.nameDriver, user.displayName);
|
||||||
// box.write(BoxName.driverPhotoUrl, user.photoUrl);
|
// box.write(BoxName.driverPhotoUrl, user.photoUrl);
|
||||||
print(box.read(BoxName.driverID).toString());
|
|
||||||
print(
|
|
||||||
box.read(BoxName.emailDriver).toString(),
|
|
||||||
);
|
|
||||||
// Perform any additional sign-up tasks or API calls here
|
// Perform any additional sign-up tasks or API calls here
|
||||||
// For example, you can send the user data to your server for registration
|
// For example, you can send the user data to your server for registration
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,9 +113,13 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> fireBaseTitles(RemoteMessage message) async {
|
Future<void> fireBaseTitles(RemoteMessage message) async {
|
||||||
if (message.notification!.title! == 'Order'.tr) {
|
if (message.notification!.title! == 'OrderSpeed'.tr) {
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
NotificationController().showNotification('Order'.tr, '', 'order', '');
|
NotificationController().showNotification(
|
||||||
|
message.notification!.title.toString(),
|
||||||
|
message.notification!.body.toString(),
|
||||||
|
'order',
|
||||||
|
'');
|
||||||
}
|
}
|
||||||
// await FirebaseMessagesController().showOverlayNotification(message);
|
// await FirebaseMessagesController().showOverlayNotification(message);
|
||||||
var myListString = message.data['DriverList'];
|
var myListString = message.data['DriverList'];
|
||||||
@@ -157,17 +161,34 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
// Get.to(const VipOrderPage());
|
// Get.to(const VipOrderPage());
|
||||||
} else if (message.notification!.title! == 'message From passenger'.tr) {
|
} else if (message.notification!.title! == 'message From passenger'.tr) {
|
||||||
passengerDialog(message.notification!.body!);
|
// passengerDialog(message.notification!.body!);
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
NotificationController()
|
NotificationController()
|
||||||
.showNotification('message From passenger'.tr, ''.tr, 'ding', '');
|
.showNotification('message From passenger'.tr, ''.tr, 'ding', '');
|
||||||
}
|
}
|
||||||
|
MyDialog().getDialog(
|
||||||
|
'message From passenger'.tr, message.notification!.body!, () {
|
||||||
|
// FirebaseMessagesController().sendNotificationToPassengerToken(
|
||||||
|
// 'Hi ,I will go now'.tr,
|
||||||
|
// 'I will go now'.tr,
|
||||||
|
// Get.find<MapPassengerController>().driverToken, []);
|
||||||
|
// Get.find<MapPassengerController>()
|
||||||
|
// .startTimerDriverWaitPassenger5Minute();
|
||||||
|
Get.back();
|
||||||
|
});
|
||||||
} else if (message.notification!.title == 'Cancel') {
|
} else if (message.notification!.title == 'Cancel') {
|
||||||
cancelTripDialog1();
|
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
NotificationController()
|
NotificationController()
|
||||||
.showNotification('Cancel'.tr, ''.tr, 'cancel', '');
|
.showNotification('Cancel'.tr, ''.tr, 'cancel', '');
|
||||||
}
|
}
|
||||||
|
MyDialog().getDialog(
|
||||||
|
'Passenger Cancel Trip'.tr,
|
||||||
|
'Trip Cancelled. The cost of the trip will be added to your wallet.'
|
||||||
|
.tr, () {
|
||||||
|
box.write(BoxName.rideStatus, 'Cancel');
|
||||||
|
Get.offAll(HomeCaptain());
|
||||||
|
});
|
||||||
|
// cancelTripDialog1();
|
||||||
} else if (message.notification!.title! == 'token change') {
|
} else if (message.notification!.title! == 'token change') {
|
||||||
// NotificationController1()
|
// NotificationController1()
|
||||||
// .showNotification('token change'.tr, 'token change', 'cancel');
|
// .showNotification('token change'.tr, 'token change', 'cancel');
|
||||||
@@ -181,24 +202,16 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
String result0 = await faceDetector();
|
String result0 = await faceDetector();
|
||||||
// Handle the result here, e.g., show a dialog or update the UI
|
// Handle the result here, e.g., show a dialog or update the UI
|
||||||
var result = jsonDecode(result0);
|
var result = jsonDecode(result0);
|
||||||
Get.defaultDialog(
|
MyDialogContent().getDialog(
|
||||||
barrierDismissible: false,
|
'Face Detection Result'.tr,
|
||||||
title: 'Face Detection Result'.tr,
|
Text(
|
||||||
titleStyle: AppStyle.title,
|
|
||||||
content: Text(
|
|
||||||
result['similar'].toString() == 'true'
|
result['similar'].toString() == 'true'
|
||||||
? 'similar'.tr
|
? 'similar'.tr
|
||||||
: 'not similar'.tr,
|
: 'not similar'.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
),
|
), () {
|
||||||
backgroundColor: result['similar'].toString() == 'true'
|
Get.back();
|
||||||
? AppColor.greenColor
|
});
|
||||||
: AppColor.redColor,
|
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'OK'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
}));
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
} else if (message.notification!.title! == 'Hi ,I will go now') {
|
} else if (message.notification!.title! == 'Hi ,I will go now') {
|
||||||
@@ -279,13 +292,21 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
backgroundColor: AppColor.yellowColor,
|
backgroundColor: AppColor.yellowColor,
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
);
|
);
|
||||||
} else if (message.notification!.title! == 'OrderSpeed') {
|
} else if (message.notification!.title! == 'Order') {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
NotificationController().showNotification(
|
||||||
|
message.notification!.title.toString(),
|
||||||
|
message.notification!.body.toString(),
|
||||||
|
'order',
|
||||||
|
'');
|
||||||
|
}
|
||||||
var myListString = message.data['DriverList'];
|
var myListString = message.data['DriverList'];
|
||||||
// var points = message.data['PolylineJson'];
|
// var points = message.data['PolylineJson'];
|
||||||
|
|
||||||
var myList = jsonDecode(myListString) as List<dynamic>;
|
var myList = jsonDecode(myListString) as List<dynamic>;
|
||||||
// var myPoints = jsonDecode(points) as List<dynamic>;
|
// var myPoints = jsonDecode(points) as List<dynamic>;
|
||||||
driverToken = myList[14].toString();
|
driverToken = myList[14].toString();
|
||||||
|
Get.put(HomeCaptainController()).changeRideId();
|
||||||
update();
|
update();
|
||||||
Get.to(() => OrderSpeedRequest(), arguments: {
|
Get.to(() => OrderSpeedRequest(), arguments: {
|
||||||
'myListString': myListString,
|
'myListString': myListString,
|
||||||
|
|||||||
19
lib/controller/functions/add_error.dart
Normal file
19
lib/controller/functions/add_error.dart
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import '../../constant/box_name.dart';
|
||||||
|
import '../../constant/links.dart';
|
||||||
|
import '../../main.dart';
|
||||||
|
import 'crud.dart';
|
||||||
|
|
||||||
|
addError(String error, where) async {
|
||||||
|
CRUD().post(link: AppLink.addError, payload: {
|
||||||
|
'error': error.toString(), // Example error description
|
||||||
|
'userId': box.read(BoxName.driverID) ??
|
||||||
|
box.read(BoxName.passengerID), // Example user ID
|
||||||
|
'userType': box.read(BoxName.driverID) != null
|
||||||
|
? 'Driver'
|
||||||
|
: 'passenger', // Example user type
|
||||||
|
'phone': box.read(BoxName.phone) ??
|
||||||
|
box.read(BoxName.phoneDriver), // Example phone number
|
||||||
|
|
||||||
|
'device': where
|
||||||
|
});
|
||||||
|
}
|
||||||
29
lib/controller/functions/audio_controller.dart
Normal file
29
lib/controller/functions/audio_controller.dart
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:just_audio/just_audio.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class AudioController extends GetxController {
|
||||||
|
final AudioPlayer _audioPlayer = AudioPlayer();
|
||||||
|
|
||||||
|
Future<void> playAudio() async {
|
||||||
|
// Check if the platform is Android
|
||||||
|
if (Theme.of(Get.context!).platform == TargetPlatform.android) {
|
||||||
|
try {
|
||||||
|
// Load the audio file from the raw resources
|
||||||
|
await _audioPlayer.setAsset(
|
||||||
|
'assets/order1.wav'); // Adjust the path based on your project structure
|
||||||
|
_audioPlayer.play();
|
||||||
|
} catch (e) {
|
||||||
|
// Handle errors, such as file not found
|
||||||
|
print('Error playing audio: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// Release resources when done
|
||||||
|
_audioPlayer.dispose();
|
||||||
|
super.onClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'dart:math';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/info.dart';
|
import 'package:SEFER/constant/info.dart';
|
||||||
import 'package:SEFER/constant/links.dart';
|
import 'package:SEFER/constant/links.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
import 'package:SEFER/constant/style.dart';
|
||||||
|
import 'package:SEFER/controller/auth/captin/login_captin_controller.dart';
|
||||||
import 'package:SEFER/controller/functions/crud.dart';
|
import 'package:SEFER/controller/functions/crud.dart';
|
||||||
import 'package:SEFER/controller/functions/device_info.dart';
|
import 'package:SEFER/controller/functions/device_info.dart';
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
@@ -312,7 +314,13 @@ class AI extends GetxController {
|
|||||||
'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified',
|
'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified',
|
||||||
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
|
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
|
||||||
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
|
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
|
||||||
'password': '123456',
|
'password':
|
||||||
|
Get.find<LoginDriverController>().passwordController.text.isEmpty
|
||||||
|
? box.read(BoxName.emailDriver).toString()
|
||||||
|
: Get.find<LoginDriverController>()
|
||||||
|
.passwordController
|
||||||
|
.text
|
||||||
|
.toString(),
|
||||||
'gender': responseIdEgyptBack['gender']?.toString() ?? 'Not specified',
|
'gender': responseIdEgyptBack['gender']?.toString() ?? 'Not specified',
|
||||||
'license_type':
|
'license_type':
|
||||||
responseIdEgyptDriverLicense['license_type']?.toString() ??
|
responseIdEgyptDriverLicense['license_type']?.toString() ??
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:SEFER/controller/home/captin/order_request_controller.dart';
|
import 'package:SEFER/controller/home/captin/order_request_controller.dart';
|
||||||
import 'package:SEFER/views/widgets/mydialoug.dart';
|
import 'package:SEFER/views/widgets/mydialoug.dart';
|
||||||
|
import 'package:bubble_head/bubble.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -303,9 +305,6 @@ class MapDriverController extends GetxController {
|
|||||||
box.read(BoxName.name).toString(),
|
box.read(BoxName.name).toString(),
|
||||||
tokenPassenger,
|
tokenPassenger,
|
||||||
'start.wav');
|
'start.wav');
|
||||||
if (box.read(BoxName.googlaMapApp) == true) {
|
|
||||||
await openGoogleMapFromDriverToPassenger();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSocialPressed = false;
|
bool isSocialPressed = false;
|
||||||
@@ -346,6 +345,7 @@ class MapDriverController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void startRideFromStartApp() {
|
void startRideFromStartApp() {
|
||||||
|
// if (box.read(BoxName.rideStatus) == 'Begin') {
|
||||||
changeRideToBeginToPassenger();
|
changeRideToBeginToPassenger();
|
||||||
isPassengerInfoWindow = false;
|
isPassengerInfoWindow = false;
|
||||||
isRideStarted = true;
|
isRideStarted = true;
|
||||||
@@ -354,6 +354,8 @@ class MapDriverController extends GetxController {
|
|||||||
timeWaitingPassenger = 0;
|
timeWaitingPassenger = 0;
|
||||||
box.write(BoxName.statusDriverLocation, 'on');
|
box.write(BoxName.statusDriverLocation, 'on');
|
||||||
update();
|
update();
|
||||||
|
// }
|
||||||
|
|
||||||
// rideIsBeginPassengerTimer();
|
// rideIsBeginPassengerTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,20 +400,15 @@ class MapDriverController extends GetxController {
|
|||||||
// var d = jsonDecode(res);
|
// var d = jsonDecode(res);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
Get.back();
|
||||||
// Start updating location and moving camera
|
// Start updating location and moving camera
|
||||||
// updateLocation();
|
// updateLocation();
|
||||||
} else {
|
} else {
|
||||||
Get.defaultDialog(
|
Get.back();
|
||||||
barrierDismissible: false,
|
MyDialog().getDialog('Your are far from passenger location'.tr,
|
||||||
title: 'Your are far from passenger location'.tr,
|
'go to your passenger location before\nPassenger cancel trip'.tr, () {
|
||||||
middleText:
|
Get.back();
|
||||||
'go to your passenger location before\nPassenger cancel trip'.tr,
|
});
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Ok',
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -486,15 +483,10 @@ class MapDriverController extends GetxController {
|
|||||||
await calculateDistanceBetweenDriverAndPassengerLocation();
|
await calculateDistanceBetweenDriverAndPassengerLocation();
|
||||||
|
|
||||||
if (distance2 > 60) {
|
if (distance2 > 60) {
|
||||||
Get.defaultDialog(
|
MyDialog().getDialog('Your are far from passenger location'.tr,
|
||||||
title: 'Your are far from passenger location'.tr,
|
'go to your passenger location before\nPassenger cancel trip'.tr, () {
|
||||||
middleText:
|
Get.back();
|
||||||
'go to your passenger location before\nPassenger cancel trip'.tr,
|
});
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Ok',
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
}));
|
|
||||||
} else {
|
} else {
|
||||||
double costOfWaiting5Minute = box.read(BoxName.countryCode) == 'Egypt'
|
double costOfWaiting5Minute = box.read(BoxName.countryCode) == 'Egypt'
|
||||||
? (distanceBetweenDriverAndPassengerWhenConfirm * .08) + (5 * 1)
|
? (distanceBetweenDriverAndPassengerWhenConfirm * .08) + (5 * 1)
|
||||||
@@ -559,36 +551,22 @@ class MapDriverController extends GetxController {
|
|||||||
Get.find<LocationController>().myLocation.latitude,
|
Get.find<LocationController>().myLocation.latitude,
|
||||||
Get.find<LocationController>().myLocation.longitude,
|
Get.find<LocationController>().myLocation.longitude,
|
||||||
);
|
);
|
||||||
Get.defaultDialog(
|
MyDialog().getDialog('Are you sure to exit ride ?'.tr, '', () {
|
||||||
title: 'Are you sure to exit ride ?'.tr,
|
if (distanceToDestination > 900 ||
|
||||||
titleStyle: AppStyle.title,
|
(double.parse(distance) < 1000 && distanceToDestination > 150)) {
|
||||||
middleText: '',
|
Get.back();
|
||||||
confirm: MyElevatedButton(
|
finishRideFromDriver1();
|
||||||
title: 'Ok'.tr,
|
} else {
|
||||||
kolor: AppColor.greenColor,
|
Get.back();
|
||||||
onPressed: () {
|
if (distanceToDestination <= 150) {
|
||||||
if (distanceToDestination > 900 ||
|
// todo add scam from start point and dont move
|
||||||
(double.parse(distance) < 1000 &&
|
// finishRideFromDriver1();
|
||||||
distanceToDestination > 500)) {
|
}
|
||||||
Get.back();
|
MyDialog().getDialog('you are not moved yet !'.tr, '', () {
|
||||||
finishRideFromDriver1();
|
Get.back();
|
||||||
} else {
|
});
|
||||||
Get.back();
|
}
|
||||||
if (distanceToDestination < 150) {
|
});
|
||||||
// todo add scam from start point and dont move
|
|
||||||
// finishRideFromDriver1();
|
|
||||||
}
|
|
||||||
MyDialog().getDialog('you are not moved yet !'.tr, '', () {
|
|
||||||
Get.back();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
cancel: MyElevatedButton(
|
|
||||||
title: 'Cancel'.tr,
|
|
||||||
kolor: Colors.red,
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String paymentToken = '';
|
String paymentToken = '';
|
||||||
@@ -736,17 +714,12 @@ class MapDriverController extends GetxController {
|
|||||||
isPassengerInfoWindow = false;
|
isPassengerInfoWindow = false;
|
||||||
clearPolyline();
|
clearPolyline();
|
||||||
update();
|
update();
|
||||||
Get.defaultDialog(
|
MyDialog().getDialog(
|
||||||
title: 'Order Cancelled'.tr,
|
'Order Cancelled'.tr,
|
||||||
titleStyle: AppStyle.title,
|
'Order Cancelled by Passenger'.tr,
|
||||||
middleText: 'Order Cancelled by Passenger'.tr,
|
() {
|
||||||
middleTextStyle: AppStyle.title,
|
Get.offAll(HomeCaptain());
|
||||||
confirm: MyElevatedButton(
|
},
|
||||||
title: 'Ok'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
Get.offAll(HomeCaptain());
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -827,29 +800,25 @@ class MapDriverController extends GetxController {
|
|||||||
: (i ~/ 60) * (latePrice + .5) * 2 + (price);
|
: (i ~/ 60) * (latePrice + .5) * 2 + (price);
|
||||||
}
|
}
|
||||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||||
? (i ~/ 60) * (latePrice + .5) +
|
? (latePrice + 0.5) * ((i ~/ 60) - int.parse(duration)) + price
|
||||||
(price) -
|
|
||||||
int.parse(duration) * (latePrice + .5)
|
|
||||||
: carType == 'Lady'
|
: carType == 'Lady'
|
||||||
? (i ~/ 60) * (latePrice + .5) +
|
? (latePrice + 0.5) * ((i ~/ 60) - int.parse(duration)) +
|
||||||
(price) -
|
price
|
||||||
int.parse(duration) * (latePrice + .5)
|
|
||||||
: carType == 'RayehGaiComfort'
|
: carType == 'RayehGaiComfort'
|
||||||
? (i ~/ 60) * (latePrice + .5) +
|
? (latePrice + 0.5) * ((i ~/ 60) - int.parse(duration)) +
|
||||||
(price) -
|
price
|
||||||
int.parse(duration) * (latePrice + .5)
|
|
||||||
: price;
|
: price;
|
||||||
} else if (currentTime.hour >= 14 && currentTime.hour <= 17) {
|
} else if (currentTime.hour >= 14 && currentTime.hour <= 17) {
|
||||||
price = carType == 'Comfort' // || carType == 'Free Ride'
|
price = carType == 'Comfort' // || carType == 'Free Ride'
|
||||||
? (i ~/ 60) * (Get.find<HomeCaptainController>().heavyPrice) +
|
? Get.find<HomeCaptainController>().heavyPrice *
|
||||||
(price) -
|
((i ~/ 60) - int.parse(duration)) +
|
||||||
int.parse(duration) *
|
price -
|
||||||
(Get.find<HomeCaptainController>().heavyPrice + .5)
|
(0.5 * int.parse(duration))
|
||||||
: carType == 'Lady'
|
: carType == 'Lady'
|
||||||
? (i ~/ 60) * (Get.find<HomeCaptainController>().heavyPrice) +
|
? Get.find<HomeCaptainController>().heavyPrice *
|
||||||
(price) -
|
((i ~/ 60) - int.parse(duration)) +
|
||||||
int.parse(duration) *
|
price -
|
||||||
(Get.find<HomeCaptainController>().heavyPrice + .5)
|
(0.5 * int.parse(duration))
|
||||||
: carType == 'RayehGaiComfort'
|
: carType == 'RayehGaiComfort'
|
||||||
? (i ~/ 60) *
|
? (i ~/ 60) *
|
||||||
(Get.find<HomeCaptainController>().heavyPrice) +
|
(Get.find<HomeCaptainController>().heavyPrice) +
|
||||||
@@ -1191,11 +1160,21 @@ class MapDriverController extends GetxController {
|
|||||||
late String startNameLocation;
|
late String startNameLocation;
|
||||||
late String endNameLocation;
|
late String endNameLocation;
|
||||||
|
|
||||||
|
Future<void> runGoogleMapDirectly() async {
|
||||||
|
if (box.read(BoxName.googlaMapApp) == true) {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
Bubble().startBubbleHead(sendAppToBackground: true);
|
||||||
|
}
|
||||||
|
await openGoogleMapFromDriverToPassenger();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||||
// Get the passenger location from the arguments.
|
// Get the passenger location from the arguments.
|
||||||
// await argumentLoading();
|
// await argumentLoading();
|
||||||
|
runGoogleMapDirectly();
|
||||||
addCustomCarIcon();
|
addCustomCarIcon();
|
||||||
addCustomPassengerIcon();
|
addCustomPassengerIcon();
|
||||||
addCustomStartIcon();
|
addCustomStartIcon();
|
||||||
|
|||||||
@@ -3,13 +3,11 @@ import 'dart:convert';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/links.dart';
|
import 'package:SEFER/constant/links.dart';
|
||||||
import 'package:SEFER/constant/style.dart';
|
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
import '../../../constant/box_name.dart';
|
import '../../../constant/box_name.dart';
|
||||||
import '../../../constant/table_names.dart';
|
import '../../functions/audio_controller.dart';
|
||||||
import '../../functions/crud.dart';
|
import '../../functions/crud.dart';
|
||||||
import '../../functions/location_controller.dart';
|
import '../../functions/location_controller.dart';
|
||||||
import 'home_captain_controller.dart';
|
import 'home_captain_controller.dart';
|
||||||
@@ -33,10 +31,14 @@ class OrderRequestController extends GetxController {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
|
// AudioController audioController = Get.put(AudioController());
|
||||||
|
|
||||||
|
// audioController.playAudio();
|
||||||
// getRefusedOrderByCaptain();
|
// getRefusedOrderByCaptain();
|
||||||
initilizeOrderPage();
|
initilizeOrderPage();
|
||||||
addCustomStartIcon();
|
addCustomStartIcon();
|
||||||
addCustomEndIcon();
|
addCustomEndIcon();
|
||||||
|
|
||||||
// calculateConsumptionFuel();
|
// calculateConsumptionFuel();
|
||||||
update();
|
update();
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ class MyTranslation extends Translations {
|
|||||||
"Criminal Record": "السجل الجنائي",
|
"Criminal Record": "السجل الجنائي",
|
||||||
"ID Documents Back": "الوثيقه الشخصية - الخلفية",
|
"ID Documents Back": "الوثيقه الشخصية - الخلفية",
|
||||||
"Driver's License": "رخصة القيادة",
|
"Driver's License": "رخصة القيادة",
|
||||||
|
"No, still Waiting.": "لا، ما زلت في انتظار.",
|
||||||
"you can show video how to setup":
|
"you can show video how to setup":
|
||||||
"يمكنك عرض فيديو حول كيفية الإعداد",
|
"يمكنك عرض فيديو حول كيفية الإعداد",
|
||||||
"don't start trip if not": "لا تبدأ الرحلة إذا لم",
|
"don't start trip if not": "لا تبدأ الرحلة إذا لم",
|
||||||
@@ -544,6 +545,7 @@ Store your money with us and receive it in your bank as a monthly salary.''':
|
|||||||
"for your first registration!": "للتسجيل الأول!",
|
"for your first registration!": "للتسجيل الأول!",
|
||||||
"Get it Now!": "احصل عليه الآن!",
|
"Get it Now!": "احصل عليه الآن!",
|
||||||
"before": "قبل",
|
"before": "قبل",
|
||||||
|
'SEFER': 'سفر',
|
||||||
"Code not approved": "الرمز غير موافق عليه",
|
"Code not approved": "الرمز غير موافق عليه",
|
||||||
"3000 LE": "3000 جنيه مصري",
|
"3000 LE": "3000 جنيه مصري",
|
||||||
"Do you have an invitation code from another driver?":
|
"Do you have an invitation code from another driver?":
|
||||||
@@ -1086,6 +1088,16 @@ Store your money with us and receive it in your bank as a monthly salary.''':
|
|||||||
"Warning: Speeding detected!": "تحذير: تم اكتشاف السرعة الزائدة!",
|
"Warning: Speeding detected!": "تحذير: تم اكتشاف السرعة الزائدة!",
|
||||||
"Please help! Contact me as soon as possible.":
|
"Please help! Contact me as soon as possible.":
|
||||||
"من فضلك ساعدني! تواصل معي في أقرب وقت ممكن.",
|
"من فضلك ساعدني! تواصل معي في أقرب وقت ممكن.",
|
||||||
|
"Email": "البريد الإلكتروني",
|
||||||
|
"Please enter your Email.": "يرجى إدخال بريدك الإلكتروني",
|
||||||
|
"Email must be correct.": "البريد الإلكتروني يجب أن يكون صحيحاً",
|
||||||
|
"Password": "كلمة المرور",
|
||||||
|
"Please enter your Password.": "يرجى إدخال كلمة المرور",
|
||||||
|
"Password must be at least 6 characters.":
|
||||||
|
"يجب أن تكون كلمة المرور مكونة من 6 أحرف على الأقل",
|
||||||
|
"Phone Number": "رقم الهاتف",
|
||||||
|
"Please enter your phone number.": "يرجى إدخال رقم هاتفك",
|
||||||
|
"Phone number must be valid.": "يجب أن يكون رقم الهاتف صحيحاً",
|
||||||
"Share Trip Details": "شارك تفاصيل الرحلة",
|
"Share Trip Details": "شارك تفاصيل الرحلة",
|
||||||
"Car Plate is": "لوحة السيارة",
|
"Car Plate is": "لوحة السيارة",
|
||||||
'L.E': 'ج.م',
|
'L.E': 'ج.م',
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:SEFER/controller/auth/facebook_login.dart';
|
import 'package:SEFER/controller/auth/facebook_login.dart';
|
||||||
import 'package:SEFER/views/auth/captin/contact_us_page.dart';
|
import 'package:SEFER/views/auth/captin/contact_us_page.dart';
|
||||||
|
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||||
import 'package:firebase_auth/firebase_auth.dart';
|
import 'package:firebase_auth/firebase_auth.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -20,6 +21,7 @@ import '../../../controller/auth/google_sign.dart';
|
|||||||
import '../../../controller/functions/location_permission.dart';
|
import '../../../controller/functions/location_permission.dart';
|
||||||
import '../../../controller/functions/overlay_permisssion.dart';
|
import '../../../controller/functions/overlay_permisssion.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
|
import '../../../print.dart';
|
||||||
import '../../widgets/elevated_btn.dart';
|
import '../../widgets/elevated_btn.dart';
|
||||||
import '../../widgets/my_scafold.dart';
|
import '../../widgets/my_scafold.dart';
|
||||||
import '../../widgets/mycircular.dart';
|
import '../../widgets/mycircular.dart';
|
||||||
@@ -48,400 +50,332 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
else
|
else
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
controller.isGoogleDashOpen
|
||||||
padding: const EdgeInsets.all(25),
|
? registerWitoutGoogle(controller)
|
||||||
child:
|
: Padding(
|
||||||
// Container(
|
padding: const EdgeInsets.all(25),
|
||||||
// decoration: const BoxDecoration(
|
child: Center(
|
||||||
// boxShadow: [
|
|
||||||
// BoxShadow(
|
|
||||||
// offset: Offset(3, 3),
|
|
||||||
// color: AppColor.accentColor,
|
|
||||||
// blurRadius: 3)
|
|
||||||
// ],
|
|
||||||
// color: AppColor.secondaryColor,
|
|
||||||
// ),
|
|
||||||
// child: Form(
|
|
||||||
// key: controller.formKey,
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(16.0),
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// TextFormField(
|
|
||||||
// keyboardType: TextInputType.emailAddress,
|
|
||||||
// controller: controller.emailController,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// focusedBorder: OutlineInputBorder(
|
|
||||||
// borderSide: const BorderSide(
|
|
||||||
// color: AppColor.primaryColor,
|
|
||||||
// width: 2.0,
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// ),
|
|
||||||
// fillColor: AppColor.accentColor,
|
|
||||||
// hoverColor: AppColor.accentColor,
|
|
||||||
// focusColor: AppColor.accentColor,
|
|
||||||
// border: const OutlineInputBorder(
|
|
||||||
// borderRadius: BorderRadius.all(
|
|
||||||
// Radius.circular(12))),
|
|
||||||
// labelText: 'Email'.tr,
|
|
||||||
// hintText: 'Enter your email address'.tr,
|
|
||||||
// ),
|
|
||||||
// validator: (value) {
|
|
||||||
// if (value!.isEmpty ||
|
|
||||||
// (!value.contains('@') ||
|
|
||||||
// !value.contains('.'))) {
|
|
||||||
// return 'Please enter Your Email.'.tr;
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(
|
|
||||||
// height: 30,
|
|
||||||
// ),
|
|
||||||
// TextFormField(
|
|
||||||
// keyboardType: TextInputType.phone,
|
|
||||||
// cursorColor: AppColor.accentColor,
|
|
||||||
// controller: controller.phoneController,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// focusedBorder: OutlineInputBorder(
|
|
||||||
// borderSide: const BorderSide(
|
|
||||||
// color: AppColor.primaryColor,
|
|
||||||
// width: 2.0,
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// ),
|
|
||||||
// focusColor: AppColor.accentColor,
|
|
||||||
// fillColor: AppColor.accentColor,
|
|
||||||
// border: const OutlineInputBorder(
|
|
||||||
// borderRadius: BorderRadius.all(
|
|
||||||
// Radius.circular(12))),
|
|
||||||
// labelText: 'Phone'.tr,
|
|
||||||
// hintText: 'Enter your phone number'.tr,
|
|
||||||
// ),
|
|
||||||
// validator: (value) {
|
|
||||||
// if (value!.isEmpty ||
|
|
||||||
// value.length != 10) {
|
|
||||||
// return 'Please enter your phone number.'
|
|
||||||
// .tr;
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(
|
|
||||||
// height: 15,
|
|
||||||
// ),
|
|
||||||
// TextFormField(
|
|
||||||
// obscureText: true,
|
|
||||||
// keyboardType: TextInputType.emailAddress,
|
|
||||||
// controller: controller.passwordController,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// focusedBorder: OutlineInputBorder(
|
|
||||||
// borderSide: const BorderSide(
|
|
||||||
// color: AppColor.primaryColor,
|
|
||||||
// width: 2.0,
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// ),
|
|
||||||
// fillColor: AppColor.accentColor,
|
|
||||||
// hoverColor: AppColor.accentColor,
|
|
||||||
// focusColor: AppColor.accentColor,
|
|
||||||
// border: const OutlineInputBorder(
|
|
||||||
// borderRadius: BorderRadius.all(
|
|
||||||
// Radius.circular(12))),
|
|
||||||
// labelText: 'Password'.tr,
|
|
||||||
// hintText:
|
|
||||||
// 'Please enter your phone number.'.tr,
|
|
||||||
// ),
|
|
||||||
// validator: (value) {
|
|
||||||
// if (value!.isEmpty) {
|
|
||||||
// return 'Please enter Your Password.'.tr;
|
|
||||||
// }
|
|
||||||
// if (value.length < 6) {
|
|
||||||
// return 'Password must br at least 6 character.'
|
|
||||||
// .tr;
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// controller.isloading
|
|
||||||
// ? const MyCircularProgressIndicator()
|
|
||||||
// : MyElevatedButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// if (controller.formKey.currentState!
|
|
||||||
// .validate()) {
|
|
||||||
// controller.login();
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// title: 'Submit'.tr,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
|
|
||||||
Center(
|
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
height: Get.height * .7,
|
height: Get.height * .7,
|
||||||
width: Get.width * .9,
|
width: Get.width * .9,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'assets/images/logo.gif',
|
'assets/images/logo.gif',
|
||||||
height: Get.width * .3,
|
height: Get.width * .3,
|
||||||
width: Get.width * .3,
|
width: Get.width * .3,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
Platform.isIOS && controller.isTest == 0
|
Platform.isIOS && controller.isTest == 0
|
||||||
? Container(
|
? Container(
|
||||||
decoration: AppStyle.boxDecoration,
|
decoration: AppStyle.boxDecoration,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Form(
|
Form(
|
||||||
key: controller.formKey,
|
key: controller.formKey,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding:
|
||||||
child: SingleChildScrollView(
|
const EdgeInsets.all(16.0),
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
children: [
|
child: Column(
|
||||||
TextFormField(
|
children: [
|
||||||
keyboardType: TextInputType
|
TextFormField(
|
||||||
.emailAddress,
|
keyboardType:
|
||||||
controller: controller
|
TextInputType
|
||||||
.emailController,
|
.emailAddress,
|
||||||
decoration: InputDecoration(
|
controller: controller
|
||||||
focusedBorder:
|
.emailController,
|
||||||
OutlineInputBorder(
|
decoration:
|
||||||
borderSide:
|
InputDecoration(
|
||||||
const BorderSide(
|
focusedBorder:
|
||||||
color: AppColor
|
OutlineInputBorder(
|
||||||
.primaryColor,
|
borderSide:
|
||||||
width: 2.0,
|
const BorderSide(
|
||||||
),
|
color: AppColor
|
||||||
borderRadius:
|
.primaryColor,
|
||||||
BorderRadius
|
width: 2.0,
|
||||||
.circular(10),
|
),
|
||||||
),
|
borderRadius:
|
||||||
fillColor:
|
BorderRadius
|
||||||
AppColor.accentColor,
|
.circular(
|
||||||
hoverColor:
|
10),
|
||||||
AppColor.accentColor,
|
),
|
||||||
focusColor:
|
fillColor: AppColor
|
||||||
AppColor.accentColor,
|
.accentColor,
|
||||||
border: const OutlineInputBorder(
|
hoverColor: AppColor
|
||||||
borderRadius:
|
.accentColor,
|
||||||
BorderRadius.all(
|
focusColor: AppColor
|
||||||
Radius
|
.accentColor,
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius
|
||||||
|
.all(Radius
|
||||||
.circular(
|
.circular(
|
||||||
12))),
|
12))),
|
||||||
labelText: 'Email'.tr,
|
labelText: 'Email'.tr,
|
||||||
hintText:
|
hintText:
|
||||||
'Enter your email address'
|
'Enter your email address'
|
||||||
.tr,
|
.tr,
|
||||||
),
|
|
||||||
validator: (value) {
|
|
||||||
if (value!.isEmpty ||
|
|
||||||
(!value.contains(
|
|
||||||
'@') ||
|
|
||||||
!value.contains(
|
|
||||||
'.'))) {
|
|
||||||
return 'Please enter Your Email.'
|
|
||||||
.tr;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 15,
|
|
||||||
),
|
|
||||||
TextFormField(
|
|
||||||
obscureText: true,
|
|
||||||
keyboardType: TextInputType
|
|
||||||
.emailAddress,
|
|
||||||
controller: controller
|
|
||||||
.passwordController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
focusedBorder:
|
|
||||||
OutlineInputBorder(
|
|
||||||
borderSide:
|
|
||||||
const BorderSide(
|
|
||||||
color: AppColor
|
|
||||||
.primaryColor,
|
|
||||||
width: 2.0,
|
|
||||||
),
|
),
|
||||||
borderRadius:
|
validator: (value) {
|
||||||
BorderRadius
|
if (value!.isEmpty ||
|
||||||
.circular(10),
|
(!value.contains(
|
||||||
|
'@') ||
|
||||||
|
!value.contains(
|
||||||
|
'.'))) {
|
||||||
|
return 'Please enter Your Email.'
|
||||||
|
.tr;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
),
|
),
|
||||||
fillColor:
|
const SizedBox(
|
||||||
AppColor.accentColor,
|
height: 15,
|
||||||
hoverColor:
|
),
|
||||||
AppColor.accentColor,
|
TextFormField(
|
||||||
focusColor:
|
obscureText: true,
|
||||||
AppColor.accentColor,
|
keyboardType:
|
||||||
border: const OutlineInputBorder(
|
TextInputType
|
||||||
borderRadius:
|
.emailAddress,
|
||||||
BorderRadius.all(
|
controller: controller
|
||||||
Radius
|
.passwordController,
|
||||||
|
decoration:
|
||||||
|
InputDecoration(
|
||||||
|
focusedBorder:
|
||||||
|
OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
const BorderSide(
|
||||||
|
color: AppColor
|
||||||
|
.primaryColor,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius
|
||||||
|
.circular(
|
||||||
|
10),
|
||||||
|
),
|
||||||
|
fillColor: AppColor
|
||||||
|
.accentColor,
|
||||||
|
hoverColor: AppColor
|
||||||
|
.accentColor,
|
||||||
|
focusColor: AppColor
|
||||||
|
.accentColor,
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius
|
||||||
|
.all(Radius
|
||||||
.circular(
|
.circular(
|
||||||
12))),
|
12))),
|
||||||
labelText: 'Password'.tr,
|
labelText:
|
||||||
hintText:
|
'Password'.tr,
|
||||||
'Please enter your phone number.'
|
hintText:
|
||||||
.tr,
|
'Please enter your phone number.'
|
||||||
),
|
.tr,
|
||||||
validator: (value) {
|
),
|
||||||
if (value!.isEmpty) {
|
validator: (value) {
|
||||||
return 'Please enter Your Password.'
|
if (value!.isEmpty) {
|
||||||
.tr;
|
return 'Please enter Your Password.'
|
||||||
}
|
.tr;
|
||||||
if (value.length < 6) {
|
}
|
||||||
return 'Password must br at least 6 character.'
|
if (value.length <
|
||||||
.tr;
|
6) {
|
||||||
}
|
return 'Password must br at least 6 character.'
|
||||||
return null;
|
.tr;
|
||||||
},
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
GetBuilder<
|
||||||
|
LoginDriverController>(
|
||||||
|
builder: (controller) =>
|
||||||
|
controller.isloading
|
||||||
|
? const MyCircularProgressIndicator()
|
||||||
|
: MyElevatedButton(
|
||||||
|
onPressed:
|
||||||
|
() async {
|
||||||
|
if (controller
|
||||||
|
.formKey
|
||||||
|
.currentState!
|
||||||
|
.validate()) {
|
||||||
|
await Get.find<LoginDriverController>()
|
||||||
|
.loginUsingCredentials(
|
||||||
|
controller
|
||||||
|
.passwordController
|
||||||
|
.text,
|
||||||
|
controller
|
||||||
|
.emailController
|
||||||
|
.text,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title:
|
||||||
|
'Submit'
|
||||||
|
.tr,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
GetBuilder<
|
),
|
||||||
LoginDriverController>(
|
|
||||||
builder: (controller) =>
|
|
||||||
controller.isloading
|
|
||||||
? const MyCircularProgressIndicator()
|
|
||||||
: MyElevatedButton(
|
|
||||||
onPressed:
|
|
||||||
() async {
|
|
||||||
if (controller
|
|
||||||
.formKey
|
|
||||||
.currentState!
|
|
||||||
.validate()) {
|
|
||||||
await Get.find<
|
|
||||||
LoginDriverController>()
|
|
||||||
.loginUsingCredentials(
|
|
||||||
controller
|
|
||||||
.passwordController
|
|
||||||
.text,
|
|
||||||
controller
|
|
||||||
.emailController
|
|
||||||
.text,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
title:
|
|
||||||
'Submit'.tr,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
height: Get.height * .3,
|
||||||
|
width: Get.width * .8,
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Sign in with Google for easier email and name entry'
|
||||||
|
.tr,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Or'.tr,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
controller
|
||||||
|
.changeGoogleDashOpen();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets
|
||||||
|
.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.blueColor,
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(
|
||||||
|
8),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize:
|
||||||
|
MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.email,
|
||||||
|
color: AppColor
|
||||||
|
.yellowColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Create new Account'.tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
),
|
||||||
height: 10,
|
GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
await GoogleSignInHelper()
|
||||||
|
.signInFromLogin();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16, vertical: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.redColor,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
FontAwesome.google,
|
||||||
|
color: AppColor.blueColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Sign In by Google'.tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
|
||||||
: Container(
|
|
||||||
decoration: AppStyle.boxDecoration1,
|
|
||||||
height: Get.height * .3,
|
|
||||||
width: Get.width * .8,
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'Sign in with Google for easier email and name entry'
|
|
||||||
.tr,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
await GoogleSignInHelper().signInFromLogin();
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 16, vertical: 10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.redColor,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
),
|
||||||
child: Row(
|
!Platform.isAndroid
|
||||||
mainAxisSize: MainAxisSize.min,
|
? GestureDetector(
|
||||||
children: [
|
onTap: () async {
|
||||||
const Icon(
|
User? user = await authController
|
||||||
FontAwesome.google,
|
.signInWithApple();
|
||||||
color: AppColor.blueColor,
|
if (user != null) {
|
||||||
),
|
box.write(
|
||||||
const SizedBox(width: 8),
|
BoxName.driverID, user.uid);
|
||||||
Text(
|
box.write(BoxName.emailDriver,
|
||||||
'Sign In by Google'.tr,
|
user.email);
|
||||||
style: const TextStyle(
|
Get.find<LoginDriverController>()
|
||||||
color: Colors.white,
|
.loginUsingCredentials(
|
||||||
fontSize: 16,
|
box
|
||||||
fontWeight: FontWeight.w500,
|
.read(BoxName.driverID)
|
||||||
),
|
.toString(),
|
||||||
),
|
box
|
||||||
],
|
.read(BoxName.emailDriver)
|
||||||
),
|
.toString(),
|
||||||
),
|
);
|
||||||
|
// Navigate to another screen or perform other actions
|
||||||
|
} else {}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16, vertical: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black,
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.apple,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 24,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Sign in with Apple'.tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
!Platform.isAndroid
|
))),
|
||||||
? GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
User? user = await authController
|
|
||||||
.signInWithApple();
|
|
||||||
if (user != null) {
|
|
||||||
box.write(BoxName.driverID, user.uid);
|
|
||||||
box.write(
|
|
||||||
BoxName.emailDriver, user.email);
|
|
||||||
Get.find<LoginDriverController>()
|
|
||||||
.loginUsingCredentials(
|
|
||||||
box.read(BoxName.driverID).toString(),
|
|
||||||
box
|
|
||||||
.read(BoxName.emailDriver)
|
|
||||||
.toString(),
|
|
||||||
);
|
|
||||||
// Navigate to another screen or perform other actions
|
|
||||||
} else {}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 16, vertical: 10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.black,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
const Icon(
|
|
||||||
Icons.apple,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 24,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Text(
|
|
||||||
'Sign in with Apple'.tr,
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const SizedBox(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () => Get.to(() => ContactUsPage()),
|
onTap: () => Get.to(() => ContactUsPage()),
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -458,6 +392,156 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Column registerWitoutGoogle(LoginDriverController controller) {
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Form(
|
||||||
|
key: controller.formKey,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: TextFormField(
|
||||||
|
obscureText: false, // Email should not be obscured
|
||||||
|
keyboardType: TextInputType.emailAddress,
|
||||||
|
controller: controller.emailController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
fillColor: AppColor.accentColor,
|
||||||
|
hoverColor: AppColor.accentColor,
|
||||||
|
focusColor: AppColor.accentColor,
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
|
),
|
||||||
|
labelText: 'Email'
|
||||||
|
.tr, // English: Email / Arabic: البريد الإلكتروني
|
||||||
|
hintText: 'Please enter your Email.'
|
||||||
|
.tr, // English: Please enter your Email / Arabic: يرجى إدخال بريدك الإلكتروني
|
||||||
|
),
|
||||||
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Please enter your Email.'
|
||||||
|
.tr; // English: Please enter your Email / Arabic: يرجى إدخال بريدك الإلكتروني
|
||||||
|
}
|
||||||
|
if (!value.contains('@')) {
|
||||||
|
return 'Email must be correct.'
|
||||||
|
.tr; // English: Email must be correct / Arabic: البريد الإلكتروني يجب أن يكون صحيحاً
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: TextFormField(
|
||||||
|
obscureText: true, // Password should be obscured
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
controller: controller.passwordController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
fillColor: AppColor.accentColor,
|
||||||
|
hoverColor: AppColor.accentColor,
|
||||||
|
focusColor: AppColor.accentColor,
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
|
),
|
||||||
|
labelText: 'Password'
|
||||||
|
.tr, // English: Password / Arabic: كلمة المرور
|
||||||
|
hintText: 'Please enter your Password.'
|
||||||
|
.tr, // English: Please enter your Password / Arabic: يرجى إدخال كلمة المرور
|
||||||
|
),
|
||||||
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Please enter your Password.'
|
||||||
|
.tr; // English: Please enter your Password / Arabic: يرجى إدخال كلمة المرور
|
||||||
|
}
|
||||||
|
if (value.length < 6) {
|
||||||
|
return 'Password must be at least 6 characters.'
|
||||||
|
.tr; // English: Password must be at least 6 characters / Arabic: يجب أن تكون كلمة المرور مكونة من 6 أحرف على الأقل
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
controller.isloading
|
||||||
|
? const MyCircularProgressIndicator()
|
||||||
|
: MyElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (controller.formKey.currentState!.validate()) {
|
||||||
|
String email = controller.emailController
|
||||||
|
.text; // Assume you have this controller
|
||||||
|
String uniqueId =
|
||||||
|
controller.generateUniqueIdFromEmail(email);
|
||||||
|
Log.print('Generated ID: $uniqueId');
|
||||||
|
box.write(BoxName.driverID, uniqueId);
|
||||||
|
box.write(BoxName.emailDriver,
|
||||||
|
controller.emailController.text.toString());
|
||||||
|
controller.loginUsingCredentialsWithoutGoogle(
|
||||||
|
controller.passwordController.text.toString(),
|
||||||
|
controller.emailController.text.toString(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title: 'Next'.tr,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 200,
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
await GoogleSignInHelper().signInFromLogin();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.redColor,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
FontAwesome.google,
|
||||||
|
color: AppColor.blueColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
'Sign In by Google'.tr,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Padding agreedPage() {
|
Padding agreedPage() {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class PassengerLocationMapPage extends StatelessWidget {
|
|||||||
mapDriverController.startTimerToShowPassengerInfoWindowFromDriver();
|
mapDriverController.startTimerToShowPassengerInfoWindowFromDriver();
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
// backgroundColor: AppColor.blueColor,
|
||||||
// title: 'Map Passenger'.tr,
|
// title: 'Map Passenger'.tr,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
|||||||
import 'package:SEFER/views/notification/available_rides_page.dart';
|
import 'package:SEFER/views/notification/available_rides_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_overlay_window/flutter_overlay_window.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';
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
@@ -20,7 +19,6 @@ import '../../../../controller/functions/location_controller.dart';
|
|||||||
import '../../../../controller/functions/overlay_permisssion.dart';
|
import '../../../../controller/functions/overlay_permisssion.dart';
|
||||||
import '../../../../controller/functions/package_info.dart';
|
import '../../../../controller/functions/package_info.dart';
|
||||||
import '../../../../controller/home/captin/home_captain_controller.dart';
|
import '../../../../controller/home/captin/home_captain_controller.dart';
|
||||||
import '../../../../controller/home/captin/order_request_controller.dart';
|
|
||||||
import '../../../widgets/circle_container.dart';
|
import '../../../widgets/circle_container.dart';
|
||||||
import '../driver_map_page.dart';
|
import '../driver_map_page.dart';
|
||||||
import 'widget/connect.dart';
|
import 'widget/connect.dart';
|
||||||
@@ -37,8 +35,8 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Get.put(OrderRequestController());
|
// Get.put(OrderRequestController());
|
||||||
// Get.put(HomeCaptainController());
|
Get.put(HomeCaptainController());
|
||||||
Get.put(CaptainWalletController());
|
// Get.put(CaptainWalletController());
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
closeOverlayIfFound();
|
closeOverlayIfFound();
|
||||||
checkForUpdate(context);
|
checkForUpdate(context);
|
||||||
@@ -51,25 +49,27 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
// backgroundColor: AppColor.accentColor,
|
// backgroundColor: AppColor.accentColor,
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
title: Text('Home'.tr),
|
title: Text(
|
||||||
|
'SEFER'.tr,
|
||||||
|
style: AppStyle.title.copyWith(fontSize: 22),
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
GetBuilder<HomeCaptainController>(
|
MyCircleContainer(
|
||||||
builder: (orderRequestController) => MyCircleContainer(
|
child: Text(
|
||||||
child: Text(
|
homeCaptainController.countRefuse.toString(),
|
||||||
orderRequestController.countRefuse.toString(),
|
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
)),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
drawer: CupertinoDrawerCaptain(),
|
drawer: CupertinoDrawerCaptain(),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
GetBuilder<HomeCaptainController>(
|
GetBuilder<HomeCaptainController>(builder: (homeCaptainController) {
|
||||||
builder: (controller) => controller.isLoading
|
return homeCaptainController.isLoading
|
||||||
? const MyCircularProgressIndicator()
|
? const MyCircularProgressIndicator()
|
||||||
: GoogleMap(
|
: GoogleMap(
|
||||||
onMapCreated: controller.onMapCreated,
|
onMapCreated: homeCaptainController.onMapCreated,
|
||||||
// cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
// cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
||||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||||
|
|
||||||
@@ -82,24 +82,24 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
markerId: MarkerId('MyLocation'.tr),
|
markerId: MarkerId('MyLocation'.tr),
|
||||||
position: locationController.myLocation,
|
position: locationController.myLocation,
|
||||||
draggable: false,
|
draggable: false,
|
||||||
icon: controller.carIcon,
|
icon: homeCaptainController.carIcon,
|
||||||
rotation: locationController.heading)
|
rotation: locationController.heading)
|
||||||
},
|
},
|
||||||
mapType: controller.mapType
|
mapType: homeCaptainController.mapType
|
||||||
? MapType.satellite
|
? MapType.satellite
|
||||||
: MapType.terrain,
|
: MapType.terrain,
|
||||||
myLocationButtonEnabled: true,
|
myLocationButtonEnabled: true,
|
||||||
// liteModeEnabled: true, tiltGesturesEnabled: false,
|
// liteModeEnabled: true, tiltGesturesEnabled: false,
|
||||||
|
|
||||||
// indoorViewEnabled: true,
|
// indoorViewEnabled: true,
|
||||||
trafficEnabled: controller.mapTrafficON,
|
trafficEnabled: homeCaptainController.mapTrafficON,
|
||||||
buildingsEnabled: true,
|
buildingsEnabled: true,
|
||||||
mapToolbarEnabled: true,
|
mapToolbarEnabled: true,
|
||||||
|
|
||||||
myLocationEnabled: false,
|
myLocationEnabled: false,
|
||||||
// liteModeEnabled: true,
|
// liteModeEnabled: true,
|
||||||
),
|
);
|
||||||
),
|
}),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 10,
|
bottom: 10,
|
||||||
right: Get.width * .1,
|
right: Get.width * .1,
|
||||||
@@ -109,85 +109,83 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
top: 5,
|
top: 5,
|
||||||
right: Get.width * .05,
|
right: Get.width * .05,
|
||||||
left: Get.width * .05,
|
left: Get.width * .05,
|
||||||
child: GetBuilder<HomeCaptainController>(
|
child: Container(
|
||||||
builder: (homeCaptainController) => Container(
|
decoration: AppStyle.boxDecoration,
|
||||||
decoration: AppStyle.boxDecoration,
|
width: Get.width * .8,
|
||||||
width: Get.width * .8,
|
height: 104,
|
||||||
height: 104,
|
child: Center(
|
||||||
child: Center(
|
child: Column(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Row(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: [
|
||||||
children: [
|
const Icon(
|
||||||
const Icon(
|
Entypo.wallet,
|
||||||
Entypo.wallet,
|
color: AppColor.greenColor,
|
||||||
color: AppColor.greenColor,
|
),
|
||||||
|
Text(
|
||||||
|
' You Earn today is '.tr +
|
||||||
|
homeCaptainController.totalMoneyToday,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Entypo.wallet,
|
||||||
|
color: AppColor.yellowColor,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${' You Have in'.tr} ${AppInformation.appName} ${homeCaptainController.totalMoneyInSEFER} ',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Total Budget is '.tr +
|
||||||
|
Get.find<CaptainWalletController>().totalPoints,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(6),
|
||||||
|
color: int.parse(Get.find<HomeCaptainController>()
|
||||||
|
.countRideToday) <
|
||||||
|
5
|
||||||
|
? AppColor.accentColor
|
||||||
|
: int.parse(Get.find<HomeCaptainController>()
|
||||||
|
.countRideToday) >
|
||||||
|
5 &&
|
||||||
|
int.parse(Get.find<
|
||||||
|
HomeCaptainController>()
|
||||||
|
.countRideToday) <
|
||||||
|
10
|
||||||
|
? AppColor.yellowColor
|
||||||
|
: AppColor.greenColor,
|
||||||
),
|
),
|
||||||
Text(
|
child: Padding(
|
||||||
' You Earn today is '.tr +
|
padding: const EdgeInsets.symmetric(
|
||||||
homeCaptainController.totalMoneyToday,
|
horizontal: 8, vertical: 2),
|
||||||
style: AppStyle.title,
|
child: Text(
|
||||||
),
|
'Ride Today : '.tr +
|
||||||
],
|
Get.find<HomeCaptainController>()
|
||||||
),
|
.countRideToday,
|
||||||
Row(
|
style: AppStyle.title
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
.copyWith(color: AppColor.secondaryColor),
|
||||||
children: [
|
|
||||||
const Icon(
|
|
||||||
Entypo.wallet,
|
|
||||||
color: AppColor.yellowColor,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'${' You Have in'.tr} ${AppInformation.appName} ${homeCaptainController.totalMoneyInSEFER} ',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Total Budget is '.tr +
|
|
||||||
Get.find<CaptainWalletController>().totalPoints,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(6),
|
|
||||||
color: int.parse(Get.find<HomeCaptainController>()
|
|
||||||
.countRideToday) <
|
|
||||||
5
|
|
||||||
? AppColor.accentColor
|
|
||||||
: int.parse(Get.find<HomeCaptainController>()
|
|
||||||
.countRideToday) >
|
|
||||||
5 &&
|
|
||||||
int.parse(Get.find<
|
|
||||||
HomeCaptainController>()
|
|
||||||
.countRideToday) <
|
|
||||||
10
|
|
||||||
? AppColor.yellowColor
|
|
||||||
: AppColor.greenColor,
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 8, vertical: 2),
|
|
||||||
child: Text(
|
|
||||||
'Ride Today : '.tr +
|
|
||||||
Get.find<HomeCaptainController>()
|
|
||||||
.countRideToday,
|
|
||||||
style: AppStyle.title
|
|
||||||
.copyWith(color: AppColor.secondaryColor),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
))),
|
],
|
||||||
),
|
))),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 65,
|
bottom: 65,
|
||||||
|
|||||||
@@ -1,28 +1,21 @@
|
|||||||
import 'dart:io';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/controller/firebase/local_notification.dart';
|
import 'package:SEFER/controller/firebase/local_notification.dart';
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/auth/captin/cards/egypt_card_a_i.dart';
|
import 'package:bubble_head/bubble.dart';
|
||||||
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
|
|
||||||
import 'package:SEFER/views/auth/captin/login_captin.dart';
|
|
||||||
import 'package:SEFER/views/home/Captin/driver_map_page.dart';
|
|
||||||
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:bubble_head/bubble.dart';
|
|
||||||
import 'package:flutter_overlay_window/flutter_overlay_window.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
|
||||||
import '../../../../../constant/colors.dart';
|
import '../../../../../constant/colors.dart';
|
||||||
import '../../../../../constant/links.dart';
|
import '../../../../../controller/functions/audio_controller.dart';
|
||||||
import '../../../../../controller/firebase/firbase_messge.dart';
|
|
||||||
import '../../../../../controller/functions/location_permission.dart';
|
|
||||||
import '../../../../../controller/functions/overlay_permisssion.dart';
|
|
||||||
import '../../../../../print.dart';
|
|
||||||
import '../../../../Rate/ride_calculate_driver.dart';
|
import '../../../../Rate/ride_calculate_driver.dart';
|
||||||
import '../../../../../controller/functions/location_controller.dart';
|
import '../../../../../controller/functions/location_controller.dart';
|
||||||
|
import '../../driver_map_page.dart';
|
||||||
|
import '../../orderCaptin/order_speed_request.dart';
|
||||||
|
|
||||||
GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||||
return GetBuilder<HomeCaptainController>(
|
return GetBuilder<HomeCaptainController>(
|
||||||
@@ -186,32 +179,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
// Platform.isAndroid
|
// 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 {
|
|
||||||
// bool isOverlayActive =
|
|
||||||
// await FlutterOverlayWindow.isActive();
|
|
||||||
// if (isOverlayActive) {
|
|
||||||
// await FlutterOverlayWindow.closeOverlay();
|
|
||||||
// }
|
|
||||||
// // print(box.read(BoxName.tokenDriver));
|
|
||||||
// },
|
|
||||||
// icon: const Icon(
|
|
||||||
// FontAwesome5.window_close,
|
|
||||||
// size: 29,
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }),
|
|
||||||
// )
|
|
||||||
// : const SizedBox(),
|
|
||||||
// AnimatedContainer(
|
// AnimatedContainer(
|
||||||
// duration: const Duration(microseconds: 200),
|
// duration: const Duration(microseconds: 200),
|
||||||
// width: controller.widthMapTypeAndTraffic,
|
// width: controller.widthMapTypeAndTraffic,
|
||||||
@@ -222,63 +190,109 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
// child: Builder(builder: (context) {
|
// child: Builder(builder: (context) {
|
||||||
// return IconButton(
|
// return IconButton(
|
||||||
// onPressed: () async {
|
// onPressed: () async {
|
||||||
// Get.to(() => LoginCaptin());
|
// // NotificationController().showNotification(
|
||||||
|
// // ' message.notification!.title.toString()',
|
||||||
|
// // ' message.notification!.body.toString()',
|
||||||
|
// // 'order',
|
||||||
|
// // '');
|
||||||
|
// },
|
||||||
|
// icon: const Icon(
|
||||||
|
// FontAwesome5.window_close,
|
||||||
|
// size: 29,
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }),
|
||||||
|
// ),
|
||||||
|
// : const SizedBox(),
|
||||||
|
// 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 {
|
||||||
|
// // Get.to(() => LoginCaptin());
|
||||||
// // print(box.read(BoxName.myList));
|
// // 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"
|
||||||
|
// ];
|
||||||
|
|
||||||
// // List<String> d = [
|
// box.write(BoxName.rideArguments, {
|
||||||
// // "30.003028,31.2419628",
|
// 'passengerLocation': d[0].toString(),
|
||||||
// // "30.0955661,31.2665336",
|
// 'passengerDestination': d[1].toString(),
|
||||||
// // "160.00",
|
// 'Duration': d[4].toString(),
|
||||||
// // "25.92",
|
// 'totalCost': d[26].toString(),
|
||||||
// // "1488",
|
// 'Distance': d[5].toString(),
|
||||||
// // "16.93",
|
// 'name': d[8].toString(),
|
||||||
// // "114243034311436865474",
|
// 'phone': d[10].toString(),
|
||||||
// // "113172279072358305645",
|
// 'email': d[28].toString(),
|
||||||
// // "hamza ayed",
|
// 'WalletChecked': d[13].toString(),
|
||||||
// // "rlMbi4Hc8L1STMPE99iPKqK4Gddwv8r9qZOCadsz9qTEJZ6KLEE9ruTJI6N8dKfK4CXez5pme5WIs14-1QGo29s07fQOniZgIlJV5XFL3yqzPRSUmn3",
|
// 'tokenPassenger': d[9].toString(),
|
||||||
// // "+201023248456",
|
// 'direction':
|
||||||
// // "1 min",
|
// 'https://www.google.com/maps/dir/${d[0]}/${d[1]}/',
|
||||||
// // "1 m",
|
// 'DurationToPassenger': d[15].toString(),
|
||||||
// // "false",
|
// 'rideId': d[16].toString(),
|
||||||
// // "QwUMoyUtZ0J3oR6yXKUavrB_gBl9npUZe-qZtax-Raq4QBbdKv0AmtLKm0BfBd6N_592HBv4CVa41ii4122W3hr-BCUKKzJhzZcK8m0YjbWbtpvgJRD8uD_nuMk9",
|
// 'passengerId': d[7].toString(),
|
||||||
// // "0",
|
// 'driverId': d[18].toString(),
|
||||||
// // "238",
|
// 'durationOfRideValue': d[19].toString(),
|
||||||
// // "false",
|
// 'paymentAmount': d[2].toString(),
|
||||||
// // "114243034311436865474",
|
// 'paymentMethod':
|
||||||
// // "1488",
|
// d[13].toString() == 'true' ? 'visa' : 'cash',
|
||||||
// // "startEnd",
|
// 'isHaveSteps': d[20].toString(),
|
||||||
// // "30.049307749732176,31.274291574954987",
|
// 'step0': d[21].toString(),
|
||||||
// // "",
|
// 'step1': d[22].toString(),
|
||||||
// // "",
|
// 'step2': d[23].toString(),
|
||||||
// // "",
|
// 'step3': d[24].toString(),
|
||||||
// // "",
|
// 'step4': d[25].toString(),
|
||||||
// // "17.73",
|
// 'passengerWalletBurc': d[26].toString(),
|
||||||
// // "0",
|
// 'timeOfOrder': DateTime.now().toString(),
|
||||||
// // "hamzaayedflutter@gmail.com",
|
// 'totalPassenger': d[2].toString(),
|
||||||
// // "الفسطاط، حي مصر القديمة، مصر",
|
// 'carType': d[31].toString(),
|
||||||
// // " الزاوية الحمراء، محافظة القاهرة، مصر",
|
// 'kazan': d[32].toString(),
|
||||||
// // "Speed",
|
// 'startNameLocation': d[29].toString(),
|
||||||
// // "8",
|
// 'endNameLocation': d[30].toString(),
|
||||||
// // "5.00"
|
// });
|
||||||
// // ];
|
// Get.to(() => PassengerLocationMapPage(),
|
||||||
// // FirebaseMessagesController().sendNotificationToDriverMAP(
|
// arguments: box.read(BoxName.rideArguments));
|
||||||
// // 'Order'.tr,
|
// // Get.offAll(() => HomeCaptainController());
|
||||||
// // 'from: ',
|
|
||||||
// // // jsonDecode(value)['message'].toString(),
|
|
||||||
// // 'fKBBB4_1R0q18-byySHUeG:APA91bHk2RmjjMt6eKr7KQnqh4CK02yW3H5E8g_beVcQFgiCG50j9KCtSU1O8PtvS_gA5xuJLhaorDV9AeslcyLFJFf302tICKMiKgsDP5pWkF5WXNw0-4NsoD-BnJxf0-Do9Vs1Zbpq',
|
|
||||||
// // d,
|
|
||||||
// // 'order.wav');
|
|
||||||
// // NotificationController()
|
|
||||||
// // .showNotification('VIP Order'.tr, '', 'order', '');
|
|
||||||
// // try {} catch (e) {
|
|
||||||
// // print('Error showing overlay: $e');
|
|
||||||
// // }
|
|
||||||
// // final Bubble _bubble = Bubble(showCloseButton: true);
|
|
||||||
// // try {
|
|
||||||
// // await _bubble.startBubbleHead(sendAppToBackground: false);
|
|
||||||
// // } on PlatformException {
|
|
||||||
// // print('Failed to call startBubbleHead');
|
|
||||||
// // }
|
|
||||||
// },
|
// },
|
||||||
// icon: const Icon(
|
// icon: const Icon(
|
||||||
// FontAwesome5.grin_tears,
|
// FontAwesome5.grin_tears,
|
||||||
@@ -288,6 +302,7 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
// );
|
// );
|
||||||
// }),
|
// }),
|
||||||
// ),
|
// ),
|
||||||
|
// ,
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||||
|
import 'package:SEFER/views/widgets/mydialoug.dart';
|
||||||
|
import 'package:bubble_head/bubble.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
@@ -19,7 +23,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Get.put(MapDriverController());
|
// Get.put(MapDriverController());
|
||||||
return GetBuilder<MapDriverController>(
|
return GetBuilder<MapDriverController>(
|
||||||
builder: (controller) => controller.isPassengerInfoWindow == true
|
builder: (controller) => controller.isPassengerInfoWindow == true
|
||||||
? Stack(
|
? Stack(
|
||||||
@@ -275,6 +279,11 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
AppStyle.boxDecoration,
|
AppStyle.boxDecoration,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
Bubble().startBubbleHead(
|
||||||
|
sendAppToBackground:
|
||||||
|
true);
|
||||||
|
}
|
||||||
await controller
|
await controller
|
||||||
.openGoogleMapFromDriverToPassenger();
|
.openGoogleMapFromDriverToPassenger();
|
||||||
},
|
},
|
||||||
@@ -437,30 +446,15 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
title: 'Start the Ride'.tr,
|
title: 'Start the Ride'.tr,
|
||||||
kolor: AppColor.greenColor,
|
kolor: AppColor.greenColor,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.defaultDialog(
|
MyDialog().getDialog(
|
||||||
title:
|
"Is the Passenger in your Car ?"
|
||||||
'Is the Passenger in your Car?'
|
.tr,
|
||||||
.tr,
|
"Don't start trip if not".tr,
|
||||||
titleStyle: AppStyle.title,
|
() async {
|
||||||
middleText:
|
await controller
|
||||||
"Don't start trip if not".tr,
|
.startRideFromDriver();
|
||||||
middleTextStyle: AppStyle.title,
|
// Close dialog after confirmation
|
||||||
confirm: MyElevatedButton(
|
},
|
||||||
title: 'OK'.tr,
|
|
||||||
kolor: AppColor.greenColor,
|
|
||||||
onPressed: () async {
|
|
||||||
await controller
|
|
||||||
.startRideFromDriver();
|
|
||||||
Get.back(); // Close dialog after confirmation
|
|
||||||
},
|
|
||||||
),
|
|
||||||
cancel: MyElevatedButton(
|
|
||||||
title: 'No, still Waiting.'.tr,
|
|
||||||
kolor: AppColor.redColor,
|
|
||||||
onPressed: () {
|
|
||||||
Get.back(); // Close dialog without action
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -489,21 +483,14 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
controller.isArrivedSend =
|
controller.isArrivedSend =
|
||||||
false;
|
false;
|
||||||
} else {
|
} else {
|
||||||
|
MyDialog().getDialog(
|
||||||
|
'You are not near the passenger location'
|
||||||
|
.tr,
|
||||||
|
'Please go to the pickup location exactly'
|
||||||
|
.tr, () {
|
||||||
|
Get.back();
|
||||||
|
});
|
||||||
// Show error dialog if the driver is far from passenger
|
// Show error dialog if the driver is far from passenger
|
||||||
Get.defaultDialog(
|
|
||||||
title:
|
|
||||||
'You are not near the passenger location'
|
|
||||||
.tr,
|
|
||||||
middleText:
|
|
||||||
'Please go to the pickup location exactly'
|
|
||||||
.tr,
|
|
||||||
confirm: MyElevatedButton(
|
|
||||||
title: 'Ok'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -561,37 +548,24 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
AppInformation.appName.tr,
|
AppInformation.appName.tr,
|
||||||
kolor: AppColor.deepPurpleAccent,
|
kolor: AppColor.deepPurpleAccent,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.defaultDialog(
|
MyDialog().getDialog(
|
||||||
title: 'Are you sure to cancel?'
|
'Are you sure to cancel?'.tr,
|
||||||
.tr,
|
'', () async {
|
||||||
titleStyle: AppStyle.title,
|
FirebaseMessagesController()
|
||||||
middleText: '',
|
.sendNotificationToPassengerToken(
|
||||||
confirm: MyElevatedButton(
|
'Driver Cancelled Your Trip',
|
||||||
title: 'Yes'.tr,
|
'You will need to pay the cost to the driver, or it will be deducted from your next trip'
|
||||||
onPressed: () async {
|
.tr,
|
||||||
FirebaseMessagesController()
|
controller.tokenPassenger,
|
||||||
.sendNotificationToPassengerToken(
|
[],
|
||||||
'Driver Cancelled Your Trip',
|
'cancel.wav',
|
||||||
'You will need to pay the cost to the driver, or it will be deducted from your next trip'
|
);
|
||||||
.tr,
|
await controller
|
||||||
controller.tokenPassenger,
|
.addWaitingTimeCostFromPassengerToDriverWallet();
|
||||||
[],
|
controller.isdriverWaitTimeEnd =
|
||||||
'cancel.wav',
|
false;
|
||||||
);
|
Get.back();
|
||||||
await controller
|
});
|
||||||
.addWaitingTimeCostFromPassengerToDriverWallet();
|
|
||||||
controller
|
|
||||||
.isdriverWaitTimeEnd =
|
|
||||||
false;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
cancel: MyElevatedButton(
|
|
||||||
title: 'No'.tr,
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
@@ -604,48 +578,6 @@ class PassengerInfoWindow extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
// : controller.remainingTimeToShowPassengerInfoWindowFromDriver > 0 //
|
|
||||||
// ? Positioned(
|
|
||||||
// bottom: Get.height * .2,
|
|
||||||
// left: 15,
|
|
||||||
// child: Container(
|
|
||||||
// decoration: AppStyle.boxDecoration,
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// Stack(
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// children: [
|
|
||||||
// const CircularProgressIndicator(
|
|
||||||
// backgroundColor: AppColor.redColor,
|
|
||||||
// strokeWidth: 10,
|
|
||||||
// color: AppColor.redColor,
|
|
||||||
// value: 1,
|
|
||||||
// ),
|
|
||||||
// CircularProgressIndicator(
|
|
||||||
// value: controller.progress,
|
|
||||||
// // Set the color based on the "isNearEnd" condition
|
|
||||||
// color: AppColor.yellowColor,
|
|
||||||
// ),
|
|
||||||
// Text(
|
|
||||||
// '${controller.remainingTimeToShowPassengerInfoWindowFromDriver}',
|
|
||||||
// style: AppStyle.number,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// const SizedBox(
|
|
||||||
// width: 10,
|
|
||||||
// ),
|
|
||||||
// Text(
|
|
||||||
// 'Please Wait If passenger want To Cancel!'.tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -327,57 +327,17 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
'status': 'Apply',
|
'status': 'Apply',
|
||||||
'driver_id': box.read(BoxName.driverID),
|
'driver_id': box.read(BoxName.driverID),
|
||||||
});
|
});
|
||||||
CRUD().post(
|
if (AppLink.endPoint != AppLink.seferCairoServer) {
|
||||||
link:
|
CRUD().post(
|
||||||
"${AppLink.seferAlexandriaServer}/rides/updateStausFromSpeed.php",
|
link:
|
||||||
payload: {
|
"${AppLink.endPoint}/rides/updateStausFromSpeed.php",
|
||||||
'id': orderRequestController.myList[16],
|
payload: {
|
||||||
'rideTimeStart': DateTime.now().toString(),
|
'id': orderRequestController.myList[16],
|
||||||
'status': 'Apply',
|
'rideTimeStart': DateTime.now().toString(),
|
||||||
'driver_id': box.read(BoxName.driverID),
|
'status': 'Apply',
|
||||||
});
|
'driver_id': box.read(BoxName.driverID),
|
||||||
CRUD().post(
|
});
|
||||||
link:
|
}
|
||||||
"${AppLink.seferGizaServer}/rides/updateStausFromSpeed.php",
|
|
||||||
payload: {
|
|
||||||
'id': orderRequestController.myList[16],
|
|
||||||
'rideTimeStart': DateTime.now().toString(),
|
|
||||||
'status': 'Apply',
|
|
||||||
'driver_id': box.read(BoxName.driverID),
|
|
||||||
});
|
|
||||||
await CRUD().postFromDialogue(
|
|
||||||
link: AppLink.addDriverOrder,
|
|
||||||
payload: {
|
|
||||||
'driver_id':
|
|
||||||
orderRequestController.myList[6].toString(),
|
|
||||||
// box.read(BoxName.driverID).toString(),
|
|
||||||
'order_id': orderRequestController.myList[16]
|
|
||||||
.toString(),
|
|
||||||
'status': 'Apply'
|
|
||||||
});
|
|
||||||
CRUD().postFromDialogue(
|
|
||||||
link:
|
|
||||||
'${AppLink.seferAlexandriaServer}/driver_order/add.php',
|
|
||||||
payload: {
|
|
||||||
'driver_id':
|
|
||||||
orderRequestController.myList[6].toString(),
|
|
||||||
// box.read(BoxName.driverID).toString(),
|
|
||||||
'order_id': orderRequestController.myList[16]
|
|
||||||
.toString(),
|
|
||||||
'status': 'Apply'
|
|
||||||
});
|
|
||||||
|
|
||||||
CRUD().postFromDialogue(
|
|
||||||
link:
|
|
||||||
'${AppLink.seferGizaServer}/driver_order/add.php',
|
|
||||||
payload: {
|
|
||||||
'driver_id':
|
|
||||||
orderRequestController.myList[6].toString(),
|
|
||||||
// box.read(BoxName.driverID).toString(),
|
|
||||||
'order_id': orderRequestController.myList[16]
|
|
||||||
.toString(),
|
|
||||||
'status': 'Apply'
|
|
||||||
});
|
|
||||||
|
|
||||||
// .then((value) {
|
// .then((value) {
|
||||||
// var json = jsonDecode(res);
|
// var json = jsonDecode(res);
|
||||||
@@ -414,28 +374,32 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
orderRequestController.body.toString(),
|
orderRequestController.body.toString(),
|
||||||
'status': 'Apply'
|
'status': 'Apply'
|
||||||
});
|
});
|
||||||
CRUD().postFromDialogue(
|
await CRUD().postFromDialogue(
|
||||||
link:
|
link: AppLink.addDriverOrder,
|
||||||
'${AppLink.seferAlexandriaServer}/driver_order/add.php',
|
|
||||||
payload: {
|
payload: {
|
||||||
'driver_id': orderRequestController.myList[6]
|
'driver_id': orderRequestController.myList[6]
|
||||||
.toString(),
|
.toString(),
|
||||||
// box.read(BoxName.driverID).toString(),
|
// box.read(BoxName.driverID).toString(),
|
||||||
'order_id':
|
'order_id': orderRequestController.myList[16]
|
||||||
orderRequestController.body.toString(),
|
|
||||||
'status': 'Apply'
|
|
||||||
});
|
|
||||||
CRUD().postFromDialogue(
|
|
||||||
link:
|
|
||||||
'${AppLink.seferGizaServer}/driver_order/add.php',
|
|
||||||
payload: {
|
|
||||||
'driver_id': orderRequestController.myList[6]
|
|
||||||
.toString(),
|
.toString(),
|
||||||
// box.read(BoxName.driverID).toString(),
|
|
||||||
'order_id':
|
|
||||||
orderRequestController.body.toString(),
|
|
||||||
'status': 'Apply'
|
'status': 'Apply'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (AppLink.endPoint != AppLink.seferCairoServer) {
|
||||||
|
CRUD().post(
|
||||||
|
link:
|
||||||
|
"${AppLink.endPoint}/driver_order/add.php",
|
||||||
|
payload: {
|
||||||
|
'driver_id': orderRequestController
|
||||||
|
.myList[6]
|
||||||
|
.toString(),
|
||||||
|
// box.read(BoxName.driverID).toString(),
|
||||||
|
'order_id': orderRequestController
|
||||||
|
.myList[16]
|
||||||
|
.toString(),
|
||||||
|
'status': 'Apply'
|
||||||
|
});
|
||||||
|
}
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
'Apply Ride',
|
'Apply Ride',
|
||||||
|
|||||||
Reference in New Issue
Block a user