From b83ca1f6640ee69699ea59622e0dd6be3bd175d7 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Wed, 22 Jul 2026 23:20:33 +0300 Subject: [PATCH] Update: 2026-07-22 23:20:32 --- .../home/map/nearby_drivers_controller.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/siro_rider/lib/controller/home/map/nearby_drivers_controller.dart b/siro_rider/lib/controller/home/map/nearby_drivers_controller.dart index a4562fdc..f75628f0 100644 --- a/siro_rider/lib/controller/home/map/nearby_drivers_controller.dart +++ b/siro_rider/lib/controller/home/map/nearby_drivers_controller.dart @@ -28,8 +28,22 @@ class NearbyDriversController extends GetxController { bool noCarString = false; final double minMovementThreshold = 2.0; final Map _animationTimers = {}; - final List> fakeCarData = []; + Timer? _autoRefreshTimer; + + @override + void onInit() { + super.onInit(); + detectPerfMode(); + _startPeriodicRefresh(); + } + + void _startPeriodicRefresh() { + _autoRefreshTimer?.cancel(); + _autoRefreshTimer = Timer.periodic(const Duration(seconds: 5), (_) { + getCarsLocationByPassengerAndReloadMarker(); + }); + } Future getCarsLocationByPassengerAndReloadMarker() async { carsLocationByPassenger = []; @@ -467,6 +481,7 @@ class NearbyDriversController extends GetxController { @override void onClose() { + _autoRefreshTimer?.cancel(); _animationTimers.forEach((key, timer) => timer.cancel()); _animationTimers.clear(); super.onClose();