Added liked tenders desigm and data from api
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
import 'package:country_flags/country_flags.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:tm_app/core/constants/assets.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/data/services/model/tender_data/tender_data.dart';
|
||||
import 'package:tm_app/views/home/strings/home_strings.dart';
|
||||
|
||||
class LikedListItem extends StatelessWidget {
|
||||
const LikedListItem({required this.tender, super.key});
|
||||
final TenderData tender;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.cardBackground,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(color: AppColors.grey30),
|
||||
),
|
||||
margin: EdgeInsetsDirectional.only(end: 16.0.w()),
|
||||
width: double.infinity,
|
||||
height: 250.0.h(),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 16.0.h()),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 10.0.h()),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10.0.w(),
|
||||
vertical: 5.0.h(),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary30,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${HomeStrings.tenderDeadline} :',
|
||||
style: TextStyle(
|
||||
fontSize: 15.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.textBlue,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
timeConvertor(tender.tenderDeadline!),
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.grey80,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12.0.h()),
|
||||
Text(
|
||||
tender.title!,
|
||||
style: TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.grey80,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.0.h()),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
tender.description!,
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 4,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey70,
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(AssetsManager.location),
|
||||
SizedBox(width: 1.0.w()),
|
||||
Text(
|
||||
tender.countryCode!,
|
||||
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: CountryFlag.fromCountryCode(
|
||||
tender.countryCode!,
|
||||
shape: RoundedRectangle(4),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Container(
|
||||
width: 32.0.w(),
|
||||
height: 32.0.w(),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: AppColors.grey60, width: 1.5.w()),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Icon(Icons.close, color: AppColors.grey60, size: 16),
|
||||
),
|
||||
SizedBox(width: 30.0.w()),
|
||||
Container(
|
||||
width: 32.0.w(),
|
||||
height: 32.0.w(),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(color: AppColors.grey60, width: 1.5.w()),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Icon(Icons.check, color: AppColors.grey60, size: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String timeConvertor(int time) {
|
||||
DateTime date = DateTime.fromMillisecondsSinceEpoch(time);
|
||||
|
||||
String formattedDate =
|
||||
"${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}";
|
||||
|
||||
return formattedDate;
|
||||
}
|
||||
Reference in New Issue
Block a user