Files
tm_app/lib/views/home/tenders_list_item.dart
T
amirrezaghabeli 1fdfc52297 home logic added
2025-08-09 14:15:02 +03:30

122 lines
3.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:tm_app/data/services/model/home/tender/tender_model.dart';
import '../../core/constants/assets.dart';
import '../../core/theme/colors.dart';
import '../../core/utils/size_config.dart';
class TendersListItem extends StatelessWidget {
const TendersListItem({required this.tender, super.key});
final TenderModel tender;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: AppColors.cardBackground,
borderRadius: BorderRadius.circular(4),
),
margin: EdgeInsetsDirectional.only(end: 16.0.w()),
width: 320.0.w(),
height: 280.0.h(),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 16.0.h()),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
tender.createdTime ?? '',
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
),
Container(
width: 91.0.w(),
height: 24.0.h(),
decoration: BoxDecoration(
color: AppColors.green20,
borderRadius: BorderRadius.circular(8),
),
alignment: Alignment.center,
child: Text(
tender.status ?? '',
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.green30,
),
),
),
],
),
SizedBox(height: 12.0.h()),
Text(
tender.title ?? '',
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.w600,
color: AppColors.grey80,
),
),
SizedBox(height: 8.0.h()),
Text(
tender.description ?? '',
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey70,
),
),
SizedBox(height: 24.0.h()),
Row(
children: [
SvgPicture.asset(AssetsManager.location),
SizedBox(width: 1.0.w()),
Text(
tender.location ?? '',
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey80,
),
),
SizedBox(width: 8.0.w()),
SizedBox(
width: 32.0.w(),
height: 21.0.h(),
child: Image.asset(AssetsManager.seFlag, fit: BoxFit.cover),
),
Spacer(),
Container(
width: 96.0.w(),
height: 24.0.h(),
decoration: BoxDecoration(
color: AppColors.grey30,
borderRadius: BorderRadius.circular(88),
),
alignment: Alignment.center,
child: Text(
tender.type ?? '',
style: TextStyle(
fontSize: 12.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.grey60,
),
),
),
],
),
],
),
),
);
}
}