Merge branch 'main' of https://repo.ravanertebat.com/TM/tm_app
This commit is contained in:
@@ -44,7 +44,7 @@ class TenderCard extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(iconPath),
|
SvgPicture.asset(iconPath,width: 32.0.w(),height: 32.0.h(),),
|
||||||
SizedBox(height: 4.0.h()),
|
SizedBox(height: 4.0.h()),
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
|
|||||||
@@ -118,7 +118,8 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
|||||||
},
|
},
|
||||||
child: LikedListItem(
|
child: LikedListItem(
|
||||||
tender: item.tender!,
|
tender: item.tender!,
|
||||||
approval: approval!,
|
approval: approval,
|
||||||
|
isDesktop: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -142,7 +143,7 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
|||||||
),
|
),
|
||||||
SizedBox(width: 10.0.w()),
|
SizedBox(width: 10.0.w()),
|
||||||
|
|
||||||
GestureDetector(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final selectedPage = await showDialog<int>(
|
final selectedPage = await showDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class _LikedTendersMobilePageState extends State<LikedTendersMobilePage> {
|
|||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 20.0.w(),
|
horizontal: 20.0.w(),
|
||||||
),
|
),
|
||||||
child: SvgPicture.asset(AssetsManager.trash),
|
child: SvgPicture.asset(AssetsManager.trash,width: 32.0.w(),height: 32.0.h(),),
|
||||||
),
|
),
|
||||||
onDismissed: (_) {
|
onDismissed: (_) {
|
||||||
if (item.tenderId != null) {
|
if (item.tenderId != null) {
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
),
|
),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
AssetsManager.trash,
|
AssetsManager.trash,
|
||||||
|
width: 32.0.w(),height: 32.0.h(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onDismissed: (_) {
|
onDismissed: (_) {
|
||||||
@@ -150,7 +151,7 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
),
|
),
|
||||||
SizedBox(width: 10.0.w()),
|
SizedBox(width: 10.0.w()),
|
||||||
|
|
||||||
GestureDetector(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final selectedPage = await showDialog<int>(
|
final selectedPage = await showDialog<int>(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@@ -1,21 +1,31 @@
|
|||||||
import 'package:country_flags/country_flags.dart';
|
import 'package:country_flags/country_flags.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tm_app/core/constants/assets.dart';
|
import 'package:tm_app/core/constants/assets.dart';
|
||||||
import 'package:tm_app/core/theme/colors.dart';
|
import 'package:tm_app/core/theme/colors.dart';
|
||||||
import 'package:tm_app/core/utils/size_config.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/data/services/model/tender_data/tender_data.dart';
|
||||||
|
import 'package:tm_app/view_models/liked_tenders_view_model.dart';
|
||||||
import 'package:tm_app/views/home/strings/home_strings.dart';
|
import 'package:tm_app/views/home/strings/home_strings.dart';
|
||||||
|
|
||||||
import '../../../data/services/model/tender_approvals_data/tender_approvals_data.dart';
|
import '../../../data/services/model/tender_approvals_data/tender_approvals_data.dart';
|
||||||
|
|
||||||
class LikedListItem extends StatelessWidget {
|
class LikedListItem extends StatelessWidget {
|
||||||
const LikedListItem({required this.tender, this.approval, super.key});
|
const LikedListItem({
|
||||||
|
required this.tender,
|
||||||
|
this.approval,
|
||||||
|
this.isDesktop = false,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
final TenderData tender;
|
final TenderData tender;
|
||||||
final TenderApprovalsData? approval;
|
final TenderApprovalsData? approval;
|
||||||
|
|
||||||
|
final bool isDesktop;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final viewModel = context.read<LikedTendersViewModel>();
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColors.cardBackground,
|
color: AppColors.cardBackground,
|
||||||
@@ -31,7 +41,58 @@ class LikedListItem extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 10.0.h()),
|
SizedBox(height: 10.0.h()),
|
||||||
Container(
|
isDesktop
|
||||||
|
? Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: 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(width: 8.0.w()),
|
||||||
|
InkWell(
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
AssetsManager.trash,
|
||||||
|
width: 32.0.w(),
|
||||||
|
height: 32.0.h(),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
if (tender.id != null) {
|
||||||
|
viewModel.removeTenderById(tender.id!);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 10.0.w(),
|
horizontal: 10.0.w(),
|
||||||
vertical: 5.0.h(),
|
vertical: 5.0.h(),
|
||||||
@@ -113,7 +174,7 @@ class LikedListItem extends StatelessWidget {
|
|||||||
Spacer(),
|
Spacer(),
|
||||||
Container(
|
Container(
|
||||||
width: 32.0.w(),
|
width: 32.0.w(),
|
||||||
height: 32.0.w(),
|
height: 32.0.h(),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
@@ -137,7 +198,7 @@ class LikedListItem extends StatelessWidget {
|
|||||||
SizedBox(width: 30.0.w()),
|
SizedBox(width: 30.0.w()),
|
||||||
Container(
|
Container(
|
||||||
width: 32.0.w(),
|
width: 32.0.w(),
|
||||||
height: 32.0.w(),
|
height: 32.0.h(),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ class TenderActionButtonsRow extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 32.0.w(),
|
width: 24.0.w(),
|
||||||
height: 32.0.w(),
|
height: 24.0.w(),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
@@ -161,8 +161,8 @@ class TenderActionButtonsRow extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 32.0.w(),
|
width: 24.0.w(),
|
||||||
height: 32.0.w(),
|
height: 24.0.w(),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
@@ -215,8 +215,8 @@ class TenderActionButtonsRow extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
width: 32.0.w(),
|
width: 24.0.w(),
|
||||||
height: 32.0.w(),
|
height: 24.0.w(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
AssetsManager.dislike,
|
AssetsManager.dislike,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
@@ -259,8 +259,8 @@ class TenderActionButtonsRow extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SvgPicture.asset(
|
SvgPicture.asset(
|
||||||
width: 32.0.w(),
|
width: 24.0.w(),
|
||||||
height: 32.0.w(),
|
height: 24.0.w(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
AssetsManager.like,
|
AssetsManager.like,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
|
|||||||
Reference in New Issue
Block a user