tender screen changes
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M1 4.9999L4.77333 8.77323L12.3333 1.22656" stroke="#777777" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 240 B |
@@ -22,6 +22,7 @@ class AssetsManager {
|
|||||||
static const arrowCircleRight = 'assets/icons/arrow-circle-right.svg';
|
static const arrowCircleRight = 'assets/icons/arrow-circle-right.svg';
|
||||||
static const arrowLeftSmall = 'assets/icons/arrow-left-small.svg';
|
static const arrowLeftSmall = 'assets/icons/arrow-left-small.svg';
|
||||||
static const arrowRightSmall = 'assets/icons/arrow-right-small.svg';
|
static const arrowRightSmall = 'assets/icons/arrow-right-small.svg';
|
||||||
|
static const tick = 'assets/icons/tick.svg';
|
||||||
|
|
||||||
//home page
|
//home page
|
||||||
static const arrows = 'assets/icons/arrows.svg';
|
static const arrows = 'assets/icons/arrows.svg';
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ extension SizeDoubleExt on double {
|
|||||||
final double screenWidth = SizeConfig.screenWidth;
|
final double screenWidth = SizeConfig.screenWidth;
|
||||||
final double res = (this / 412.0) * screenWidth;
|
final double res = (this / 412.0) * screenWidth;
|
||||||
if (displaySize == DisplaySize.extraSmall
|
if (displaySize == DisplaySize.extraSmall
|
||||||
|
// ||
|
||||||
// displaySize == DisplaySize.small
|
// displaySize == DisplaySize.small
|
||||||
) {
|
) {
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -25,9 +25,6 @@ class HomeService {
|
|||||||
await Future.delayed(Duration(seconds: 2));
|
await Future.delayed(Duration(seconds: 2));
|
||||||
appLogger.info('get home success');
|
appLogger.info('get home success');
|
||||||
// TODO: will change when api is ready
|
// TODO: will change when api is ready
|
||||||
appLogger.debug(
|
|
||||||
HomeResponseModel.fromJson(jsonDecode(homeMockData)['data']),
|
|
||||||
);
|
|
||||||
return Result.ok(
|
return Result.ok(
|
||||||
HomeResponseModel.fromJson(jsonDecode(homeMockData)['data']),
|
HomeResponseModel.fromJson(jsonDecode(homeMockData)['data']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,33 +6,9 @@ import '../../core/theme/colors.dart';
|
|||||||
import '../../core/utils/size_config.dart';
|
import '../../core/utils/size_config.dart';
|
||||||
import 'widgets/main_tenders_slider.dart';
|
import 'widgets/main_tenders_slider.dart';
|
||||||
|
|
||||||
class TendersScreen extends StatefulWidget {
|
class TendersScreen extends StatelessWidget {
|
||||||
const TendersScreen({super.key});
|
const TendersScreen({super.key});
|
||||||
|
|
||||||
@override
|
|
||||||
State<TendersScreen> createState() => _TendersScreenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _TendersScreenState extends State<TendersScreen>
|
|
||||||
with SingleTickerProviderStateMixin {
|
|
||||||
late final TabController controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
controller = TabController(length: 2, vsync: this);
|
|
||||||
// Add listener to rebuild when tab changes
|
|
||||||
controller.addListener(() {
|
|
||||||
setState(() {});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
controller.dispose();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
@@ -42,12 +18,7 @@ class _TendersScreenState extends State<TendersScreen>
|
|||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 24.0.h()),
|
padding: EdgeInsets.symmetric(vertical: 24.0.h()),
|
||||||
child: Column(
|
child: MainTendersSlider(),
|
||||||
children: [
|
|
||||||
// MainTabBar(controller: controller),
|
|
||||||
MainTendersSlider(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
|||||||
List<Tender> likedTenders = [];
|
List<Tender> likedTenders = [];
|
||||||
List<Tender> dislikedTenders = [];
|
List<Tender> dislikedTenders = [];
|
||||||
int currentPage = 1;
|
int currentPage = 1;
|
||||||
|
List<Tender> rejectedTenders = [];
|
||||||
|
List<Tender> submittedTenders = [];
|
||||||
|
|
||||||
void _onDislike(Tender tender) {
|
void _onDislike(Tender tender) {
|
||||||
if (likedTenders.contains(tender)) {
|
if (likedTenders.contains(tender)) {
|
||||||
@@ -74,6 +76,25 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _onReject(Tender tender) {
|
||||||
|
if (rejectedTenders.contains(tender)) {
|
||||||
|
rejectedTenders.remove(tender);
|
||||||
|
} else {
|
||||||
|
rejectedTenders.add(tender);
|
||||||
|
}
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onSubmit(Tender tender) {
|
||||||
|
if (submittedTenders.contains(tender)) {
|
||||||
|
submittedTenders.remove(tender);
|
||||||
|
} else {
|
||||||
|
submittedTenders.add(tender);
|
||||||
|
}
|
||||||
|
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
pageController.dispose();
|
pageController.dispose();
|
||||||
@@ -86,7 +107,7 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
|||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 694.0.h(),
|
height: 717.0.h(),
|
||||||
child: PageView.builder(
|
child: PageView.builder(
|
||||||
controller: pageController,
|
controller: pageController,
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
@@ -112,6 +133,10 @@ class _MainTendersSliderState extends State<MainTendersSlider> {
|
|||||||
onDislike: () => _onDislike(tender),
|
onDislike: () => _onDislike(tender),
|
||||||
onLike: () => _onLike(tender),
|
onLike: () => _onLike(tender),
|
||||||
onApply: () => TenderDetailRouteData().push(context),
|
onApply: () => TenderDetailRouteData().push(context),
|
||||||
|
onReject: () => _onReject(tender),
|
||||||
|
onSubmit: () => _onSubmit(tender),
|
||||||
|
rejected: rejectedTenders.contains(tender),
|
||||||
|
submitted: submittedTenders.contains(tender),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -9,16 +9,24 @@ class TenderActionButtons extends StatelessWidget {
|
|||||||
final VoidCallback? onLike;
|
final VoidCallback? onLike;
|
||||||
final VoidCallback? onDislike;
|
final VoidCallback? onDislike;
|
||||||
final VoidCallback? onClose;
|
final VoidCallback? onClose;
|
||||||
|
final VoidCallback? onReject;
|
||||||
|
final VoidCallback? onSubmit;
|
||||||
final bool isLiked;
|
final bool isLiked;
|
||||||
final bool isDisliked;
|
final bool isDisliked;
|
||||||
|
final bool rejected;
|
||||||
|
final bool submitted;
|
||||||
|
|
||||||
const TenderActionButtons({
|
const TenderActionButtons({
|
||||||
super.key,
|
super.key,
|
||||||
this.onLike,
|
this.onLike,
|
||||||
this.onDislike,
|
this.onDislike,
|
||||||
this.onClose,
|
this.onClose,
|
||||||
|
this.onReject,
|
||||||
|
this.onSubmit,
|
||||||
this.isLiked = false,
|
this.isLiked = false,
|
||||||
this.isDisliked = false,
|
this.isDisliked = false,
|
||||||
|
this.rejected = false,
|
||||||
|
this.submitted = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -31,31 +39,129 @@ class TenderActionButtons extends StatelessWidget {
|
|||||||
// Dislike button
|
// Dislike button
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: onDislike,
|
onTap: onDislike,
|
||||||
child: SvgPicture.asset(
|
child: Column(
|
||||||
width: 32.0.w(),
|
children: [
|
||||||
height: 32.0.w(),
|
SvgPicture.asset(
|
||||||
fit: BoxFit.cover,
|
width: 32.0.w(),
|
||||||
AssetsManager.dislike,
|
height: 32.0.w(),
|
||||||
colorFilter: ColorFilter.mode(
|
fit: BoxFit.cover,
|
||||||
isDisliked ? AppColors.errorColor : AppColors.grey50,
|
AssetsManager.dislike,
|
||||||
BlendMode.srcATop,
|
colorFilter: ColorFilter.mode(
|
||||||
),
|
isDisliked ? AppColors.errorColor : AppColors.grey50,
|
||||||
|
BlendMode.srcATop,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.0.h()),
|
||||||
|
Text(
|
||||||
|
'Like',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: isDisliked ? AppColors.errorColor : AppColors.grey50,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(width: 32.0.w()),
|
||||||
SizedBox(width: 48.0.w()),
|
//reject button
|
||||||
|
GestureDetector(
|
||||||
|
onTap: onReject,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 32.0.w(),
|
||||||
|
height: 32.0.w(),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
border: Border.all(
|
||||||
|
color: rejected ? AppColors.errorColor : AppColors.grey60,
|
||||||
|
width: 1.5.w(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Icon(
|
||||||
|
Icons.close,
|
||||||
|
color: rejected ? AppColors.errorColor : AppColors.grey60,
|
||||||
|
size: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.0.h()),
|
||||||
|
Text(
|
||||||
|
'Reject',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: rejected ? AppColors.errorColor : AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 32.0.w()),
|
||||||
|
//submit button
|
||||||
|
GestureDetector(
|
||||||
|
onTap: onSubmit,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 32.0.w(),
|
||||||
|
height: 32.0.w(),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
border: Border.all(
|
||||||
|
color:
|
||||||
|
submitted ? AppColors.successColor : AppColors.grey60,
|
||||||
|
width: 1.5.w(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
AssetsManager.tick,
|
||||||
|
colorFilter: ColorFilter.mode(
|
||||||
|
submitted ? AppColors.successColor : AppColors.grey60,
|
||||||
|
BlendMode.srcATop,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.0.h()),
|
||||||
|
Text(
|
||||||
|
'Submit',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: submitted ? AppColors.successColor : AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 32.0.w()),
|
||||||
// Like button
|
// Like button
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: onLike,
|
onTap: onLike,
|
||||||
child: SvgPicture.asset(
|
child: Column(
|
||||||
width: 32.0.w(),
|
children: [
|
||||||
height: 32.0.w(),
|
SvgPicture.asset(
|
||||||
fit: BoxFit.cover,
|
width: 32.0.w(),
|
||||||
AssetsManager.like,
|
height: 32.0.w(),
|
||||||
colorFilter: ColorFilter.mode(
|
fit: BoxFit.cover,
|
||||||
isLiked ? AppColors.successColor : AppColors.grey50,
|
AssetsManager.like,
|
||||||
BlendMode.srcATop,
|
colorFilter: ColorFilter.mode(
|
||||||
),
|
isLiked ? AppColors.successColor : AppColors.grey50,
|
||||||
|
BlendMode.srcATop,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.0.h()),
|
||||||
|
Text(
|
||||||
|
'Like',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: isLiked ? AppColors.successColor : AppColors.grey50,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -22,7 +22,10 @@ class TenderCard extends StatelessWidget {
|
|||||||
final VoidCallback? onClose;
|
final VoidCallback? onClose;
|
||||||
final bool isLiked;
|
final bool isLiked;
|
||||||
final bool isDisliked;
|
final bool isDisliked;
|
||||||
|
final VoidCallback? onReject;
|
||||||
|
final VoidCallback? onSubmit;
|
||||||
|
final bool rejected;
|
||||||
|
final bool submitted;
|
||||||
const TenderCard({
|
const TenderCard({
|
||||||
required this.date,
|
required this.date,
|
||||||
required this.deadline,
|
required this.deadline,
|
||||||
@@ -38,6 +41,10 @@ class TenderCard extends StatelessWidget {
|
|||||||
this.onClose,
|
this.onClose,
|
||||||
this.isLiked = false,
|
this.isLiked = false,
|
||||||
this.isDisliked = false,
|
this.isDisliked = false,
|
||||||
|
this.onReject,
|
||||||
|
this.onSubmit,
|
||||||
|
this.rejected = false,
|
||||||
|
this.submitted = false,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -46,7 +53,9 @@ class TenderCard extends StatelessWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 364.0.w(),
|
// width: 364.0.w(),
|
||||||
|
width: double.infinity,
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 16.0.w()),
|
||||||
height: 587.0.h(),
|
height: 587.0.h(),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColors.grey0,
|
color: AppColors.grey0,
|
||||||
@@ -255,6 +264,10 @@ class TenderCard extends StatelessWidget {
|
|||||||
onDislike: onDislike,
|
onDislike: onDislike,
|
||||||
onLike: onLike,
|
onLike: onLike,
|
||||||
onClose: onClose,
|
onClose: onClose,
|
||||||
|
onReject: onReject,
|
||||||
|
onSubmit: onSubmit,
|
||||||
|
rejected: rejected,
|
||||||
|
submitted: submitted,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user