initLocation method

Future<void> initLocation(
  1. BuildContext context
)

Implementation

Future<void> initLocation(BuildContext context) async {
  Get.log('📍 LocationService: initLocation');

  // 1️⃣ Instant: store last known if available (FAST)
  final lastKnown = await Geolocator.getLastKnownPosition();
  if (lastKnown != null) {
    await _store(_safe(lastKnown));
    Get.log('⚡ Stored last-known location');
  }

  // 2️⃣ Refresh GPS in background (ACCURATE)
  _refreshFreshLocation(context);
}