This commit is contained in:
Hamza-Ayed
2024-09-17 00:31:50 +03:00
parent c24eee9e1d
commit 1b50de9a7c
12 changed files with 199 additions and 157 deletions

View File

@@ -25,6 +25,7 @@
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:enableOnBackInvokedCallback="true"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<meta-data <meta-data
android:name="io.flutter.embedding.android.NormalTheme" android:name="io.flutter.embedding.android.NormalTheme"

View File

@@ -1,101 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-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>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict> <dict>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Editor</string> <string>Editor</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf</string> <string>com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf</string>
</array> </array>
</dict> </dict>
</array> </array>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>googlechromes</string> <string>googlechromes</string>
<string>comgooglemaps</string> <string>comgooglemaps</string>
</array> </array>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true/> <true />
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Sefer</string> <string>Sefer</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string></string> <string></string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Sefer</string> <string>Sefer</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>48</string> <string>48</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>4.3.48</string> <string>4.3.48</string>
<key>FirebaseAppDelegateProxyEnabled</key> <key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string> <string>NO</string>
<key>GMSApiKey</key> <key>GMSApiKey</key>
<string>YOUR_API_KEY</string> <string>YOUR_API_KEY</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string></string> <string></string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true />
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>Sefer app requires access to your camera in order to scan QR codes and capture <string>Sefer app requires access to your camera in order to scan QR codes and capture
images for uploading and access to connect to a call.</string> images for uploading and access to connect to a call.</string>
<key>NSFaceIDUsageDescription</key> <key>NSFaceIDUsageDescription</key>
<string>Use Face ID to securely authenticate payment accounts.</string> <string>Use Face ID to securely authenticate payment accounts.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience. <string>This app needs access to your location to provide you with the best ride experience.
Your location data will be used to find the nearest available cars and connect you with Your location data will be used to find the nearest available cars and connect you with
the closest captain for efficient and convenient rides.</string> the closest captain for efficient and convenient rides.</string>
<key>NSLocationAlwaysUsageDescription</key> <key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location.</string> <string>This app needs access to location.</string>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience. <string>This app needs access to your location to provide you with the best ride experience.
Your location data will be used to find the nearest available cars and connect you with Your location data will be used to find the nearest available cars and connect you with
the closest captain for efficient and convenient rides.</string> the closest captain for efficient and convenient rides.</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>This app requires access to your microphone to record audio, allowing you to add <string>This app requires access to your microphone to record audio, allowing you to add
voice recordings to your photos and videos and access to connect to a call.</string> voice recordings to your photos and videos and access to connect to a call.</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>Explanation of why your app needs access to the photo library.</string> <string>Explanation of why your app needs access to the photo library.</string>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
<true/> <true />
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
<string>fetch</string> <string>fetch</string>
<string>location</string> <string>location</string>
<string>remote-notification</string> <string>remote-notification</string>
</array> </array>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main</string> <string>Main</string>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false />
</dict> </dict>
</plist> </plist>

View File

@@ -25,6 +25,7 @@ class BoxName {
static const String sosPhoneDriver = "sosPhoneDriver"; static const String sosPhoneDriver = "sosPhoneDriver";
static const String passengerID = "pasengerID"; static const String passengerID = "pasengerID";
static const String phone = "phone"; static const String phone = "phone";
static const String phoneWallet = "phoneWallet";
static const String phoneDriver = "phoneDriver"; static const String phoneDriver = "phoneDriver";
static const String dobDriver = "dobDriver"; static const String dobDriver = "dobDriver";
static const String sexDriver = "sexDriver"; static const String sexDriver = "sexDriver";

View File

@@ -246,10 +246,10 @@ class LoginController extends GetxController {
void onInit() async { void onInit() async {
// permissionLocation = await Permission.locationWhenInUse.isGranted; // permissionLocation = await Permission.locationWhenInUse.isGranted;
await getAppTester(AppInformation.appName); await getAppTester(AppInformation.appName);
if (isTest == 0 && box.read(BoxName.passengerID) != null) { // if (isTest == 0 && box.read(BoxName.passengerID) != null) {
await loginUsingCredentials( // await loginUsingCredentials(
box.read(BoxName.passengerID), box.read(BoxName.email)); // box.read(BoxName.passengerID), box.read(BoxName.email));
} // }
super.onInit(); super.onInit();
} }
} }

View File

@@ -232,9 +232,10 @@ class RegisterController extends GetxController {
print('WhatsApp message sent to non-Egyptian phone number: $phoneNumber'); print('WhatsApp message sent to non-Egyptian phone number: $phoneNumber');
} }
isLoading = false; isLoading = false;
update();
isSent = true; isSent = true;
remainingTime = 300; // Reset to 5 minutes remainingTime = 300;
update(); // Reset to 5 minutes
startTimer(); startTimer();
} }

View File

