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.
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']
}

View File

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

View File

@@ -1,104 +1,104 @@
import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
class DeviceInfoPlus {
static List<Map<String, dynamic>> deviceDataList = [];
static Future<List<Map<String, dynamic>>> getDeviceInfo() async {
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
try {
if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> deviceData = {
'platform': 'macOS',
'model': macInfo.model,
'version': macInfo.systemGUID,
};
deviceDataList.add(deviceData);
} else if (Platform.isWindows) {
WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo;
Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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<Map<String, dynamic>> deviceDataList = [];
//
// static Future<List<Map<String, dynamic>>> getDeviceInfo() async {
// final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
//
// try {
// if (Platform.isAndroid) {
// AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
// Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> deviceData = {
// 'platform': 'macOS',
// 'model': macInfo.model,
// 'version': macInfo.systemGUID,
// };
// deviceDataList.add(deviceData);
// } else if (Platform.isWindows) {
// WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo;
// Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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('--------------------');
// }
// }
// }

View File

@@ -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());
}
}
}

View File

@@ -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<Map<String, dynamic>> deviceDataList =
await DeviceInfoPlus.getDeviceInfo();
// Print all device data
DeviceInfoPlus.printDeviceInfo();
// List<Map<String, dynamic>> deviceDataList =
// await DeviceInfoPlus.getDeviceInfo();
//
// // Print all device data
// DeviceInfoPlus.printDeviceInfo();
runApp(const MyApp());
}