From 1a31d4cdbfbf2e54c3f3b56611f0a4dcec9c3b1a Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Mon, 14 Apr 2025 17:31:17 +0330 Subject: [PATCH] feat : bottom sheet markerDetails --- .../lib/presentation/filter/logic.dart | 10 +- .../lib/presentation/filter/view.dart | 250 ++++++++++++++---- .../draggable_bottom_sheet.dart | 6 +- 3 files changed, 215 insertions(+), 51 deletions(-) diff --git a/features/supervision/lib/presentation/filter/logic.dart b/features/supervision/lib/presentation/filter/logic.dart index 3b2ca9f..61626f7 100644 --- a/features/supervision/lib/presentation/filter/logic.dart +++ b/features/supervision/lib/presentation/filter/logic.dart @@ -126,11 +126,19 @@ class SupervisionFilterLogic extends GetxController sheetController.value = DraggableBottomSheetController( initialVisibility: true, - initialHeight: 300, + initialHeight: 250, minHeight: 50, maxHeight: 300, ); + }else if(data == BottomSheetStep.markerDetails){ + sheetController.value = + DraggableBottomSheetController( + initialVisibility: true, + initialHeight: 500, + minHeight: 50, + maxHeight: 700, + ); } sheetController.refresh(); sheetController.value.toggle(); diff --git a/features/supervision/lib/presentation/filter/view.dart b/features/supervision/lib/presentation/filter/view.dart index 27587bb..c349694 100644 --- a/features/supervision/lib/presentation/filter/view.dart +++ b/features/supervision/lib/presentation/filter/view.dart @@ -88,19 +88,19 @@ class SupervisionFilterPage extends GetView { left: 0, right: 0, child: ObxValue((data) { - fLog(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 const SizedBox( - height: 150, - child: Center(child: Text('Marker Selected')), - ); + return Container(height: 300, color: AppColor.blueNormal); } }, controller.bottomSheetStep), ); @@ -130,7 +130,6 @@ class SupervisionFilterPage extends GetView { padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20), child: Slidable( key: Key('item'), - endActionPane: ActionPane( motion: StretchMotion(), children: [ @@ -163,52 +162,59 @@ class SupervisionFilterPage extends GetView { ), ], ), - child: Container( - height: 58, - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), - - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - border: Border.all(width: 1, color: AppColor.blackLightHover), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - Text( - 'داود خرم مهری پور', - style: AppFonts.yekan10.copyWith( - color: AppColor.blueNormal, + child: GestureDetector( + onTap: () { + controller.bottomSheetStep.value = BottomSheetStep.markerDetails; + if (!controller.sheetController.value.isVisible.value) { + controller.sheetController.value.show(); + } + }, + child: Container( + height: 58, + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.blackLightHover), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + Text( + 'داود خرم مهری پور', + style: AppFonts.yekan10.copyWith( + color: AppColor.blueNormal, + ), ), - ), - Text( - 'گوشت و مرغ', - style: AppFonts.yekan12.copyWith( - color: AppColor.darkGreyDarkHover, + Text( + 'گوشت و مرغ', + style: AppFonts.yekan12.copyWith( + color: AppColor.darkGreyDarkHover, + ), ), - ), - ], - ), - Column( - children: [ - Text( - 'باقی مانده', - style: AppFonts.yekan10.copyWith( - color: AppColor.blueNormal, + ], + ), + Column( + children: [ + Text( + 'باقی مانده', + style: AppFonts.yekan10.copyWith( + color: AppColor.blueNormal, + ), ), - ), - Text( - '0 کیلوگرم', - style: AppFonts.yekan12.copyWith( - color: AppColor.darkGreyDarkHover, + Text( + '0 کیلوگرم', + style: AppFonts.yekan12.copyWith( + color: AppColor.darkGreyDarkHover, + ), ), - ), - ], - ), - vecWidget(Assets.vecScanBarcodeSvg), - ], + ], + ), + vecWidget(Assets.vecScanBarcodeSvg), + ], + ), ), ), ), @@ -394,6 +400,154 @@ class SupervisionFilterPage extends GetView { ), ); } + + Widget markerDetailsWidget() { + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.all(35), + padding: EdgeInsets.symmetric(horizontal: 20,vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'داود خرم پور', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Container( + height: 32, + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'باقی مانده', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0 کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + + ...List.generate( + 5, + (index) => Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'فروش رفته', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0 کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ), + ], + ), + ); + } } Widget customChip({ diff --git a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet.dart index 39517bf..90e8b3d 100644 --- a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet.dart +++ b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet.dart @@ -11,11 +11,13 @@ class DraggableBottomSheet extends StatelessWidget { final double minHeight; final double maxHeight; final Widget? child; + final Color? backgroundColor; const DraggableBottomSheet({ super.key, this.controller, this.isVisible = false, + this.backgroundColor = Colors.white, this.initialHeight = 200, this.minHeight = 0, this.maxHeight = 700, @@ -56,8 +58,8 @@ class DraggableBottomSheet extends StatelessWidget { }, child: Container( height: data.value, - decoration: const BoxDecoration( - color: Colors.white, + decoration: BoxDecoration( + color: backgroundColor, borderRadius: BorderRadius.vertical(top: Radius.circular(50)), ), child: Column(