bottom sheet markerDetails
This commit is contained in:
2025-04-14 17:31:17 +03:30
parent cf4dfb23ea
commit 1a31d4cdbf
3 changed files with 215 additions and 51 deletions

View File

@@ -126,11 +126,19 @@ class SupervisionFilterLogic extends GetxController
sheetController.value = sheetController.value =
DraggableBottomSheetController( DraggableBottomSheetController(
initialVisibility: true, initialVisibility: true,
initialHeight: 300, initialHeight: 250,
minHeight: 50, minHeight: 50,
maxHeight: 300, maxHeight: 300,
); );
}else if(data == BottomSheetStep.markerDetails){
sheetController.value =
DraggableBottomSheetController(
initialVisibility: true,
initialHeight: 500,
minHeight: 50,
maxHeight: 700,
);
} }
sheetController.refresh(); sheetController.refresh();
sheetController.value.toggle(); sheetController.value.toggle();

View File

@@ -88,19 +88,19 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
left: 0, left: 0,
right: 0, right: 0,
child: ObxValue((data) { child: ObxValue((data) {
fLog(data);
return DraggableBottomSheet( return DraggableBottomSheet(
controller: data.value, controller: data.value,
backgroundColor: controller.bottomSheetStep.value == BottomSheetStep.filter ? Colors.white : AppColor.lightGreyLight ,
child: ObxValue((data) { child: ObxValue((data) {
if (data.value == BottomSheetStep.filter) { if (data.value == BottomSheetStep.filter) {
return filterWidget(); return filterWidget();
} else if (data.value == BottomSheetStep.markerSelected) { } else if (data.value == BottomSheetStep.markerSelected) {
return selectedLocationWidget(); return selectedLocationWidget();
} else if (data.value == BottomSheetStep.markerDetails) {
return markerDetailsWidget();
} else { } else {
return const SizedBox( return Container(height: 300, color: AppColor.blueNormal);
height: 150,
child: Center(child: Text('Marker Selected')),
);
} }
}, controller.bottomSheetStep), }, controller.bottomSheetStep),
); );
@@ -130,7 +130,6 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20), padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
child: Slidable( child: Slidable(
key: Key('item'), key: Key('item'),
endActionPane: ActionPane( endActionPane: ActionPane(
motion: StretchMotion(), motion: StretchMotion(),
children: [ children: [
@@ -163,52 +162,59 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
), ),
], ],
), ),
child: Container( child: GestureDetector(
height: 58, onTap: () {
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), controller.bottomSheetStep.value = BottomSheetStep.markerDetails;
if (!controller.sheetController.value.isVisible.value) {
decoration: BoxDecoration( controller.sheetController.value.show();
color: Colors.white, }
borderRadius: BorderRadius.circular(8), },
border: Border.all(width: 1, color: AppColor.blackLightHover), child: Container(
), height: 58,
child: Row( padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15),
mainAxisAlignment: MainAxisAlignment.spaceBetween, decoration: BoxDecoration(
children: [ color: Colors.white,
Column( borderRadius: BorderRadius.circular(8),
children: [ border: Border.all(width: 1, color: AppColor.blackLightHover),
Text( ),
'داود خرم مهری پور', child: Row(
style: AppFonts.yekan10.copyWith( mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: AppColor.blueNormal, children: [
Column(
children: [
Text(
'داود خرم مهری پور',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
), ),
), Text(
Text( 'گوشت و مرغ',
'گوشت و مرغ', style: AppFonts.yekan12.copyWith(
style: AppFonts.yekan12.copyWith( color: AppColor.darkGreyDarkHover,
color: AppColor.darkGreyDarkHover, ),
), ),
), ],
], ),
), Column(
Column( children: [
children: [ Text(
Text( 'باقی مانده',
'باقی مانده', style: AppFonts.yekan10.copyWith(
style: AppFonts.yekan10.copyWith( color: AppColor.blueNormal,
color: AppColor.blueNormal, ),
), ),
), Text(
Text( '0 کیلوگرم',
'0 کیلوگرم', style: AppFonts.yekan12.copyWith(
style: AppFonts.yekan12.copyWith( color: AppColor.darkGreyDarkHover,
color: AppColor.darkGreyDarkHover, ),
), ),
), ],
], ),
), vecWidget(Assets.vecScanBarcodeSvg),
vecWidget(Assets.vecScanBarcodeSvg), ],
], ),
), ),
), ),
), ),
@@ -394,6 +400,154 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
), ),
); );
} }
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({ Widget customChip({

View File

@@ -11,11 +11,13 @@ class DraggableBottomSheet extends StatelessWidget {
final double minHeight; final double minHeight;
final double maxHeight; final double maxHeight;
final Widget? child; final Widget? child;
final Color? backgroundColor;
const DraggableBottomSheet({ const DraggableBottomSheet({
super.key, super.key,
this.controller, this.controller,
this.isVisible = false, this.isVisible = false,
this.backgroundColor = Colors.white,
this.initialHeight = 200, this.initialHeight = 200,
this.minHeight = 0, this.minHeight = 0,
this.maxHeight = 700, this.maxHeight = 700,
@@ -56,8 +58,8 @@ class DraggableBottomSheet extends StatelessWidget {
}, },
child: Container( child: Container(
height: data.value, height: data.value,
decoration: const BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: backgroundColor,
borderRadius: BorderRadius.vertical(top: Radius.circular(50)), borderRadius: BorderRadius.vertical(top: Radius.circular(50)),
), ),
child: Column( child: Column(