fix : onTap marker

This commit is contained in:
2025-04-15 13:33:26 +03:30
parent 1a31d4cdbf
commit a754ac6873
9 changed files with 123 additions and 52 deletions

View File

@@ -4,6 +4,7 @@ import 'package:latlong2/latlong.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/data/utils.dart';
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
import 'package:supervision/presentation/routes/app_routes.dart';
import 'logic.dart';
@@ -83,29 +84,26 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
},
),
),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: ObxValue((data) {
return DraggableBottomSheet(
controller: data.value,
backgroundColor: controller.bottomSheetStep.value == BottomSheetStep.filter ? Colors.white : AppColor.lightGreyLight ,
child: ObxValue((data) {
if (data.value == BottomSheetStep.filter) {
return filterWidget();
} else if (data.value == BottomSheetStep.markerSelected) {
return selectedLocationWidget();
} else if (data.value == BottomSheetStep.markerDetails) {
return markerDetailsWidget();
} else {
return Container(height: 300, color: AppColor.blueNormal);
}
}, controller.bottomSheetStep),
);
}, controller.sheetController),
),
ObxValue((data) {
return DraggableBottomSheet(
controller: data.value,
backgroundColor:
controller.bottomSheetStep.value == BottomSheetStep.filter
? Colors.white
: AppColor.lightGreyLight,
child: ObxValue((data) {
if (data.value == BottomSheetStep.filter) {
return filterWidget();
} else if (data.value == BottomSheetStep.markerSelected) {
return selectedLocationWidget();
} else if (data.value == BottomSheetStep.markerDetails) {
return markerDetailsWidget();
} else {
return Container(height: 300, color: AppColor.blueNormal);
}
}, controller.bottomSheetStep),
);
}, controller.sheetController),
],
);
}
@@ -113,14 +111,20 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
Marker markerWidget(LatLng marker) {
return Marker(
point: marker,
child: IconButton(
onPressed: () {
child: GestureDetector(
onTap: () {
controller.bottomSheetStep.value = BottomSheetStep.markerSelected;
if (!controller.sheetController.value.isVisible.value) {
controller.sheetController.value.show();
}
},
icon: Icon(Icons.location_on, color: Colors.red, size: 30),
behavior: HitTestBehavior.opaque,
child: SizedBox(
width: 36,
height: 36,
child: Icon(Icons.location_on, color: Colors.red, size: 30),
),
),
);
}
@@ -134,7 +138,9 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
motion: StretchMotion(),
children: [
CustomSlidableAction(
onPressed: (context) {},
onPressed: (context) {
Get.toNamed(SupervisionRoutes.supervisionLocationDetails);
},
backgroundColor: AppColor.blueNormal,
foregroundColor: Colors.white,
padding: EdgeInsets.all(16),
@@ -405,7 +411,7 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
return Container(
clipBehavior: Clip.antiAlias,
margin: EdgeInsets.all(35),
padding: EdgeInsets.symmetric(horizontal: 20,vertical: 10),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
decoration: ShapeDecoration(
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
@@ -414,7 +420,8 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
spacing: 15,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
spacing: 12,
children: [
Text(
'داود خرم پور',
@@ -423,6 +430,32 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
color: AppColor.darkGreyDarkHover,
),
),
Spacer(),
vecWidgetWithOnTap(
assets: Assets.vecMapSvg,
onTap: () {
eLog('vecWidgetWithOnTap ==> Assets.vecMapSvg');
Get.toNamed(SupervisionRoutes.supervisionLocationDetails);
},
width: 24,
height: 24,
color: AppColor.blueNormal,
),
vecWidgetWithOnTap(
assets: Assets.vecMessageAddSvg,
width: 24,
height: 24,
color: AppColor.greenNormal,
onTap: () {},
),
vecWidgetWithOnTap(
assets: Assets.vecSecurityTimeSvg,
color: AppColor.warning,
height: 24,
width: 24,
onTap: () {},
),
],
),
Container(

View File

@@ -1,5 +1,7 @@
import 'package:rasadyar_core/core.dart';
import 'package:supervision/presentation/filter/logic.dart';
import 'package:supervision/presentation/location_details/logic.dart';
import 'package:supervision/presentation/location_details/view.dart';
import 'package:supervision/presentation/root/logic.dart';
import 'package:supervision/presentation/root/view.dart';
import 'package:supervision/presentation/routes/app_routes.dart';
@@ -16,5 +18,19 @@ sealed class SupervisionPages {
BindingsBuilder.put(() => SupervisionFilterLogic()),
],
),
GetPage(
name: SupervisionRoutes.supervision,
page: () => RootPage(),
bindings: [
BindingsBuilder.put(() => RootLogic()),
BindingsBuilder.put(() => SupervisionFilterLogic()),
],
),
GetPage(
name: SupervisionRoutes.supervisionLocationDetails,
page: () => LocationDetailsPage(),
bindings: [BindingsBuilder.put(() => LocationDetailsLogic())],
),
];
}

View File

@@ -4,4 +4,5 @@ sealed class SupervisionRoutes {
static const supervision = '/supervision';
static const supervisionAction = '/supervision/action';
static const supervisionUserSetting = '/supervision/userSettings';
static const supervisionLocationDetails= '/supervision/locationDetails';
}