feat : expand product in home page

This commit is contained in:
2025-06-30 09:28:45 +03:30
parent 48f050a122
commit 443b9f489c
2 changed files with 105 additions and 61 deletions

View File

@@ -12,6 +12,8 @@ class HomeLogic extends GetxController {
Rxn<InventoryModel> inventoryModel = Rxn<InventoryModel>(); Rxn<InventoryModel> inventoryModel = Rxn<InventoryModel>();
Rxn<KillHouseDistributionInfo> killHouseDistributionInfo = Rxn<KillHouseDistributionInfo>(); Rxn<KillHouseDistributionInfo> killHouseDistributionInfo = Rxn<KillHouseDistributionInfo>();
RxBool isExpanded = false.obs;
@override @override
void onInit() { void onInit() {

View File

@@ -16,74 +16,116 @@ class HomePage extends GetView<HomeLogic> {
return Scaffold( return Scaffold(
backgroundColor: AppColor.bgLight, backgroundColor: AppColor.bgLight,
appBar: chickenAppBar( appBar: chickenAppBar(
hasBack: false, hasBack: false,
hasFilter: false, hasFilter: false,
hasSearch: false hasSearch: false
), ),
body: Column( body: Column(
spacing: 8, spacing: 8,
children: [ children: [
Card(
margin: EdgeInsetsGeometry.all(6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(width: 0.50, color: const Color(0xFFA9A9A9)),
),
child: Padding( InkWell(
padding: const EdgeInsets.all(8.0), onTap: () {
child: Column( controller.isExpanded.value = !controller.isExpanded.value;
mainAxisSize: MainAxisSize.min, },
children: [ child: Card(
Row( margin: EdgeInsetsGeometry.all(6),
spacing: 8, shape: RoundedRectangleBorder(
crossAxisAlignment: CrossAxisAlignment.center, borderRadius: BorderRadius.circular(8),
children: [ side: BorderSide(width: 0.50, color: const Color(0xFFA9A9A9)),
Container( ),
width: 40,
height: 40, child: ObxValue((data) {
decoration: ShapeDecoration( return AnimatedSize(duration: Duration(milliseconds: 300),
image: DecorationImage(image: AssetImage(Assets.images.chicken.path), fit: BoxFit.cover), child: data.value ? Padding(
shape: RoundedRectangleBorder( padding: const EdgeInsets.all(8.0),
side: BorderSide(width: 0.25, color: const Color(0xFFB0B0B0)), child: Column(
borderRadius: BorderRadius.circular(4), mainAxisSize: MainAxisSize.min,
children: [
Row(
spacing: 8,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
image: DecorationImage(
image: AssetImage(Assets.images.chicken.path), fit: BoxFit.cover),
shape: RoundedRectangleBorder(
side: BorderSide(width: 0.25, color: const Color(0xFFB0B0B0)),
borderRadius: BorderRadius.circular(4),
),
),
),
Text(
'مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkActive),
),
Spacer(),
AnimatedRotation(
turns: 180,
duration: Duration(milliseconds: 3000),
child: Icon(CupertinoIcons.chevron_up, size: 18),
),
],
), ),
), SizedBox(height: 8),
_todayShipmentWidget(),
_inventoryWidget(),
Row(
children: [Text('اطلاعات بارها', textAlign: TextAlign.right, style: AppFonts.yekan16)],
),
_informationShipment(),
Row(
children: [Text('اطلاعات توزیع', textAlign: TextAlign.right, style: AppFonts.yekan16)],
),
distributionInformationWidget(),
],
), ),
Text( ) : Padding(
'مرغ گرم', padding: const EdgeInsets.all(8.0),
textAlign: TextAlign.right, child: Column(
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkActive), mainAxisSize: MainAxisSize.min,
children: [
Row(
spacing: 8,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 40,
height: 40,
decoration: ShapeDecoration(
image: DecorationImage(
image: AssetImage(Assets.images.chicken.path), fit: BoxFit.cover),
shape: RoundedRectangleBorder(
side: BorderSide(width: 0.25, color: const Color(0xFFB0B0B0)),
borderRadius: BorderRadius.circular(4),
),
),
),
Text(
'مرغ گرم',
textAlign: TextAlign.right,
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkActive),
),
Spacer(),
Icon(CupertinoIcons.chevron_down, size: 18),
],
),
],
), ),
Spacer(), ),
AnimatedRotation(
turns: 180,
duration: Duration(milliseconds: 3000),
child: Icon(CupertinoIcons.chevron_up, size: 18),
),
],
),
SizedBox(height: 8),
_todayShipmentWidget(),
_inventoryWidget(), );
}, controller.isExpanded),
Row( )),
children: [Text('اطلاعات بارها', textAlign: TextAlign.right, style: AppFonts.yekan16)],
),
_informationShipment(),
Row(
children: [Text('اطلاعات توزیع', textAlign: TextAlign.right, style: AppFonts.yekan16)],
),
distributionInformationWidget(),
],
),
),
),
Padding( Padding(
padding: EdgeInsetsGeometry.all(6), padding: EdgeInsetsGeometry.all(6),
@@ -102,9 +144,9 @@ class HomePage extends GetView<HomeLogic> {
widelyUsed( widelyUsed(
title: 'خرید خارج استان', title: 'خرید خارج استان',
iconPath: Assets.vec.cubeSearchSvg.path, iconPath: Assets.vec.cubeSearchSvg.path,
onTap:() async{ onTap: () async {
iLog('on tap :خرید خارج استان '); iLog('on tap :خرید خارج استان ');
controller.rootLogic.currentPage.value =1; controller.rootLogic.currentPage.value = 1;
controller.rootLogic.currentPage.refresh(); controller.rootLogic.currentPage.refresh();
await Future.delayed(Duration(milliseconds: 100)); await Future.delayed(Duration(milliseconds: 100));
Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1); Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1);