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