fix marker rendering & modernize riding widgets for dark mode - 2026-04-11

This commit is contained in:
Hamza-Ayed
2026-04-11 01:14:09 +03:00
parent 3f03f25142
commit 454276d1e0
88 changed files with 50376 additions and 23310 deletions

View File

@@ -1,8 +1,10 @@
import 'package:Intaleq/print.dart';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:maplibre_gl/maplibre_gl.dart';
import 'package:Intaleq/controller/home/points_for_rider_controller.dart';
import 'package:Intaleq/services/offline_map_service.dart';
import '../../../constant/colors.dart';
import '../../../constant/style.dart';
@@ -30,7 +32,7 @@ class GoogleMapPassengerWidget extends StatelessWidget {
attributionButtonMargins: null,
onMapCreated: controller.onMapCreated,
onStyleLoadedCallback: () => controller.onStyleLoaded(),
styleString: "assets/style.json",
styleString: Get.isDarkMode ? "assets/style_dark.json" : "assets/style.json",
// ✅ Performance: Smoother zoom limits for low-end devices
minMaxZoomPreference: controller.lowPerf
@@ -51,10 +53,14 @@ class GoogleMapPassengerWidget extends StatelessWidget {
if (controller.mapController != null) {
final position = controller.mapController!.cameraPosition;
if (position != null) {
print('✅ onCameraIdle targeted: ${position.target}');
Log.print('✅ onCameraIdle targeted: ${position.target}');
// 1. Always update current view target (for pickers)
controller
.updateCurrentLocationFromCamera(position.target);
// 2. Cache explicitly when panning around
// Optional: Limit this to only cache smaller regions (1km) so it doesn't overload on fast panning
OfflineMapService.instance.downloadRegion(position.target, radiusKm: 1.0);
}
}
},
@@ -80,9 +86,9 @@ class GoogleMapPassengerWidget extends StatelessWidget {
colorText: AppColor.redColor,
duration: const Duration(seconds: 5),
backgroundColor: AppColor.secondaryColor,
icon: const Icon(Icons.error, color: AppColor.redColor),
icon: Icon(Icons.error, color: AppColor.redColor),
titleText: Text('Error'.tr,
style: const TextStyle(color: AppColor.redColor)),
style: TextStyle(color: AppColor.redColor)),
messageText: Text(
'We Are Sorry That we dont have cars in your Location!'
.tr,
@@ -99,4 +105,4 @@ class GoogleMapPassengerWidget extends StatelessWidget {
),
);
}
}
}