This commit is contained in:
Hamza-Ayed
2024-05-29 00:00:54 +03:00
parent b7dd057e12
commit 79c4dd32da
5 changed files with 217 additions and 215 deletions

View File

@@ -55,8 +55,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.
minSdkVersion 22 minSdkVersion 22
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode 27 versionCode 28
versionName '1.4.91' versionName '1.4.93'
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml'] // manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
} }

View File

@@ -1,104 +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>
<!-- Replace with your own iOS client ID --> <string>com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf</string>
<string>com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf</string> </array>
<!-- </dict>
<string>594687661098-8e26699cris2k3nj5msj1osi59it9kpf.apps.googleusercontent.com</string> --> </array>
</array> <key>LSApplicationQueriesSchemes</key>
</dict> <array>
</array> <string>googlechromes</string>
<key>LSApplicationQueriesSchemes</key> <string>comgooglemaps</string>
<array> </array>
<string>googlechromes</string> <key>CADisableMinimumFrameDurationOnPhone</key>
<string>comgooglemaps</string> <true/>
</array> <key>CFBundleDevelopmentRegion</key>
<key>CADisableMinimumFrameDurationOnPhone</key> <string>$(DEVELOPMENT_LANGUAGE)</string>
<true /> <key>CFBundleDisplayName</key>
<key>CFBundleDevelopmentRegion</key> <string>Sefer</string>
<string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleExecutable</key>
<key>CFBundleDisplayName</key> <string>$(EXECUTABLE_NAME)</string>
<string>Sefer</string> <key>CFBundleGetInfoString</key>
<key>CFBundleExecutable</key> <string></string>
<string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key>
<key>CFBundleGetInfoString</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string></string> <key>CFBundleInfoDictionaryVersion</key>
<key>CFBundleIdentifier</key> <string>6.0</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleName</key>
<key>CFBundleInfoDictionaryVersion</key> <string>Sefer</string>
<string>6.0</string> <key>CFBundlePackageType</key>
<key>CFBundleName</key> <string>APPL</string>
<string>Sefer</string> <key>CFBundleShortVersionString</key>
<key>CFBundlePackageType</key> <string>22</string>
<string>APPL</string> <key>CFBundleSignature</key>
<key>CFBundleShortVersionString</key> <string>????</string>
<string>21</string> <key>CFBundleVersion</key>
<key>CFBundleSignature</key> <string>1.42</string>
<string>????</string> <key>FirebaseAppDelegateProxyEnabled</key>
<key>CFBundleVersion</key> <string>NO</string>
<string>1.41</string> <key>GMSApiKey</key>
<key>FirebaseAppDelegateProxyEnabled</key> <string>YOUR_API_KEY</string>
<string>NO</string> <key>LSApplicationCategoryType</key>
<key>GMSApiKey</key> <string></string>
<string>YOUR_API_KEY</string> <key>LSRequiresIPhoneOS</key>
<key>LSApplicationCategoryType</key> <true/>
<string></string> <key>NSCameraUsageDescription</key>
<key>LSRequiresIPhoneOS</key> <string>Sefer app requires access to your camera in order to scan QR codes and capture
<true />
<key>NSCameraUsageDescription</key>
<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

