GestureDetector( onTap: () async { bool isServiceEnabled = await Geolocator.isLocationServiceEnabled(); if (isServiceEnabled) { final GoogleMapController controller = await model.controller.future; controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition( target: model.userLocation == null ? LatLng(34.0059934, 71.5057068) : LatLng(model.userLocation!.latitude, model.userLocation!.longitude), zoom: 14, ))); } else { Get.dialog(LocationDialog( onPressed: () async { await Geolocator.openLocationSettings(); Get.back(); await model.getCurrentLocationUpdates(); setState(() async { final GoogleMapController controller = await model.controller.future; controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition( target: model.userLocation == null ? LatLng(34.0059934, 71.5057068) : LatLng(model.userLocation!.latitude, model.userLocation!.longitude), zoom: 14, ))); }); }, )); } }, child: const CircleAvatar( backgroundColor: commonColor_4, child: Icon( Icons.location_on, color: Colors.white, )), ),