5/29/1
This commit is contained in:
@@ -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']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,7 @@
|
|||||||
<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>
|
||||||
<!--
|
|
||||||
<string>594687661098-8e26699cris2k3nj5msj1osi59it9kpf.apps.googleusercontent.com</string> -->
|
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
@@ -40,11 +37,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>21</string>
|
<string>22</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.41</string>
|
<string>1.42</string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
<string>NO</string>
|
<string>NO</string>
|
||||||
<key>GMSApiKey</key>
|
<key>GMSApiKey</key>
|
||||||
|
|||||||
@@ -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('--------------------');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -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,10 +2601,14 @@ 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']);
|
||||||
|
if (jsonDecode(res)['message']['rating'] == null) {
|
||||||
|
passengerRate = 5;
|
||||||
|
} else {
|
||||||
passengerRate =
|
passengerRate =
|
||||||
double.parse(jsonDecode(res)['message']['rating'].toString());
|
double.parse(jsonDecode(res)['message']['rating'].toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() async {
|
void onInit() async {
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user