fix : saleOrBuyItemCard color

This commit is contained in:
2025-07-13 08:34:59 +03:30
parent f64ac3748b
commit a909210144
4 changed files with 20 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ Future<void> setupChickenDI() async {
() => AppInterceptor( () => AppInterceptor(
refreshTokenCallback: () async {}, refreshTokenCallback: () async {},
saveTokenCallback: (String newToken) async { saveTokenCallback: (String newToken) async {
await tokenService.saveAccessToken(newToken); // ذخیره توکن جدید await tokenService.saveAccessToken(newToken);
}, },
clearTokenCallback: () async { clearTokenCallback: () async {
await tokenService.deleteTokens(); await tokenService.deleteTokens();

View File

@@ -23,15 +23,17 @@ class BuyPage extends GetView<BuyLogic> {
spacing: 14.w, spacing: 14.w,
children: [ children: [
saleOrBuyItemCard( saleOrBuyItemCard(
title: 'داخل استان', title: 'خرید داخل استان',
iconPath: Assets.vec.cubeSvg.path, iconPath: Assets.vec.cubeSvg.path,
color: AppColor.greenNormalActive,
onTap: () { onTap: () {
Get.toNamed(ChickenRoutes.buysInProvince, id: 0); Get.toNamed(ChickenRoutes.buysInProvince, id: 0);
}, },
), ),
saleOrBuyItemCard( saleOrBuyItemCard(
title: 'خارج استان', title: 'خرید خارج استان',
iconPath: Assets.vec.truckFastSvg.path, iconPath: Assets.vec.truckFastSvg.path,
color: AppColor.greenNormalActive,
onTap: () { onTap: () {
Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 0); Get.toNamed(ChickenRoutes.buysOutOfProvince, id: 0);
}, },

View File

@@ -24,14 +24,14 @@ class SalePage extends GetView<SaleLogic> {
spacing: 14.w, spacing: 14.w,
children: [ children: [
saleOrBuyItemCard( saleOrBuyItemCard(
title: 'داخل استان', title: 'فروش داخل استان',
iconPath: Assets.vec.cubeSvg.path, iconPath: Assets.vec.cubeSvg.path,
onTap: () { onTap: () {
Get.toNamed(ChickenRoutes.salesInProvince, id: 1); Get.toNamed(ChickenRoutes.salesInProvince, id: 1);
}, },
), ),
saleOrBuyItemCard( saleOrBuyItemCard(
title: 'خارج استان', title: 'فروش خارج استان',
iconPath: Assets.vec.truckFastSvg.path, iconPath: Assets.vec.truckFastSvg.path,
onTap: () { onTap: () {
Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1); Get.toNamed(ChickenRoutes.salesOutOfProvince, id: 1);

View File

@@ -1,14 +1,19 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.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( return InkWell(
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
onTap: onTap, onTap: onTap,
child: Card( child: Card(
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( 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), borderRadius: BorderRadius.circular(8.r),
), ),
child: Container( child: Container(
@@ -23,10 +28,14 @@ Widget saleOrBuyItemCard({String? title, String? iconPath, required VoidCallback
SvgGenImage.vec(iconPath).svg( SvgGenImage.vec(iconPath).svg(
width: 64.w, width: 64.w,
height: 64.h, height: 64.h,
colorFilter: const ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), colorFilter: ColorFilter.mode(color ?? AppColor.blueNormal, BlendMode.srcIn),
), ),
SizedBox(height: 12.h), 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),
),
], ],
), ),
), ),