9/8/2
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 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 34
|
targetSdkVersion 34
|
||||||
versionCode 61
|
versionCode 62
|
||||||
versionName '1.5.61'
|
versionName '1.5.62'
|
||||||
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,11 +37,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>49</string>
|
<string>50</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>4.3.49</string>
|
<string>4.3.50</string>
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
<string>NO</string>
|
<string>NO</string>
|
||||||
<key>GMSApiKey</key>
|
<key>GMSApiKey</key>
|
||||||
|
|||||||
@@ -203,12 +203,6 @@ class LoginController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
goToMapPage() {
|
|
||||||
if (box.read(BoxName.email) != null) {
|
|
||||||
Get.offAll(() => const MapPagePassenger());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final location = Location();
|
final location = Location();
|
||||||
|
|
||||||
// late PermissionStatus permissionGranted = PermissionStatus.denied;
|
// late PermissionStatus permissionGranted = PermissionStatus.denied;
|
||||||
@@ -246,10 +240,10 @@ class LoginController extends GetxController {
|
|||||||
void onInit() async {
|
void onInit() async {
|
||||||
// permissionLocation = await Permission.locationWhenInUse.isGranted;
|
// permissionLocation = await Permission.locationWhenInUse.isGranted;
|
||||||
await getAppTester(AppInformation.appName);
|
await getAppTester(AppInformation.appName);
|
||||||
if (isTest == 0 && box.read(BoxName.passengerID) != null) {
|
// if (isTest == 0 && box.read(BoxName.passengerID) != null) {
|
||||||
await loginUsingCredentials(
|
// // await loginUsingCredentials(
|
||||||
box.read(BoxName.passengerID), box.read(BoxName.email));
|
// // box.read(BoxName.passengerID), box.read(BoxName.email));
|
||||||
}
|
// }
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2603,58 +2603,44 @@ class MapPassengerController extends GetxController {
|
|||||||
Future<void> getLocation() async {
|
Future<void> getLocation() async {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
update();
|
update();
|
||||||
|
bool serviceEnabled;
|
||||||
try {
|
PermissionStatus permissionGranted;
|
||||||
// Perform permission and service checks in parallel
|
// dialoge();
|
||||||
final results = await Future.wait([
|
// Check if location services are enabled
|
||||||
location.serviceEnabled(),
|
serviceEnabled = await location.serviceEnabled();
|
||||||
location.hasPermission(),
|
if (!serviceEnabled) {
|
||||||
]);
|
serviceEnabled = await location.requestService();
|
||||||
|
|
||||||
bool serviceEnabled = results[0] as bool; // Cast to bool
|
|
||||||
PermissionStatus permissionGranted =
|
|
||||||
results[1] as PermissionStatus; // Cast to PermissionStatus
|
|
||||||
|
|
||||||
// Check if location services are enabled
|
|
||||||
if (!serviceEnabled) {
|
if (!serviceEnabled) {
|
||||||
serviceEnabled = await location.requestService();
|
// Location services are still not enabled, handle the error
|
||||||
if (!serviceEnabled) {
|
return;
|
||||||
// Location services are still not enabled, handle the error
|
|
||||||
isLoading = false;
|
|
||||||
update();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the app has permission to access location
|
|
||||||
if (permissionGranted == PermissionStatus.denied) {
|
|
||||||
permissionGranted = await location.requestPermission();
|
|
||||||
if (permissionGranted != PermissionStatus.granted) {
|
|
||||||
// Location permission is still not granted, handle the error
|
|
||||||
isLoading = false;
|
|
||||||
update();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Request updated location with medium accuracy (faster)
|
|
||||||
LocationData _locationData = await location.getLocation();
|
|
||||||
passengerLocation =
|
|
||||||
LatLng(_locationData.latitude!, _locationData.longitude!);
|
|
||||||
|
|
||||||
// Process location data
|
|
||||||
getLocationArea(passengerLocation.latitude, passengerLocation.longitude);
|
|
||||||
newStartPointLocation = passengerLocation;
|
|
||||||
speed = _locationData.speed!;
|
|
||||||
|
|
||||||
// Update loading state
|
|
||||||
isLoading = false;
|
|
||||||
update();
|
|
||||||
} catch (e) {
|
|
||||||
// Handle exceptions (optional logging)
|
|
||||||
isLoading = false;
|
|
||||||
update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the app has permission to access location
|
||||||
|
permissionGranted = await location.hasPermission();
|
||||||
|
if (permissionGranted == PermissionStatus.denied) {
|
||||||
|
permissionGranted = await location.requestPermission();
|
||||||
|
if (permissionGranted != PermissionStatus.granted) {
|
||||||
|
// Location permission is still not granted, handle the error
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configure location accuracy
|
||||||
|
// LocationAccuracy desiredAccuracy = LocationAccuracy.high;
|
||||||
|
|
||||||
|
// Get the current location
|
||||||
|
LocationData _locationData = await location.getLocation();
|
||||||
|
passengerLocation =
|
||||||
|
(_locationData.latitude != null && _locationData.longitude != null
|
||||||
|
? LatLng(_locationData.latitude!, _locationData.longitude!)
|
||||||
|
: null)!;
|
||||||
|
getLocationArea(passengerLocation.latitude, passengerLocation.longitude);
|
||||||
|
newStartPointLocation = passengerLocation;
|
||||||
|
speed = _locationData.speed!;
|
||||||
|
// //print location details
|
||||||
|
isLoading = false;
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
LatLngBounds calculateBounds(
|
LatLngBounds calculateBounds(
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
|
import 'package:SEFER/constant/api_key.dart';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/auth/sms_verfy_page.dart';
|
import 'package:SEFER/views/auth/sms_verfy_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
import '../../../constant/char_map.dart';
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../constant/credential.dart';
|
||||||
|
import '../../../constant/links.dart';
|
||||||
import '../../../controller/firebase/firbase_messge.dart';
|
import '../../../controller/firebase/firbase_messge.dart';
|
||||||
import '../../../controller/functions/audio_record1.dart';
|
import '../../../controller/functions/audio_record1.dart';
|
||||||
|
import '../../../controller/functions/crud.dart';
|
||||||
import '../../../controller/functions/tts.dart';
|
import '../../../controller/functions/tts.dart';
|
||||||
import '../../../controller/home/map_passenger_controller.dart';
|
import '../../../controller/home/map_passenger_controller.dart';
|
||||||
|
|
||||||
@@ -138,16 +143,17 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
// borderRadius: BorderRadius.circular(15)),
|
// borderRadius: BorderRadius.circular(15)),
|
||||||
// child: IconButton(
|
// child: IconButton(
|
||||||
// onPressed: () async {
|
// onPressed: () async {
|
||||||
// await CRUD().allMethodForAI(
|
// await CRUD().allMethodForAI(
|
||||||
// 'name,fullName,address,idNumber,cardId,dob',
|
// 'name,fullName,address,idNumber,cardId,dob',
|
||||||
// AppLink.uploadEgypt,
|
// AppLink.uploadEgypt,
|
||||||
// 'idFront');
|
// 'idFront');
|
||||||
//
|
|
||||||
// // await ImageController().choosImage(
|
// await ImageController().choosImage(
|
||||||
// // 'https://api.sefer.live/sefer/uploadEgypt.php',
|
// 'https://api.sefer.live/sefer/uploadEgypt.php',
|
||||||
// // 'FrontId');
|
// 'FrontId');
|
||||||
// AC credentials = AC();
|
// AC credentials = AC();
|
||||||
// String apiKey = 'zjujl_qvo_fwjfgjlXrXlBl';
|
// String apiKey =
|
||||||
|
// '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';
|
||||||
// String convertedStringN = credentials.c(
|
// String convertedStringN = credentials.c(
|
||||||
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
// credentials.c(credentials.c(apiKey, cs), cC), cn);
|
||||||
|
|
||||||
@@ -160,11 +166,10 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
// print('retrievedStringS ---$retrievedStringS');
|
// print('retrievedStringS ---$retrievedStringS');
|
||||||
// print('same');
|
// print('same');
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// // await Get.find<PaymentController>()
|
// await Get.find<PaymentController>()
|
||||||
// // .payWithPayMob(context, '1100', 'EGP');
|
// .payWithPayMob(context, '1100', 'EGP');
|
||||||
// // Initiates a payment with a card using the FlutterPaymob instance
|
// Initiates a payment with a card using the FlutterPaymob instance
|
||||||
//
|
|
||||||
// },
|
// },
|
||||||
// icon: const Icon(
|
// icon: const Icon(
|
||||||
// // Get.put(AudioRecorderController()).isRecording
|
// // Get.put(AudioRecorderController()).isRecording
|
||||||
|
|||||||
Reference in New Issue
Block a user