@@ -1,104 +1,104 @@
import 'dart:io'; // import 'dart:io';
//
import 'package:device_info_plus/device_info_plus.dart'; // import 'package:device_info_plus/device_info_plus.dart';
//
class DeviceInfoPlus { // class DeviceInfoPlus {
static List<Map<String, dynamic>> deviceDataList = []; // static List<Map<String, dynamic>> deviceDataList = [];
//
static Future<List<Map<String, dynamic>>> getDeviceInfo() async { // static Future<List<Map<String, dynamic>>> getDeviceInfo() async {
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); // final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
//
try { // try {
if (Platform.isAndroid) { // if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo; // AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
Map<String, dynamic> deviceData = { // Map<String, dynamic> deviceData = {
'platform': 'Android', // 'platform': 'Android',
'brand': androidInfo.brand, // 'brand': androidInfo.brand,
'model': androidInfo.model, // 'model': androidInfo.model,
'androidId': androidInfo.device, // 'androidId': androidInfo.device,
'versionRelease': androidInfo.version.release, // 'versionRelease': androidInfo.version.release,
'sdkVersion': androidInfo.version.sdkInt, // 'sdkVersion': androidInfo.version.sdkInt,
'manufacturer': androidInfo.manufacturer, // 'manufacturer': androidInfo.manufacturer,
'isPhysicalDevice': androidInfo.isPhysicalDevice, // 'isPhysicalDevice': androidInfo.isPhysicalDevice,
'serialNumber': androidInfo.serialNumber, // 'serialNumber': androidInfo.serialNumber,
'fingerprint': androidInfo.fingerprint, // 'fingerprint': androidInfo.fingerprint,
'type': androidInfo.type, // 'type': androidInfo.type,
'data': androidInfo.data, // 'data': androidInfo.data,
'version': androidInfo.version, // 'version': androidInfo.version,
'tags': androidInfo.tags, // 'tags': androidInfo.tags,
'display': androidInfo.display, // 'display': androidInfo.display,
}; // };
deviceDataList.add(deviceData); // deviceDataList.add(deviceData);
} else if (Platform.isIOS) { // } else if (Platform.isIOS) {
IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo; // IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo;
Map<String, dynamic> deviceData = { // Map<String, dynamic> deviceData = {
'brand': 'Apple', // 'brand': 'Apple',
'model': iosInfo.model, // 'model': iosInfo.model,
'systemName': iosInfo.systemName, // 'systemName': iosInfo.systemName,
'systemVersion': iosInfo.systemVersion, // 'systemVersion': iosInfo.systemVersion,
'utsname': iosInfo.utsname, // 'utsname': iosInfo.utsname,
'isPhysicalDevice': iosInfo.isPhysicalDevice, // 'isPhysicalDevice': iosInfo.isPhysicalDevice,
'identifierForVendor': iosInfo.identifierForVendor, // 'identifierForVendor': iosInfo.identifierForVendor,
'name': iosInfo.name, // 'name': iosInfo.name,
'localizedModel': iosInfo.localizedModel, // 'localizedModel': iosInfo.localizedModel,
}; // };
deviceDataList.add(deviceData); // deviceDataList.add(deviceData);
} else if (Platform.isMacOS) { // } else if (Platform.isMacOS) {
MacOsDeviceInfo macInfo = await deviceInfoPlugin.macOsInfo; // MacOsDeviceInfo macInfo = await deviceInfoPlugin.macOsInfo;
Map<String, dynamic> deviceData = { // Map<String, dynamic> deviceData = {
'platform': 'macOS', // 'platform': 'macOS',
'model': macInfo.model, // 'model': macInfo.model,
'version': macInfo.systemGUID, // 'version': macInfo.systemGUID,
}; // };
deviceDataList.add(deviceData); // deviceDataList.add(deviceData);
} else if (Platform.isWindows) { // } else if (Platform.isWindows) {
WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo; // WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo;
Map<String, dynamic> deviceData = { // Map<String, dynamic> deviceData = {
'platform': 'Windows', // 'platform': 'Windows',
'manufacturer': windowsInfo.computerName, // 'manufacturer': windowsInfo.computerName,
'version': windowsInfo.majorVersion, // 'version': windowsInfo.majorVersion,
'deviceId': windowsInfo.deviceId, // 'deviceId': windowsInfo.deviceId,
'userName': windowsInfo.userName, // 'userName': windowsInfo.userName,
'productName': windowsInfo.productName, // 'productName': windowsInfo.productName,
'installDate': windowsInfo.installDate, // 'installDate': windowsInfo.installDate,
'productId': windowsInfo.productId, // 'productId': windowsInfo.productId,
'numberOfCores': windowsInfo.numberOfCores, // 'numberOfCores': windowsInfo.numberOfCores,
'systemMemoryInMegabytes': windowsInfo.systemMemoryInMegabytes, // 'systemMemoryInMegabytes': windowsInfo.systemMemoryInMegabytes,
}; // };
deviceDataList.add(deviceData); // deviceDataList.add(deviceData);
} else if (Platform.isLinux) { // } else if (Platform.isLinux) {
LinuxDeviceInfo linuxInfo = await deviceInfoPlugin.linuxInfo; // LinuxDeviceInfo linuxInfo = await deviceInfoPlugin.linuxInfo;
Map<String, dynamic> deviceData = { // Map<String, dynamic> deviceData = {
'platform': 'Linux', // 'platform': 'Linux',
'manufacturer': linuxInfo.name, // 'manufacturer': linuxInfo.name,
'version': linuxInfo.version, // 'version': linuxInfo.version,
}; // };
deviceDataList.add(deviceData); // deviceDataList.add(deviceData);
} // }
} catch (e) { // } catch (e) {
print('Failed to get device info: $e'); // print('Failed to get device info: $e');
} // }
//
return deviceDataList; // return deviceDataList;
} // }
//
// Method to print all device data // // Method to print all device data
static void printDeviceInfo() { // static void printDeviceInfo() {
for (Map<String, dynamic> deviceData in deviceDataList) { // for (Map<String, dynamic> deviceData in deviceDataList) {
print('Platform: ${deviceData['platform']}'); // print('Platform: ${deviceData['platform']}');
print('Brand: ${deviceData['brand']}'); // print('Brand: ${deviceData['brand']}');
print('Model: ${deviceData['model']}'); // print('Model: ${deviceData['model']}');
print( // print(
'Version: ${deviceData['version'] ?? deviceData['versionRelease'] ?? 'N/A'}'); // 'Version: ${deviceData['version'] ?? deviceData['versionRelease'] ?? 'N/A'}');
print('Manufacturer: ${deviceData['manufacturer'] ?? 'N/A'}'); // print('Manufacturer: ${deviceData['manufacturer'] ?? 'N/A'}');
print('Is Physical Device: ${deviceData['isPhysicalDevice']}'); // print('Is Physical Device: ${deviceData['isPhysicalDevice']}');
print('Serial Number: ${deviceData['serialNumber'] ?? 'N/A'}'); // print('Serial Number: ${deviceData['serialNumber'] ?? 'N/A'}');
print('Fingerprint: ${deviceData['fingerprint'] ?? 'N/A'}'); // print('Fingerprint: ${deviceData['fingerprint'] ?? 'N/A'}');
print('Type: ${deviceData['type'] ?? 'N/A'}'); // print('Type: ${deviceData['type'] ?? 'N/A'}');
print('Data: ${deviceData['data'] ?? 'N/A'}'); // print('Data: ${deviceData['data'] ?? 'N/A'}');
print('Tags: ${deviceData['tags'] ?? 'N/A'}'); // print('Tags: ${deviceData['tags'] ?? 'N/A'}');
print('Display: ${deviceData['display'] ?? 'N/A'}'); // print('Display: ${deviceData['display'] ?? 'N/A'}');
print('--------------------'); // print('--------------------');
} // }
} // }
} // }

