4/21/6
This commit is contained in:
@@ -51,7 +51,7 @@ class LoginCaptinController extends GetxController {
|
||||
if (jsonDecoeded.isNotEmpty) {
|
||||
if (jsonDecoeded['status'] == 'success') {
|
||||
print(jsonDecoeded['data'][0]['verified']);
|
||||
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
||||
if (jsonDecoeded['data'][0]['verified'] == '1') {
|
||||
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
||||
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
||||
box.write(
|
||||
|
||||
@@ -48,20 +48,20 @@ class LoginController extends GetxController {
|
||||
if (formKeyAdmin.currentState!.validate()) {
|
||||
await DeviceInfoPlus.getDeviceInfo();
|
||||
if (Platform.isAndroid) {
|
||||
print(DeviceInfoPlus.deviceData['serialNumber']);
|
||||
var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
|
||||
'device_number': DeviceInfoPlus.deviceData['serialNumber'].toString(),
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
// print(d);
|
||||
// if (DeviceInfoPlus.deviceData['serialNumber'] ==
|
||||
// print(DeviceInfoPlus.deviceDataList['serialNumber']);
|
||||
// var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
|
||||
// // 'device_number': DeviceInfoPlus.deviceData['serialNumber'].toString(),
|
||||
// });
|
||||
// var d = jsonDecode(res);
|
||||
// // print(d);
|
||||
// // if (DeviceInfoPlus.deviceData['serialNumber'] ==
|
||||
// d['message']['device_number']) {
|
||||
Get.back();
|
||||
Get.to(() => const AdminHomePage());
|
||||
// }
|
||||
}
|
||||
if (Platform.isIOS) {
|
||||
print(DeviceInfoPlus.deviceData['identifierForVendor']);
|
||||
// print(DeviceInfoPlus.deviceData['identifierForVendor']);
|
||||
// var res = await CRUD().get(link: AppLink.getAdminUser, payload: {
|
||||
// 'device_number': DeviceInfoPlus.deviceData['identifierForVendor'].toString(),
|
||||
// });
|
||||
|
||||
@@ -24,9 +24,9 @@ class CRUD {
|
||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
|
||||
},
|
||||
);
|
||||
// print("-----request----" + response.request.toString());
|
||||
print("-----request----" + response.request.toString());
|
||||
// print("-----headers-----" + response.headers.toString());
|
||||
// print("-----payload-----" + payload.toString());
|
||||
print("-----payload-----" + payload.toString());
|
||||
// if (response.statusCode == 200) {
|
||||
// print(response.body);
|
||||
var jsonData = jsonDecode(response.body);
|
||||
@@ -170,11 +170,11 @@ class CRUD {
|
||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||
},
|
||||
);
|
||||
// print(response.request);
|
||||
// print(payload);
|
||||
print(response.request);
|
||||
print(payload);
|
||||
|
||||
var jsonData = jsonDecode(response.body);
|
||||
// print(jsonData);
|
||||
print(jsonData);
|
||||
if (response.statusCode == 200) {
|
||||
if (jsonData['status'] == 'success') {
|
||||
return response.body;
|
||||
|
||||
@@ -3,67 +3,102 @@ import 'dart:io';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
|
||||
class DeviceInfoPlus {
|
||||
static Map<String, dynamic> deviceData = {};
|
||||
static Future<Map<String, dynamic>> getDeviceInfo() async {
|
||||
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;
|
||||
deviceData['platform'] = 'Android';
|
||||
deviceData['brand'] = androidInfo.brand;
|
||||
deviceData['model'] = androidInfo.model;
|
||||
deviceData['androidId'] = androidInfo.device;
|
||||
deviceData['version'] = androidInfo.version.release;
|
||||
deviceData['sdkVersion'] = androidInfo.version.sdkInt;
|
||||
deviceData['manufacturer'] = androidInfo.manufacturer;
|
||||
deviceData['isPhysicalDevice'] = androidInfo.isPhysicalDevice;
|
||||
deviceData['serialNumber'] = androidInfo.serialNumber;
|
||||
deviceData['fingerprint'] = androidInfo.fingerprint;
|
||||
deviceData['type'] = androidInfo.type;
|
||||
deviceData['data'] = androidInfo.data;
|
||||
deviceData['version'] = androidInfo.version;
|
||||
deviceData['tags'] = androidInfo.tags;
|
||||
deviceData['display'] = androidInfo.display;
|
||||
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;
|
||||
deviceData['brand'] = 'Apple';
|
||||
deviceData['model'] = iosInfo.model;
|
||||
deviceData['systemName'] = iosInfo.systemName;
|
||||
deviceData['systemVersion'] = iosInfo.systemVersion;
|
||||
deviceData['utsname'] = iosInfo.utsname;
|
||||
deviceData['isPhysicalDevice'] = iosInfo.isPhysicalDevice;
|
||||
deviceData['identifierForVendor'] = iosInfo.identifierForVendor;
|
||||
deviceData['name'] = iosInfo.name;
|
||||
deviceData['localizedModel'] = iosInfo.localizedModel;
|
||||
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;
|
||||
deviceData['platform'] = 'macOS';
|
||||
deviceData['model'] = macInfo.model;
|
||||
deviceData['version'] = macInfo.systemGUID;
|
||||
Map<String, dynamic> deviceData = {
|
||||
'platform': 'macOS',
|
||||
'model': macInfo.model,
|
||||
'version': macInfo.systemGUID,
|
||||
};
|
||||
deviceDataList.add(deviceData);
|
||||
} else if (Platform.isWindows) {
|
||||
WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo;
|
||||
deviceData['platform'] = 'Windows';
|
||||
deviceData['manufacturer'] = windowsInfo.computerName;
|
||||
deviceData['version'] = windowsInfo.majorVersion;
|
||||
deviceData['deviceId'] = windowsInfo.deviceId;
|
||||
deviceData['userName'] = windowsInfo.userName;
|
||||
deviceData['productName'] = windowsInfo.productName;
|
||||
deviceData['installDate'] = windowsInfo.installDate;
|
||||
deviceData['productId'] = windowsInfo.productId;
|
||||
deviceData['numberOfCores'] = windowsInfo.numberOfCores;
|
||||
deviceData['systemMemoryInMegabytes'] =
|
||||
windowsInfo.systemMemoryInMegabytes;
|
||||
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;
|
||||
deviceData['platform'] = 'Linux';
|
||||
deviceData['manufacturer'] = linuxInfo.name;
|
||||
deviceData['version'] = linuxInfo.version;
|
||||
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 deviceData;
|
||||
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('--------------------');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ class LocationController extends GetxController {
|
||||
// print('Latitude: ${_locationData.latitude}');
|
||||
// print('Longitude: ${_locationData.longitude}');
|
||||
// print('Time: ${_locationData.time}');
|
||||
// print('speed: ${_locationData.speed}');
|
||||
print('speed: ${_locationData.speed}');
|
||||
// print('Heading: ${_locationData.heading}');
|
||||
// isLoading = false;
|
||||
update();
|
||||
|
||||
@@ -2507,9 +2507,7 @@ class MapPassengerController extends GetxController {
|
||||
link: AppLink.getPassengerRate,
|
||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||
if (res != 'failure') {
|
||||
passengerRate = jsonDecode(res)['message']['rating'] == null
|
||||
? 5
|
||||
: jsonDecode(res)['message']['rating'].toDouble();
|
||||
passengerRate = double.parse(jsonDecode(res)['message']['rating']) ?? 5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user