Update: 2026-07-10 19:42:49
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ class MapPresentation(outerContext: Context, display: Display) : Presentation(ou
|
|||||||
"asset://packages/intaleq_maps/assets/style_dark.json"
|
"asset://packages/intaleq_maps/assets/style_dark.json"
|
||||||
else
|
else
|
||||||
"asset://packages/intaleq_maps/assets/style.json"
|
"asset://packages/intaleq_maps/assets/style.json"
|
||||||
map.setStyle(Style.Builder().fromUri(currentStyleLoaded)) {
|
map.setStyle(Style.Builder().fromUri(currentStyleLoaded!!)) {
|
||||||
isMapReady = true
|
isMapReady = true
|
||||||
updateCameraPosition()
|
updateCameraPosition()
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 8.1 KiB |
@@ -1,7 +1,6 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
import Flutter
|
import Flutter
|
||||||
import FirebaseCore
|
import FirebaseCore
|
||||||
import CarPlay
|
|
||||||
|
|
||||||
import CoreLocation
|
import CoreLocation
|
||||||
|
|
||||||
@@ -29,7 +28,6 @@ import CoreLocation
|
|||||||
|
|
||||||
// تهيئة قنوات الاتصال مع Flutter
|
// تهيئة قنوات الاتصال مع Flutter
|
||||||
setupMethodChannel()
|
setupMethodChannel()
|
||||||
setupCarNavigationChannel()
|
|
||||||
|
|
||||||
// ضبط مدير الموقع لمتابعة تغييرات الأذونات
|
// ضبط مدير الموقع لمتابعة تغييرات الأذونات
|
||||||
locationManager.delegate = self
|
locationManager.delegate = self
|
||||||
@@ -38,33 +36,7 @@ import CoreLocation
|
|||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - CarPlay Connection (Non-Scene API)
|
|
||||||
|
|
||||||
override func application(
|
|
||||||
_ application: UIApplication,
|
|
||||||
didConnectCarInterfaceController interfaceController: CPInterfaceController,
|
|
||||||
to window: CPWindow
|
|
||||||
) {
|
|
||||||
let sceneDelegate = CarPlaySceneDelegate()
|
|
||||||
sceneDelegate.interfaceController = interfaceController
|
|
||||||
|
|
||||||
let mapTemplate = CPMapTemplate()
|
|
||||||
sceneDelegate.mapTemplate = mapTemplate
|
|
||||||
mapTemplate.guidanceBackgroundStyle = .light
|
|
||||||
|
|
||||||
interfaceController.setRootTemplate(mapTemplate, animated: true)
|
|
||||||
|
|
||||||
CarPlayState.shared.sceneDelegate = sceneDelegate
|
|
||||||
}
|
|
||||||
|
|
||||||
override func application(
|
|
||||||
_ application: UIApplication,
|
|
||||||
didDisconnectCarInterfaceController interfaceController: CPInterfaceController,
|
|
||||||
from window: CPWindow
|
|
||||||
) {
|
|
||||||
CarPlayState.shared.sceneDelegate?.stopNavigation()
|
|
||||||
CarPlayState.shared.sceneDelegate = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - تهيئة القناة بين Swift و Flutter
|
// MARK: - تهيئة القناة بين Swift و Flutter
|
||||||
func setupMethodChannel() {
|
func setupMethodChannel() {
|
||||||
@@ -84,95 +56,6 @@ import CoreLocation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Car Navigation Method Channel
|
|
||||||
|
|
||||||
func setupCarNavigationChannel() {
|
|
||||||
guard let controller = window?.rootViewController as? FlutterViewController else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
let channel = FlutterMethodChannel(
|
|
||||||
name: "com.siro.siro_driver/car_navigation",
|
|
||||||
binaryMessenger: controller.binaryMessenger
|
|
||||||
)
|
|
||||||
channel.setMethodCallHandler { [weak self] call, result in
|
|
||||||
guard let self = self else { return }
|
|
||||||
switch call.method {
|
|
||||||
case "updateNavState":
|
|
||||||
let lat = (call.arguments as? [String: Any])?["lat"] as? Double ?? 0
|
|
||||||
let lng = (call.arguments as? [String: Any])?["lng"] as? Double ?? 0
|
|
||||||
let bearing = (call.arguments as? [String: Any])?["bearing"] as? Double ?? 0
|
|
||||||
let speed = (call.arguments as? [String: Any])?["speed"] as? Double ?? 0
|
|
||||||
let instruction = (call.arguments as? [String: Any])?["instruction"] as? String ?? ""
|
|
||||||
let distanceToStep = (call.arguments as? [String: Any])?["distanceToStep"] as? Double ?? 0
|
|
||||||
let eta = (call.arguments as? [String: Any])?["eta"] as? Double ?? 0
|
|
||||||
let maneuver = (call.arguments as? [String: Any])?["maneuver"] as? Int ?? 0
|
|
||||||
let isNavigating = (call.arguments as? [String: Any])?["isNavigating"] as? Bool ?? false
|
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
|
||||||
guard let delegate = CarPlayState.shared.sceneDelegate else { return }
|
|
||||||
if isNavigating {
|
|
||||||
if delegate.navigationSession == nil {
|
|
||||||
delegate.startNavigation(
|
|
||||||
instruction: instruction,
|
|
||||||
distance: distanceToStep,
|
|
||||||
eta: eta,
|
|
||||||
maneuverType: maneuver
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
delegate.updateManeuver(
|
|
||||||
instruction: instruction,
|
|
||||||
distance: distanceToStep,
|
|
||||||
maneuverType: maneuver
|
|
||||||
)
|
|
||||||
delegate.updateArrivalEstimates(eta: eta)
|
|
||||||
}
|
|
||||||
delegate.updateLocation(lat: lat, lng: lng, bearing: bearing)
|
|
||||||
} else {
|
|
||||||
delegate.stopNavigation()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result(true)
|
|
||||||
|
|
||||||
case "updateLocation":
|
|
||||||
let lat = (call.arguments as? [String: Any])?["lat"] as? Double ?? 0
|
|
||||||
let lng = (call.arguments as? [String: Any])?["lng"] as? Double ?? 0
|
|
||||||
let bearing = (call.arguments as? [String: Any])?["bearing"] as? Double ?? 0
|
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
|
||||||
CarPlayState.shared.sceneDelegate?.updateLocation(
|
|
||||||
lat: lat,
|
|
||||||
lng: lng,
|
|
||||||
bearing: bearing
|
|
||||||
)
|
|
||||||
}
|
|
||||||
result(true)
|
|
||||||
|
|
||||||
case "updateInstruction":
|
|
||||||
let instruction = (call.arguments as? [String: Any])?["instruction"] as? String ?? ""
|
|
||||||
let maneuver = (call.arguments as? [String: Any])?["maneuver"] as? Int ?? 0
|
|
||||||
let distanceToStep = (call.arguments as? [String: Any])?["distanceToStep"] as? Double ?? 0
|
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
|
||||||
CarPlayState.shared.sceneDelegate?.updateManeuver(
|
|
||||||
instruction: instruction,
|
|
||||||
distance: distanceToStep,
|
|
||||||
maneuverType: maneuver
|
|
||||||
)
|
|
||||||
}
|
|
||||||
result(true)
|
|
||||||
|
|
||||||
case "stopNavigation":
|
|
||||||
DispatchQueue.main.async {
|
|
||||||
CarPlayState.shared.sceneDelegate?.stopNavigation()
|
|
||||||
}
|
|
||||||
result(true)
|
|
||||||
|
|
||||||
default:
|
|
||||||
result(FlutterMethodNotImplemented)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - عرض تنبيه عند اكتشاف جهاز مخترق
|
// MARK: - عرض تنبيه عند اكتشاف جهاز مخترق
|
||||||
func showSecurityAlert() {
|
func showSecurityAlert() {
|
||||||
|
|||||||
@@ -4,7 +4,5 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>aps-environment</key>
|
<key>aps-environment</key>
|
||||||
<string>development</string>
|
<string>development</string>
|
||||||
<key>com.apple.developer.carplay-driving-task</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -352,7 +352,8 @@ class AppLink {
|
|||||||
"$paymentServer/ride/driverWallet/get.php";
|
"$paymentServer/ride/driverWallet/get.php";
|
||||||
static String get getDriverPaymentToday =>
|
static String get getDriverPaymentToday =>
|
||||||
"$paymentServer/ride/payment/get.php";
|
"$paymentServer/ride/payment/get.php";
|
||||||
static String get getCountRide => "$rideServer/payment/getCountRide.php";
|
static String get getCountRide =>
|
||||||
|
"$paymentServer/ride/payment/getCountRide.php";
|
||||||
static String get getAllPaymentFromRide =>
|
static String get getAllPaymentFromRide =>
|
||||||
"$paymentServer/ride/payment/getAllPayment.php";
|
"$paymentServer/ride/payment/getAllPayment.php";
|
||||||
static String get getAllPaymentVisa =>
|
static String get getAllPaymentVisa =>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
Timer? activeTimer;
|
Timer? activeTimer;
|
||||||
Map data = {};
|
Map data = {};
|
||||||
bool isHomeMapActive = true;
|
bool isHomeMapActive = true;
|
||||||
InlqBitmap carIcon = InlqBitmap.fromAsset('assets/images/car.png');
|
InlqBitmap carIcon = InlqBitmap.fromAsset('assets/images/car.png', size: 2.3);
|
||||||
bool isMapReadyForCommands = false;
|
bool isMapReadyForCommands = false;
|
||||||
bool isLoading = true;
|
bool isLoading = true;
|
||||||
late double kazan = 0;
|
late double kazan = 0;
|
||||||
@@ -306,7 +306,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addCustomCarIcon() {
|
void addCustomCarIcon() {
|
||||||
carIcon = InlqBitmap.fromAsset('assets/images/car.png');
|
carIcon = InlqBitmap.fromAsset('assets/images/car.png', size: 2.3);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1791,7 +1791,7 @@ class MapDriverController extends GetxController
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addCustomCarIcon() {
|
void addCustomCarIcon() {
|
||||||
carIcon = InlqBitmap.fromAsset('assets/images/car.png');
|
carIcon = InlqBitmap.fromAsset('assets/images/car.png', size: 2.3);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class NavigationService extends GetxService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _loadCustomIcons() {
|
void _loadCustomIcons() {
|
||||||
carIcon = InlqBitmap.fromAsset('assets/images/car.png');
|
carIcon = InlqBitmap.fromAsset('assets/images/car.png', size: 2.3);
|
||||||
passengerIcon = InlqBitmap.fromAsset('assets/images/picker.png');
|
passengerIcon = InlqBitmap.fromAsset('assets/images/picker.png');
|
||||||
startIcon = InlqBitmap.fromAsset('assets/images/A.png');
|
startIcon = InlqBitmap.fromAsset('assets/images/A.png');
|
||||||
endIcon = InlqBitmap.fromAsset('assets/images/b.png');
|
endIcon = InlqBitmap.fromAsset('assets/images/b.png');
|
||||||
|
|||||||
@@ -685,7 +685,7 @@ class NavigationController extends GetxController
|
|||||||
await mapController!.setUserMarker(Marker(
|
await mapController!.setUserMarker(Marker(
|
||||||
markerId: const MarkerId('car'),
|
markerId: const MarkerId('car'),
|
||||||
position: myLocation!,
|
position: myLocation!,
|
||||||
icon: InlqBitmap.fromStyleImage('car_icon'),
|
icon: InlqBitmap.fromStyleImage('car_icon', size: 2.3),
|
||||||
anchor: const Offset(0.5, 0.5),
|
anchor: const Offset(0.5, 0.5),
|
||||||
flat: true,
|
flat: true,
|
||||||
rotation: _smoothedHeading,
|
rotation: _smoothedHeading,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: siro_driver
|
|||||||
description: "A new Flutter project."
|
description: "A new Flutter project."
|
||||||
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
version: 1.0.0+3
|
version: 1.0.0+4
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.0.5 <4.0.0"
|
sdk: ">=3.0.5 <4.0.0"
|
||||||
|
|||||||
+2
-1
@@ -10,6 +10,7 @@ import android.graphics.BitmapFactory
|
|||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import io.flutter.plugin.common.MethodChannel
|
import io.flutter.plugin.common.MethodChannel
|
||||||
|
import io.flutter.plugin.common.MethodCall
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Android 16 Progress Style Live Update Plugin
|
* Android 16 Progress Style Live Update Plugin
|
||||||
@@ -270,7 +271,7 @@ class AndroidLiveUpdatePlugin(private val context: Context) {
|
|||||||
/**
|
/**
|
||||||
* معالجة استدعاءات MethodChannel
|
* معالجة استدعاءات MethodChannel
|
||||||
*/
|
*/
|
||||||
fun handleMethodCall(call: MethodChannel.MethodCall, result: MethodChannel.Result) {
|
fun handleMethodCall(call: MethodCall, result: MethodChannel.Result) {
|
||||||
when (call.method) {
|
when (call.method) {
|
||||||
"startLiveUpdate" -> {
|
"startLiveUpdate" -> {
|
||||||
val rideId = call.argument<String>("rideId") ?: ""
|
val rideId = call.argument<String>("rideId") ?: ""
|
||||||
|
|||||||
@@ -1296,10 +1296,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
|
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.19"
|
version: "0.12.18"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1312,10 +1312,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
|
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.18.0"
|
version: "1.17.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -1884,10 +1884,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
|
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.11"
|
version: "0.7.9"
|
||||||
timezone:
|
timezone:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
Reference in New Issue
Block a user