adde budget badge on tenders

This commit is contained in:
amirrezaghabeli
2025-09-30 12:59:12 +03:30
parent bfc236edc6
commit b9cc4cb11f
3 changed files with 70 additions and 18 deletions
+1
View File
@@ -164,6 +164,7 @@ class AppColors {
// Primary color variations // Primary color variations
static const Color primary2 = Color(0xFFE5EFFF); static const Color primary2 = Color(0xFFE5EFFF);
static const Color primary40 = Color(0xFFB4D1FF);
static const Color secondary50 = Color(0xFF34BCCB); static const Color secondary50 = Color(0xFF34BCCB);
// Red variations (status colors) // Red variations (status colors)
@@ -7,7 +7,7 @@ class TendersStrings {
static const String submit = 'Submit'; static const String submit = 'Submit';
static const String dislike = 'Dislike'; static const String dislike = 'Dislike';
static const String like = 'Like'; static const String like = 'Like';
static const String tenderDeadlineLabel = 'Deadline'; static const String tenderDeadlineLabel = 'Deadline :';
static const String contracts = 'Contracts'; static const String contracts = 'Contracts';
static const String notifications = 'Notifications'; static const String notifications = 'Notifications';
static const String of = 'Of'; static const String of = 'Of';
@@ -25,4 +25,5 @@ class TendersStrings {
static const String sort = 'Sort'; static const String sort = 'Sort';
static const String mostOfTheTime = 'Most of the time'; static const String mostOfTheTime = 'Most of the time';
static const String minimumTime = 'Minimum time'; static const String minimumTime = 'Minimum time';
static const String tenderBudgetLabel = 'Budget :';
} }
+67 -17
View File
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart' hide DateUtils; import 'package:flutter/material.dart' hide DateUtils;
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:tm_app/core/routes/app_routes.dart'; import 'package:tm_app/core/routes/app_routes.dart';
import 'package:tm_app/core/utils/price_extension.dart';
import 'package:tm_app/data/services/model/tender_data/tender_data.dart'; import 'package:tm_app/data/services/model/tender_data/tender_data.dart';
import '../../../core/constants/assets.dart'; import '../../../core/constants/assets.dart';
@@ -24,7 +25,7 @@ class TenderCard extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16.0.w()), margin: EdgeInsets.symmetric(horizontal: 16.0.w()),
height: isDesktop ? 290.0.h() : 587.0.h(), height: isDesktop ? 350.0.h() : 587.0.h(),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.grey0, color: AppColors.grey0,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
@@ -126,29 +127,78 @@ class TenderCard extends StatelessWidget {
Widget _deadlineBadge() { Widget _deadlineBadge() {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 24.0.h(), // height: 24.0.h(),
padding: EdgeInsets.symmetric(horizontal: 8.0.w()), // height: 65.0.h(),
padding: EdgeInsets.symmetric(horizontal: 8.0.w(), vertical: 6.0.h()),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.primary20, color: AppColors.primary20,
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
child: Row( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Row(
TendersStrings.tenderDeadlineLabel, mainAxisAlignment: MainAxisAlignment.start,
style: TextStyle( children: [
color: AppColors.textBlue, Text(
fontSize: 14.0.sp(), TendersStrings.tenderDeadlineLabel,
fontWeight: FontWeight.w500, style: TextStyle(
), color: AppColors.textBlue,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
SizedBox(width: 4.0.w()),
Text(
timeConvertor(tender.submissionDeadline ?? 0),
style: TextStyle(
color: AppColors.grey80,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
],
), ),
Text( // SizedBox(height: 4.0.h()),
timeConvertor(tender.submissionDeadline ?? 0), Visibility(
style: TextStyle( visible:
color: AppColors.grey80, tender.estimatedValue != null && tender.estimatedValue != 0,
fontSize: 14.0.sp(), child: const Divider(color: AppColors.primary40),
fontWeight: FontWeight.w500, ),
// SizedBox(height: 4.0.h()),
Visibility(
visible:
tender.estimatedValue != null && tender.estimatedValue != 0,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
TendersStrings.tenderBudgetLabel,
style: TextStyle(
color: AppColors.textBlue,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
SizedBox(width: 4.0.w()),
Text(
tender.estimatedValue?.formattedPrice ?? '',
style: TextStyle(
color: AppColors.grey80,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
SizedBox(width: 4.0.w()),
Text(
tender.currency ?? '',
style: TextStyle(
color: AppColors.grey80,
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
),
),
],
), ),
), ),
], ],