check and fix in ui

This commit is contained in:
amirrezaghabeli
2025-08-10 16:05:03 +03:30
parent 55d7d96baf
commit 9ea9480818
35 changed files with 1066 additions and 416 deletions
+33 -65
View File
@@ -1,52 +1,18 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:tm_app/core/constants/strings.dart';
import 'package:tm_app/core/routes/app_routes.dart';
import '../../../core/constants/assets.dart';
import '../../../core/theme/colors.dart';
import '../../../core/utils/size_config.dart';
import '../models/tender_model.dart';
import 'tender_action_buttons.dart';
class TenderCard extends StatelessWidget {
final String date;
final String deadline;
final String title;
final String description;
final String tenderId;
final String location;
final String country;
final double matchPercentage;
final VoidCallback? onApply;
final VoidCallback? onLike;
final VoidCallback? onDislike;
final VoidCallback? onClose;
final bool isLiked;
final bool isDisliked;
final VoidCallback? onReject;
final VoidCallback? onSubmit;
final bool rejected;
final bool submitted;
const TenderCard({
required this.date,
required this.deadline,
required this.title,
required this.description,
required this.tenderId,
required this.location,
required this.country,
required this.matchPercentage,
this.onApply,
this.onLike,
this.onDislike,
this.onClose,
this.isLiked = false,
this.isDisliked = false,
this.onReject,
this.onSubmit,
this.rejected = false,
this.submitted = false,
super.key,
});
final Tender tender;
final bool isDesktop;
const TenderCard({required this.tender, super.key, this.isDesktop = false});
@override
Widget build(BuildContext context) {
@@ -71,13 +37,23 @@ class TenderCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Date
Text(
date,
style: TextStyle(
color: AppColors.grey60,
fontSize: 12.0.sp(),
fontWeight: FontWeight.w400,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
tender.date,
style: TextStyle(
color: AppColors.grey60,
fontSize: 12.0.sp(),
fontWeight: FontWeight.w400,
),
),
if (isDesktop)
TenderActionButtons(
tender: tender,
isDesktop: isDesktop,
),
],
),
SizedBox(height: 12.0.h()),
@@ -102,7 +78,7 @@ class TenderCard extends StatelessWidget {
),
),
Text(
deadline,
tender.deadline,
style: TextStyle(
color: AppColors.grey80,
fontSize: 14.0.sp(),
@@ -116,7 +92,7 @@ class TenderCard extends StatelessWidget {
// Title
Text(
title,
tender.title,
style: TextStyle(
color: AppColors.grey80,
fontSize: 16.0.sp(),
@@ -127,7 +103,7 @@ class TenderCard extends StatelessWidget {
// Description
Text(
description,
tender.description,
style: TextStyle(
color: AppColors.grey70,
fontSize: 16.0.sp(),
@@ -139,7 +115,7 @@ class TenderCard extends StatelessWidget {
// Tender ID
Text(
tenderId,
tender.tenderId,
style: TextStyle(
color: AppColors.grey,
fontSize: 14.0.sp(),
@@ -168,7 +144,7 @@ class TenderCard extends StatelessWidget {
),
),
Text(
'${matchPercentage.toInt()}%',
'${tender.matchPercentage.toInt()}%',
style: TextStyle(
color: AppColors.secondaryTextColor,
fontSize: 16.0.sp(),
@@ -189,7 +165,7 @@ class TenderCard extends StatelessWidget {
),
child: FractionallySizedBox(
alignment: Alignment.centerLeft,
widthFactor: matchPercentage / 100,
widthFactor: tender.matchPercentage / 100,
child: Container(
decoration: BoxDecoration(
color: AppColors.secondary50,
@@ -210,7 +186,7 @@ class TenderCard extends StatelessWidget {
SvgPicture.asset(AssetsManager.location),
SizedBox(width: 4.0.w()),
Text(
location,
tender.location,
style: TextStyle(
color: AppColors.grey80,
fontSize: 14.0.sp(),
@@ -230,7 +206,9 @@ class TenderCard extends StatelessWidget {
// See More button
GestureDetector(
onTap: onApply,
onTap: () {
TenderDetailRouteData().push(context);
},
child: Container(
width: 108.0.w(),
height: 40.0.h(),
@@ -258,17 +236,7 @@ class TenderCard extends StatelessWidget {
),
),
SizedBox(height: 72.0.h()),
TenderActionButtons(
isDisliked: isDisliked,
isLiked: isLiked,
onDislike: onDislike,
onLike: onLike,
onClose: onClose,
onReject: onReject,
onSubmit: onSubmit,
rejected: rejected,
submitted: submitted,
),
if (!isDesktop) TenderActionButtons(tender: tender),
],
);
}