@@ -495,34 +495,70 @@ class FirebaseMessagesController extends GetxController {
void sendNotificationToPassengerToken( void sendNotificationToPassengerToken(
String title, body, token, List<String> map, String tone) async { String title, body, token, List<String> map, String tone) async {
try { try {
String serviceAccountKeyJson = '''{
"type": "service_account",
"project_id": "ride-b1bd8",
"private_key_id": "75e817c0b902db2ef35edf2c2bd159dec1f13249",
"private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD0zH9TQGDQHUv3\\na3/JAD1UKPwAp3wNKT0a6fxiIzjI3JxQWI30QvZCcfl6CdMhIcydX1ncSaYTcEeC\\n/AdPVCPkqyJx1YIGGg6P/mRzCWeaN8fsp6z250m5vcObDCZc3dbJEkepbep+6FPY\\n21m3KO+AHh1glgsTGZOTm5xiU8NGXpdk2QEh8wpiIIlR/HuKwVw9g8urNe3Sno+U\\nDm3z37iFqvZdmpqO8aWTJu6beb3hsREK9XK2I9JqC2JUwiGQRo3idOvPP6hkqrWx\\nKSX96vglQFYfakvJdDp2ZATOlpBYPMtS/IWhJ985u58TSS+Kl8qpnpaZBSxgJirf\\nhWzhnKLfAgMBAAECggEAJP785SePGhS7ZN6ltspm+l+hSjYFrPWFCxq+rlQ1YkHZ\\nC9l+RqKSFhOkiPmQI2s4wbXl3kFxLHHlFNoi/q2wKQBmGb8TQfnRJpjjNHGA61Ev\\n0Ue7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xXOvReWxDluUopqWVGj5tlGqE5xUDku9SWJSxbkiQ3rqutzBdPXpr\\noqHwPyDrmK/Zgqn+uiIm4Ck=\\n-----END PRIVATE KEY-----\\n",
"client_email": "firebase-adminsdk-o2wqi@ride-b1bd8.iam.gserviceaccount.com",
"client_id": "111210077025005706623",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-o2wqi%40ride-b1bd8.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
'''; // As defined above
// Initialize AccessTokenManager
final accessTokenManager = AccessTokenManager(serviceAccountKeyJson);
// Obtain an OAuth 2.0 access token
final accessToken = await accessTokenManager.getAccessToken();
// Log.print('accessToken: ${accessToken}');
// Send the notification
final response = await http.post( final response = await http.post(
Uri.parse('https://fcm.googleapis.com/fcm/send'), Uri.parse(
'https://fcm.googleapis.com/v1/projects/ride-b1bd8/messages:send'),
headers: <String, String>{ headers: <String, String>{
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': 'key=${AK.serverAPI}' 'Authorization': 'Bearer $accessToken',
}, },
body: jsonEncode({ body: jsonEncode({
'notification': <String, dynamic>{ 'message': {
'title': title, 'token': token,
'body': body, 'notification': {
'sound': tone 'title': title,
'body': body,
},
'android': {
'notification': {
'sound': tone,
},
},
'apns': {
'payload': {
'aps': {
'sound': tone,
},
},
},
}, },
'data': {
'passengerList': map,
},
'priority': 'high',
'to': token,
}), }),
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
// Notification sent successfully print(
'Notification sent successfully. Status code: ${response.statusCode}');
print('Response body: ${response.body}');
} else { } else {
// Handle error response print(
'Failed to send notification. Status code: ${response.statusCode}'; 'Failed to send notification. Status code: ${response.statusCode}');
print('Response body: ${response.body}');
} }
} catch (e) { } catch (e) {
// Handle other exceptions print('Error sending notification: $e');
} }
} }

View File

