From a909210144c8cec1611747287c7c69e7715c2d28 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Sun, 13 Jul 2025 08:34:59 +0330 Subject: [PATCH] fix : saleOrBuyItemCard color --- packages/chicken/lib/data/di/chicken_di.dart | 2 +- .../lib/presentation/pages/buy/view.dart | 6 ++++-- .../lib/presentation/pages/sale/view.dart | 4 ++-- .../presentation/widget/sale_buy_card_item.dart | 17 +++++++++++++---- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/chicken/lib/data/di/chicken_di.dart b/packages/chicken/lib/data/di/chicken_di.dart index eca66b7..ed05229 100644 --- a/packages/chicken/lib/data/di/chicken_di.dart +++ b/packages/chicken/lib/data/di/chicken_di.dart @@ -11,7 +11,7 @@ Future setupChickenDI() async { () => AppInterceptor( refreshTokenCallback: () async {}, saveTokenCallback: (String newToken) async { - await tokenService.saveAccessToken(newToken); // ذخیره توکن جدید + await tokenService.saveAccessToken(newToken); }, clearTokenCallback: () async { await tokenService.deleteTokens(); diff --git a/packages/chicken/lib/presentation/pages/buy/view.dart b/packages/chicken/lib/presentation/pages/buy/view.dart index cbdef58..27be7b2 100644 --- a/packages/chicken/lib/presentation/pages/buy/view.dart +++ b/packages/chicken/lib/presentation/pages/buy/view.dart @@ -23,15 +23,17 @@ class BuyPage extends GetView { spacing: 14.w, children: [ saleOrBuyItemCard( - title: 'داخل استان', + title: 'خرید داخل استان', iconPath: Assets.vec.cubeSvg.path, + color: AppColor.greenNormalActive, onTap: () { Get.toNamed(ChickenRoutes.buysInProvince, id: 0); }, ), saleOrBuyItemCard( - title: 'خارج استان', + title: 'خرید خارج استان', iconPath: Assets.vec.truckFastSvg.path, + color: AppColor.greenNormalActive, onTap: () { Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 0); }, diff --git a/packages/chicken/lib/presentation/pages/sale/view.dart b/packages/chicken/lib/presentation/pages/sale/view.dart index 703dfaf..3e6f697 100644 --- a/packages/chicken/lib/presentation/pages/sale/view.dart +++ b/packages/chicken/lib/presentation/pages/sale/view.dart @@ -24,14 +24,14 @@ class SalePage extends GetView { spacing: 14.w, children: [ saleOrBuyItemCard( - title: 'داخل استان', + title: 'فروش داخل استان', iconPath: Assets.vec.cubeSvg.path, onTap: () { Get.toNamed(ChickenRoutes.salesInProvince, id: 1); }, ), saleOrBuyItemCard( - title: 'خارج استان', + title: 'فروش خارج استان', iconPath: Assets.vec.truckFastSvg.path, onTap: () { Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1); diff --git a/packages/chicken/lib/presentation/widget/sale_buy_card_item.dart b/packages/chicken/lib/presentation/widget/sale_buy_card_item.dart index b261a29..9c8459c 100644 --- a/packages/chicken/lib/presentation/widget/sale_buy_card_item.dart +++ b/packages/chicken/lib/presentation/widget/sale_buy_card_item.dart @@ -1,14 +1,19 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -Widget saleOrBuyItemCard({String? title, String? iconPath, required VoidCallback onTap}) { +Widget saleOrBuyItemCard({ + String? title, + String? iconPath, + required VoidCallback onTap, + Color? color, +}) { return InkWell( borderRadius: BorderRadius.circular(8.r), onTap: onTap, child: Card( color: Colors.white, shape: RoundedRectangleBorder( - side: BorderSide(color: AppColor.blueNormal, width: 1.0.w), + side: BorderSide(color: color ?? AppColor.blueNormal, width: 1.0.w), borderRadius: BorderRadius.circular(8.r), ), child: Container( @@ -23,10 +28,14 @@ Widget saleOrBuyItemCard({String? title, String? iconPath, required VoidCallback SvgGenImage.vec(iconPath).svg( width: 64.w, height: 64.h, - colorFilter: const ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + colorFilter: ColorFilter.mode(color ?? AppColor.blueNormal, BlendMode.srcIn), ), SizedBox(height: 12.h), - if (title != null) Text(title, style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)), + if (title != null) + Text( + title, + style: AppFonts.yekan16Bold.copyWith(color: color ?? AppColor.blueNormal), + ), ], ), ),