chore : seperated ui's
This commit is contained in:
@@ -18,7 +18,7 @@ class InspectionMapLogic extends GetxController with GetTickerProviderStateMixin
|
||||
Resource<List<PoultryLocationModel>>.loading().obs;
|
||||
|
||||
RxList<Marker> markers = <Marker>[].obs;
|
||||
|
||||
RxList<PoultryLocationModel> markers2 = <PoultryLocationModel>[].obs;
|
||||
|
||||
Timer? _debounceTimer;
|
||||
RxBool isLoading = false.obs;
|
||||
@@ -133,46 +133,8 @@ class InspectionMapLogic extends GetxController with GetTickerProviderStateMixin
|
||||
radius * 1000,
|
||||
);
|
||||
|
||||
final visibleBounds = animatedMapController.mapController.camera.visibleBounds;
|
||||
final isZoomedIn = zoom > 17;
|
||||
markers2.addAll(filtered);
|
||||
|
||||
final updatedMarkers = filtered.map((location) {
|
||||
final point = LatLng(location.lat ?? 0, location.long ?? 0);
|
||||
final isVisible = visibleBounds.contains(point);
|
||||
|
||||
return Marker(
|
||||
point: point,
|
||||
width: isZoomedIn && isVisible ? 180.w : 40.h,
|
||||
height: isZoomedIn && isVisible ? 50.h : 50.h,
|
||||
child: isZoomedIn && isVisible
|
||||
? Container(
|
||||
height: 30.h,
|
||||
padding: EdgeInsets.all(5.r),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(15.r),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.1),
|
||||
blurRadius: 5,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
Assets.vec.chickenMapMarkerSvg.svg(width: 24.w, height: 24.h),
|
||||
Text(location.user?.fullname ?? '',style: AppFonts.yekan12,),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Assets.vec.chickenMapMarkerSvg.svg(width: 24.w, height: 24.h),
|
||||
);
|
||||
}).toList();
|
||||
|
||||
markers.value = updatedMarkers;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user