diff --git a/android/app/build.gradle b/android/app/build.gradle index b9e7a6c..840a559 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -55,8 +55,8 @@ android { // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 22 targetSdkVersion flutter.targetSdkVersion - versionCode 27 - versionName '1.4.91' + versionCode 28 + versionName '1.4.93' // manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml'] } diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index deaf1b6..e5e8a83 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -1,104 +1,101 @@ - - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLSchemes - - - com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf - - - - - LSApplicationQueriesSchemes - - googlechromes - comgooglemaps - - CADisableMinimumFrameDurationOnPhone - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Sefer - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleGetInfoString - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Sefer - CFBundlePackageType - APPL - CFBundleShortVersionString - 21 - CFBundleSignature - ???? - CFBundleVersion - 1.41 - FirebaseAppDelegateProxyEnabled - NO - GMSApiKey - YOUR_API_KEY - LSApplicationCategoryType - - LSRequiresIPhoneOS - - NSCameraUsageDescription - Sefer app requires access to your camera in order to scan QR codes and capture + + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf + + + + LSApplicationQueriesSchemes + + googlechromes + comgooglemaps + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Sefer + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleGetInfoString + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Sefer + CFBundlePackageType + APPL + CFBundleShortVersionString + 22 + CFBundleSignature + ???? + CFBundleVersion + 1.42 + FirebaseAppDelegateProxyEnabled + NO + GMSApiKey + YOUR_API_KEY + LSApplicationCategoryType + + LSRequiresIPhoneOS + + NSCameraUsageDescription + 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. - NSFaceIDUsageDescription - Use Face ID to securely authenticate payment accounts. - NSLocationAlwaysAndWhenInUseUsageDescription - This app needs access to your location to provide you with the best ride experience. + NSFaceIDUsageDescription + Use Face ID to securely authenticate payment accounts. + NSLocationAlwaysAndWhenInUseUsageDescription + 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 the closest captain for efficient and convenient rides. - NSLocationAlwaysUsageDescription - This app needs access to location. - NSLocationWhenInUseUsageDescription - This app needs access to your location to provide you with the best ride experience. + NSLocationAlwaysUsageDescription + This app needs access to location. + NSLocationWhenInUseUsageDescription + 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 the closest captain for efficient and convenient rides. - NSMicrophoneUsageDescription - This app requires access to your microphone to record audio, allowing you to add + NSMicrophoneUsageDescription + 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. - NSPhotoLibraryUsageDescription - Explanation of why your app needs access to the photo library. - UIApplicationSupportsIndirectInputEvents - - UIBackgroundModes - - fetch - location - remote-notification - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - \ No newline at end of file + NSPhotoLibraryUsageDescription + Explanation of why your app needs access to the photo library. + UIApplicationSupportsIndirectInputEvents + + UIBackgroundModes + + fetch + location + remote-notification + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/lib/controller/functions/device_info.dart b/lib/controller/functions/device_info.dart index 4618260..4eacbc0 100644 --- a/lib/controller/functions/device_info.dart +++ b/lib/controller/functions/device_info.dart @@ -1,104 +1,104 @@ -import 'dart:io'; - -import 'package:device_info_plus/device_info_plus.dart'; - -class DeviceInfoPlus { - static List> deviceDataList = []; - - static Future>> getDeviceInfo() async { - final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); - - try { - if (Platform.isAndroid) { - AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo; - Map deviceData = { - 'platform': 'Android', - 'brand': androidInfo.brand, - 'model': androidInfo.model, - 'androidId': androidInfo.device, - 'versionRelease': androidInfo.version.release, - 'sdkVersion': androidInfo.version.sdkInt, - 'manufacturer': androidInfo.manufacturer, - 'isPhysicalDevice': androidInfo.isPhysicalDevice, - 'serialNumber': androidInfo.serialNumber, - 'fingerprint': androidInfo.fingerprint, - 'type': androidInfo.type, - 'data': androidInfo.data, - 'version': androidInfo.version, - 'tags': androidInfo.tags, - 'display': androidInfo.display, - }; - deviceDataList.add(deviceData); - } else if (Platform.isIOS) { - IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo; - Map deviceData = { - 'brand': 'Apple', - 'model': iosInfo.model, - 'systemName': iosInfo.systemName, - 'systemVersion': iosInfo.systemVersion, - 'utsname': iosInfo.utsname, - 'isPhysicalDevice': iosInfo.isPhysicalDevice, - 'identifierForVendor': iosInfo.identifierForVendor, - 'name': iosInfo.name, - 'localizedModel': iosInfo.localizedModel, - }; - deviceDataList.add(deviceData); - } else if (Platform.isMacOS) { - MacOsDeviceInfo macInfo = await deviceInfoPlugin.macOsInfo; - Map deviceData = { - 'platform': 'macOS', - 'model': macInfo.model, - 'version': macInfo.systemGUID, - }; - deviceDataList.add(deviceData); - } else if (Platform.isWindows) { - WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo; - Map deviceData = { - 'platform': 'Windows', - 'manufacturer': windowsInfo.computerName, - 'version': windowsInfo.majorVersion, - 'deviceId': windowsInfo.deviceId, - 'userName': windowsInfo.userName, - 'productName': windowsInfo.productName, - 'installDate': windowsInfo.installDate, - 'productId': windowsInfo.productId, - 'numberOfCores': windowsInfo.numberOfCores, - 'systemMemoryInMegabytes': windowsInfo.systemMemoryInMegabytes, - }; - deviceDataList.add(deviceData); - } else if (Platform.isLinux) { - LinuxDeviceInfo linuxInfo = await deviceInfoPlugin.linuxInfo; - Map deviceData = { - 'platform': 'Linux', - 'manufacturer': linuxInfo.name, - 'version': linuxInfo.version, - }; - deviceDataList.add(deviceData); - } - } catch (e) { - print('Failed to get device info: $e'); - } - - return deviceDataList; - } - - // Method to print all device data - static void printDeviceInfo() { - for (Map deviceData in deviceDataList) { - print('Platform: ${deviceData['platform']}'); - print('Brand: ${deviceData['brand']}'); - print('Model: ${deviceData['model']}'); - print( - 'Version: ${deviceData['version'] ?? deviceData['versionRelease'] ?? 'N/A'}'); - print('Manufacturer: ${deviceData['manufacturer'] ?? 'N/A'}'); - print('Is Physical Device: ${deviceData['isPhysicalDevice']}'); - print('Serial Number: ${deviceData['serialNumber'] ?? 'N/A'}'); - print('Fingerprint: ${deviceData['fingerprint'] ?? 'N/A'}'); - print('Type: ${deviceData['type'] ?? 'N/A'}'); - print('Data: ${deviceData['data'] ?? 'N/A'}'); - print('Tags: ${deviceData['tags'] ?? 'N/A'}'); - print('Display: ${deviceData['display'] ?? 'N/A'}'); - print('--------------------'); - } - } -} +// import 'dart:io'; +// +// import 'package:device_info_plus/device_info_plus.dart'; +// +// class DeviceInfoPlus { +// static List> deviceDataList = []; +// +// static Future>> getDeviceInfo() async { +// final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); +// +// try { +// if (Platform.isAndroid) { +// AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo; +// Map deviceData = { +// 'platform': 'Android', +// 'brand': androidInfo.brand, +// 'model': androidInfo.model, +// 'androidId': androidInfo.device, +// 'versionRelease': androidInfo.version.release, +// 'sdkVersion': androidInfo.version.sdkInt, +// 'manufacturer': androidInfo.manufacturer, +// 'isPhysicalDevice': androidInfo.isPhysicalDevice, +// 'serialNumber': androidInfo.serialNumber, +// 'fingerprint': androidInfo.fingerprint, +// 'type': androidInfo.type, +// 'data': androidInfo.data, +// 'version': androidInfo.version, +// 'tags': androidInfo.tags, +// 'display': androidInfo.display, +// }; +// deviceDataList.add(deviceData); +// } else if (Platform.isIOS) { +// IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo; +// Map deviceData = { +// 'brand': 'Apple', +// 'model': iosInfo.model, +// 'systemName': iosInfo.systemName, +// 'systemVersion': iosInfo.systemVersion, +// 'utsname': iosInfo.utsname, +// 'isPhysicalDevice': iosInfo.isPhysicalDevice, +// 'identifierForVendor': iosInfo.identifierForVendor, +// 'name': iosInfo.name, +// 'localizedModel': iosInfo.localizedModel, +// }; +// deviceDataList.add(deviceData); +// } else if (Platform.isMacOS) { +// MacOsDeviceInfo macInfo = await deviceInfoPlugin.macOsInfo; +// Map deviceData = { +// 'platform': 'macOS', +// 'model': macInfo.model, +// 'version': macInfo.systemGUID, +// }; +// deviceDataList.add(deviceData); +// } else if (Platform.isWindows) { +// WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo; +// Map deviceData = { +// 'platform': 'Windows', +// 'manufacturer': windowsInfo.computerName, +// 'version': windowsInfo.majorVersion, +// 'deviceId': windowsInfo.deviceId, +// 'userName': windowsInfo.userName, +// 'productName': windowsInfo.productName, +// 'installDate': windowsInfo.installDate, +// 'productId': windowsInfo.productId, +// 'numberOfCores': windowsInfo.numberOfCores, +// 'systemMemoryInMegabytes': windowsInfo.systemMemoryInMegabytes, +// }; +// deviceDataList.add(deviceData); +// } else if (Platform.isLinux) { +// LinuxDeviceInfo linuxInfo = await deviceInfoPlugin.linuxInfo; +// Map deviceData = { +// 'platform': 'Linux', +// 'manufacturer': linuxInfo.name, +// 'version': linuxInfo.version, +// }; +// deviceDataList.add(deviceData); +// } +// } catch (e) { +// print('Failed to get device info: $e'); +// } +// +// return deviceDataList; +// } +// +// // Method to print all device data +// static void printDeviceInfo() { +// for (Map deviceData in deviceDataList) { +// print('Platform: ${deviceData['platform']}'); +// print('Brand: ${deviceData['brand']}'); +// print('Model: ${deviceData['model']}'); +// print( +// 'Version: ${deviceData['version'] ?? deviceData['versionRelease'] ?? 'N/A'}'); +// print('Manufacturer: ${deviceData['manufacturer'] ?? 'N/A'}'); +// print('Is Physical Device: ${deviceData['isPhysicalDevice']}'); +// print('Serial Number: ${deviceData['serialNumber'] ?? 'N/A'}'); +// print('Fingerprint: ${deviceData['fingerprint'] ?? 'N/A'}'); +// print('Type: ${deviceData['type'] ?? 'N/A'}'); +// print('Data: ${deviceData['data'] ?? 'N/A'}'); +// print('Tags: ${deviceData['tags'] ?? 'N/A'}'); +// print('Display: ${deviceData['display'] ?? 'N/A'}'); +// print('--------------------'); +// } +// } +// } diff --git a/lib/controller/home/map_passenger_controller.dart b/lib/controller/home/map_passenger_controller.dart index 47fa470..cec798a 100644 --- a/lib/controller/home/map_passenger_controller.dart +++ b/lib/controller/home/map_passenger_controller.dart @@ -907,7 +907,8 @@ class MapPassengerController extends GetxController { rideConfirm = true; shouldFetch = true; isBottomSheetShown = false; - timeToPassengerFromDriverAfterApplied = 60; + timeToPassengerFromDriverAfterApplied = + durationToPassenger; //60 todo durationToPassenger;/ isDriversTokensSend = false; update(); @@ -1337,7 +1338,7 @@ class MapPassengerController extends GetxController { for (var i = 0; i < loopCount; i++) { // Wait for 50 seconds. await Future.delayed(const Duration(seconds: 4)); - if (isRideFinished == true) { + if (rideTimerBegin == true) { await getDriverCarsLocationToPassengerAfterApplied(); } reloadMarkerDriverCarsLocationToPassengerAfterApplied(); @@ -1353,7 +1354,7 @@ class MapPassengerController extends GetxController { // Wait for 50 seconds. print('loop is $i from $loopCount'); await Future.delayed(const Duration(seconds: 4)); - if (isRideFinished == true) { + if (rideTimerBegin == true) { await getDriverCarsLocationToPassengerAfterApplied(); } reloadMarkerDriverCarsLocationToPassengerAfterApplied(); @@ -1916,7 +1917,7 @@ class MapPassengerController extends GetxController { i < dataCarsLocationByPassenger['message'].length; i++) { var carLocation = dataCarsLocationByPassenger['message'][i]; - durationToPassenger = 100; ////// + // Calculate the distance between the passenger's location and the current driver's location final distance = Geolocator.distanceBetween( passengerLocation.latitude, @@ -1924,7 +1925,8 @@ class MapPassengerController extends GetxController { double.parse(carLocation['latitude']), double.parse(carLocation['longitude']), ); - + durationToPassenger = (distance * 35 * (1000 / 3600)) + .round(); //////35 is avg of speed in city // Update the UI with the distance and duration update(); @@ -2599,8 +2601,12 @@ class MapPassengerController extends GetxController { payload: {'passenger_id': box.read(BoxName.passengerID)}); if (res != 'failure') { print(jsonDecode(res)['message']['rating']); - passengerRate = - double.parse(jsonDecode(res)['message']['rating'].toString()); + if (jsonDecode(res)['message']['rating'] == null) { + passengerRate = 5; + } else { + passengerRate = + double.parse(jsonDecode(res)['message']['rating'].toString()); + } } } diff --git a/lib/main.dart b/lib/main.dart index 921e978..e3fe14e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -15,7 +15,6 @@ import 'constant/credential.dart'; import 'constant/info.dart'; import 'controller/firebase/firbase_messge.dart'; import 'controller/firebase/local_notification.dart'; -import 'controller/functions/device_info.dart'; import 'controller/local/local_controller.dart'; import 'controller/local/translations.dart'; import 'controller/payment/paymob/paymob_wallet.dart'; @@ -52,7 +51,7 @@ void main() async { print( 'local is ${WidgetsBinding.instance.platformDispatcher.locale.countryCode}'); - print(Get.deviceLocale!.countryCode); + // print(Get.deviceLocale!.countryCode); Stripe.publishableKey = AK.publishableKey; // if (box.read(BoxName.driverID) != null) {} if (Platform.isAndroid || Platform.isIOS) { @@ -89,11 +88,11 @@ void main() async { iFrameID: 837992, ); // Get device information - List> deviceDataList = - await DeviceInfoPlus.getDeviceInfo(); - - // Print all device data - DeviceInfoPlus.printDeviceInfo(); + // List> deviceDataList = + // await DeviceInfoPlus.getDeviceInfo(); + // + // // Print all device data + // DeviceInfoPlus.printDeviceInfo(); runApp(const MyApp()); }