@@ -1769,7 +1769,7 @@ class MapPassengerController extends GetxController {
'northeastLon': bounds.northeast.longitude.toString(), 'northeastLon': bounds.northeast.longitude.toString(),
}); });
break; break;
case 'Balash': case 'Awfar Car':
res = await CRUD() res = await CRUD()
.get(link: AppLink.getCarsLocationByPassengerBalash, payload: { .get(link: AppLink.getCarsLocationByPassengerBalash, payload: {
'southwestLat': bounds.southwest.latitude.toString(), 'southwestLat': bounds.southwest.latitude.toString(),

View File

@@ -7,6 +7,7 @@ class MyTranslation extends Translations {
"Update Available": "تحديث متوفر", "Update Available": "تحديث متوفر",
'Phone number must be exactly 11 digits long': 'Phone number must be exactly 11 digits long':
"رقم الهاتف يجب أن يكون بطول 11 رقماً", "رقم الهاتف يجب أن يكون بطول 11 رقماً",
'Insert Wallet phone number': 'أدخل رقم هاتف المحفظة',
"Phone number isn't an Egyptian phone number": "Phone number isn't an Egyptian phone number":
"رقم الهاتف ليس رقم هاتف مصري", "رقم الهاتف ليس رقم هاتف مصري",
"A new version of the app is available. Please update to the latest version.": "A new version of the app is available. Please update to the latest version.":

View File

@@ -31,6 +31,7 @@ class PaymentController extends GetxController {
bool isPromoSheetDialogue = false; bool isPromoSheetDialogue = false;
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
final promo = TextEditingController(); final promo = TextEditingController();
final walletphoneController = TextEditingController();
double totalPassenger = Get.find<MapPassengerController>().totalPassenger; double totalPassenger = Get.find<MapPassengerController>().totalPassenger;
int? selectedAmount = 0; int? selectedAmount = 0;
List<dynamic> totalPassengerWalletDetails = []; List<dynamic> totalPassengerWalletDetails = [];
@@ -762,44 +763,45 @@ class PaymentController extends GetxController {
billingData: PaymobBillingData(), billingData: PaymobBillingData(),
onPayment: (PaymobResponse response) {}, onPayment: (PaymobResponse response) {},
); );
if (response!.success == true && response.responseCode == '200') {
if (response!.responseCode == 'APPROVED') { if (response!.responseCode == 'APPROVED') {
Get.defaultDialog( Get.defaultDialog(
barrierDismissible: false, barrierDismissible: false,
title: 'Payment Successful'.tr, title: 'Payment Successful'.tr,
titleStyle: AppStyle.title, titleStyle: AppStyle.title,
// backgroundColor: AppColor.greenColor, // backgroundColor: AppColor.greenColor,
content: Text( content: Text(
'The payment was approved.'.tr, 'The payment was approved.'.tr,
style: AppStyle.title, style: AppStyle.title,
), ),
confirm: MyElevatedButton( confirm: MyElevatedButton(
kolor: AppColor.greenColor, kolor: AppColor.greenColor,
title: 'OK'.tr, title: 'OK'.tr,
onPressed: () async { onPressed: () async {
Get.back(); Get.back();
method(); method();
}, },
), ),
); );
} else { } else {
Get.defaultDialog( Get.defaultDialog(
barrierDismissible: false, barrierDismissible: false,
// backgroundColor: AppColor.redColor, // backgroundColor: AppColor.redColor,
title: 'Payment Failed'.tr, title: 'Payment Failed'.tr,
content: Text( content: Text(
'The payment was not approved. Please try again.'.tr, 'The payment was not approved. Please try again.'.tr,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: AppStyle.title, style: AppStyle.title,
), ),
confirm: MyElevatedButton( confirm: MyElevatedButton(
title: 'OK'.tr, title: 'OK'.tr,
kolor: AppColor.redColor, kolor: AppColor.redColor,
onPressed: () async { onPressed: () async {
Get.back(); Get.back();
}, },
), ),
); );
}
} }
} }
} catch (e) { } catch (e) {

View File

@@ -144,7 +144,7 @@ class PaymobPaymentWallet {
}) async { }) async {
final Map<String, dynamic> data = { final Map<String, dynamic> data = {
"source": { "source": {
"identifier": box.read(BoxName.phone).toString(), "identifier": box.read(BoxName.phoneWallet).toString(),
"subtype": "WALLET", "subtype": "WALLET",
}, },
"payment_token": paymentToken, "payment_token": paymentToken,
@@ -269,7 +269,7 @@ class PaymobBillingDataWallet {
"email": box.read(BoxName.email) ?? box.read(BoxName.emailDriver), "email": box.read(BoxName.email) ?? box.read(BoxName.emailDriver),
"first_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver), "first_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
"last_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver), "last_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
"phone_number": box.read(BoxName.phone) ?? box.read(BoxName.phoneDriver), "phone_number": box.read(BoxName.phoneWallet),
"apartment": apartment ?? "NA", "apartment": apartment ?? "NA",
"floor": floor ?? "NA", "floor": floor ?? "NA",
"building": building ?? "NA", "building": building ?? "NA",

View File

@@ -77,9 +77,9 @@ void main() async {
userTokenExpiration: 200, userTokenExpiration: 200,
iFrameID: 837992, iFrameID: 837992,
); );
PaymobPaymentWallet.instance.initialize( PaymobPaymentWallet.instance.initialize(
apiKey: AK apiKey: AK.payMobApikey,
.payMobApikey, // from dashboard Select Settings -> Account Info -> API Key
integrationID: int.parse(AK.integrationIdPayMobWallet), integrationID: int.parse(AK.integrationIdPayMobWallet),
userTokenExpiration: 200, userTokenExpiration: 200,
iFrameID: 837992, iFrameID: 837992,

View File

@@ -27,7 +27,7 @@ class MyTextForm extends StatelessWidget {
children: [ children: [
Text( Text(
label.tr, label.tr,
style: TextStyle( style: const TextStyle(
color: CupertinoColors.label, color: CupertinoColors.label,
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,