View File

@@ -907,7 +907,8 @@ class MapPassengerController extends GetxController {
rideConfirm = true; rideConfirm = true;
shouldFetch = true; shouldFetch = true;
isBottomSheetShown = false; isBottomSheetShown = false;
timeToPassengerFromDriverAfterApplied = 60; timeToPassengerFromDriverAfterApplied =
durationToPassenger; //60 todo durationToPassenger;/
isDriversTokensSend = false; isDriversTokensSend = false;
update(); update();
@@ -1337,7 +1338,7 @@ class MapPassengerController extends GetxController {
for (var i = 0; i < loopCount; i++) { for (var i = 0; i < loopCount; i++) {
// Wait for 50 seconds. // Wait for 50 seconds.
await Future.delayed(const Duration(seconds: 4)); await Future.delayed(const Duration(seconds: 4));
if (isRideFinished == true) { if (rideTimerBegin == true) {
await getDriverCarsLocationToPassengerAfterApplied(); await getDriverCarsLocationToPassengerAfterApplied();
} }
reloadMarkerDriverCarsLocationToPassengerAfterApplied(); reloadMarkerDriverCarsLocationToPassengerAfterApplied();
@@ -1353,7 +1354,7 @@ class MapPassengerController extends GetxController {
// Wait for 50 seconds. // Wait for 50 seconds.
print('loop is $i from $loopCount'); print('loop is $i from $loopCount');
await Future.delayed(const Duration(seconds: 4)); await Future.delayed(const Duration(seconds: 4));
if (isRideFinished == true) { if (rideTimerBegin == true) {
await getDriverCarsLocationToPassengerAfterApplied(); await getDriverCarsLocationToPassengerAfterApplied();
} }
reloadMarkerDriverCarsLocationToPassengerAfterApplied(); reloadMarkerDriverCarsLocationToPassengerAfterApplied();
@@ -1916,7 +1917,7 @@ class MapPassengerController extends GetxController {
i < dataCarsLocationByPassenger['message'].length; i < dataCarsLocationByPassenger['message'].length;
i++) { i++) {
var carLocation = dataCarsLocationByPassenger['message'][i]; var carLocation = dataCarsLocationByPassenger['message'][i];
durationToPassenger = 100; //////
// Calculate the distance between the passenger's location and the current driver's location // Calculate the distance between the passenger's location and the current driver's location
final distance = Geolocator.distanceBetween( final distance = Geolocator.distanceBetween(
passengerLocation.latitude, passengerLocation.latitude,
@@ -1924,7 +1925,8 @@ class MapPassengerController extends GetxController {
double.parse(carLocation['latitude']), double.parse(carLocation['latitude']),
double.parse(carLocation['longitude']), 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 the UI with the distance and duration
update(); update();
@@ -2599,8 +2601,12 @@ class MapPassengerController extends GetxController {
payload: {'passenger_id': box.read(BoxName.passengerID)}); payload: {'passenger_id': box.read(BoxName.passengerID)});
if (res != 'failure') { if (res != 'failure') {
print(jsonDecode(res)['message']['rating']); print(jsonDecode(res)['message']['rating']);
passengerRate = if (jsonDecode(res)['message']['rating'] == null) {
double.parse(jsonDecode(res)['message']['rating'].toString()); passengerRate = 5;
} else {
passengerRate =
double.parse(jsonDecode(res)['message']['rating'].toString());
}
} }
} }

View File

@@ -15,7 +15,6 @@ import 'constant/credential.dart';
import 'constant/info.dart'; import 'constant/info.dart';
import 'controller/firebase/firbase_messge.dart'; import 'controller/firebase/firbase_messge.dart';
import 'controller/firebase/local_notification.dart'; import 'controller/firebase/local_notification.dart';
import 'controller/functions/device_info.dart';
import 'controller/local/local_controller.dart'; import 'controller/local/local_controller.dart';
import 'controller/local/translations.dart'; import 'controller/local/translations.dart';
import 'controller/payment/paymob/paymob_wallet.dart'; import 'controller/payment/paymob/paymob_wallet.dart';
@@ -52,7 +51,7 @@ void main() async {
print( print(
'local is ${WidgetsBinding.instance.platformDispatcher.locale.countryCode}'); 'local is ${WidgetsBinding.instance.platformDispatcher.locale.countryCode}');
print(Get.deviceLocale!.countryCode); // print(Get.deviceLocale!.countryCode);
Stripe.publishableKey = AK.publishableKey; Stripe.publishableKey = AK.publishableKey;
// if (box.read(BoxName.driverID) != null) {} // if (box.read(BoxName.driverID) != null) {}
if (Platform.isAndroid || Platform.isIOS) { if (Platform.isAndroid || Platform.isIOS) {
@@ -89,11 +88,11 @@ void main() async {
iFrameID: 837992, iFrameID: 837992,
); );
// Get device information // Get device information
List<Map<String, dynamic>> deviceDataList = // List<Map<String, dynamic>> deviceDataList =
await DeviceInfoPlus.getDeviceInfo(); // await DeviceInfoPlus.getDeviceInfo();
//
// Print all device data // // Print all device data
DeviceInfoPlus.printDeviceInfo(); // DeviceInfoPlus.printDeviceInfo();
runApp(const MyApp()); runApp(const MyApp());
} }