feat : profile and history action supervision

This commit is contained in:
2025-04-20 11:48:06 +03:30
parent e643a4844e
commit a7c3fa4c98
4 changed files with 283 additions and 35 deletions

View File

@@ -29,12 +29,36 @@ class ActionPage extends GetView<ActionLogic> {
}),
);
}, controller.selectedIndex),
Expanded(
child: ObxValue(
(index) => switch (index.value) {
0 => profileWidget(),
1 => slidableWidgetTwo(),
2 => slidableWidgetOne(),
3 => slidableWidgetOne(),
int() => Placeholder(),
},
controller.selectedIndex,
),
),
],
),
),
);
}
Column profileWidget() {
return Column(
children: [
slidableWidgetOne(),
slidableWidgetOne(),
slidableWidgetOne(),
slidableWidgetOne(),
slidableWidgetOne(),
],
);
}
Widget headerWidget({
required String icon,
required String title,
@@ -66,11 +90,243 @@ class ActionPage extends GetView<ActionLogic> {
Text(
title,
style: AppFonts.yekan12.copyWith(
color: isSelected ? AppColor.blueNormalActive : AppColor.blueNormal,
color:
isSelected ? AppColor.blueNormalActive : AppColor.blueNormal,
),
),
],
),
);
}
Widget slidableWidgetOne() {
if (controller.showSlideHint) {
controller.triggerSlidableAnimation();
}
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
child: Slidable(
key: Key('selectedLocationWidget'),
controller: controller.slidController.value,
endActionPane: ActionPane(
motion: StretchMotion(),
children: [
CustomSlidableAction(
onPressed: (context) {},
backgroundColor: AppColor.redNormal,
foregroundColor: Colors.white,
padding: EdgeInsets.all(16),
borderRadius: BorderRadius.circular(8),
autoClose: true,
child: vecWidget(Assets.vecTrashSvg, width: 24, height: 24),
),
],
),
child: GestureDetector(
onTap: () {},
child: Container(
height: 62,
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(
spacing: 4,
children: [
Text(
'داود خرم مهری پور',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'03295224154',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
Column(
spacing: 4,
children: [
Text(
'افزودن کاربر',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'ثبت بازرسی',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
Column(
spacing: 4,
children: [
Text(
'همدان',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'همدان',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
],
),
),
),
),
);
}
Widget slidableWidgetTwo() {
return ObxValue((data) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
child: GestureDetector(
onTap: (){
controller.isExpanded.value = !controller.isExpanded.value;
},
child: AnimatedContainer(
duration: Duration(milliseconds: 2000),
height: data.value ? 370 : 62,
child:
data.value
? Container(color: Colors.yellow,height: 80,width: 180,)
: Slidable(
key: Key('selectedLocationWidget'),
controller: controller.slidController.value,
endActionPane: ActionPane(
motion: StretchMotion(),
children: [
CustomSlidableAction(
onPressed: (context) {},
backgroundColor: AppColor.blueNormal,
foregroundColor: Colors.white,
padding: EdgeInsets.all(16),
borderRadius: BorderRadius.only(
topRight: Radius.circular(8),
bottomRight: Radius.circular(8),
),
autoClose: true,
child: vecWidget(
Assets.vecEditSvg,
width: 24,
height: 24,
),
),
CustomSlidableAction(
onPressed: (context) {},
backgroundColor: AppColor.redNormal,
foregroundColor: Colors.white,
padding: EdgeInsets.all(16),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomLeft: Radius.circular(8),
),
autoClose: true,
child: vecWidget(
Assets.vecTrashSvg,
width: 24,
height: 24,
),
),
],
),
child: GestureDetector(
onTap: () {},
child: Container(
height: 62,
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(
spacing: 4,
children: [
Text(
'داود خرم مهری پور',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'03295224154',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
Column(
spacing: 4,
children: [
Text(
'افزودن کاربر',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'ثبت بازرسی',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
Column(
spacing: 4,
children: [
Text(
'همدان',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'همدان',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
],
),
),
),
),
),
),
);
}, controller.isExpanded);
}
}