Merge pull request 'safearea' (#160) from safearea into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/160
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:tm_app/core/utils/app_toast.dart';
|
|||||||
import 'package:tm_app/core/utils/result.dart';
|
import 'package:tm_app/core/utils/result.dart';
|
||||||
import 'package:tm_app/data/repositories/notification_repository.dart';
|
import 'package:tm_app/data/repositories/notification_repository.dart';
|
||||||
import 'package:tm_app/data/services/model/notification__response/notification_response_model.dart';
|
import 'package:tm_app/data/services/model/notification__response/notification_response_model.dart';
|
||||||
|
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||||
|
|
||||||
class NotificationViewModel with ChangeNotifier {
|
class NotificationViewModel with ChangeNotifier {
|
||||||
final NotificationsRepository _repository;
|
final NotificationsRepository _repository;
|
||||||
@@ -38,9 +39,16 @@ class NotificationViewModel with ChangeNotifier {
|
|||||||
_unreadNotificationResponse;
|
_unreadNotificationResponse;
|
||||||
bool get isUnreadLoading => _isUnreadLoading;
|
bool get isUnreadLoading => _isUnreadLoading;
|
||||||
|
|
||||||
|
bool _isMoreLoading = false;
|
||||||
|
bool get isMoreLoading => _isMoreLoading;
|
||||||
|
|
||||||
/// Fetch notifications
|
/// Fetch notifications
|
||||||
Future<void> getNotifications({int page = 1, bool isMobile = false}) async {
|
Future<void> getNotifications({int page = 1, bool isMobile = false}) async {
|
||||||
_isLoading = true;
|
if (isMobile && page > 1) {
|
||||||
|
_isMoreLoading = true; // 👈 لودینگ فقط برای پیج بعدی
|
||||||
|
} else {
|
||||||
|
_isLoading = true; // 👈 لودینگ عادی (اولین بار یا رفرش)
|
||||||
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
||||||
final int offset = _pageSize * page;
|
final int offset = _pageSize * page;
|
||||||
@@ -79,6 +87,7 @@ class NotificationViewModel with ChangeNotifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
|
_isMoreLoading = false;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,11 +107,17 @@ class NotificationViewModel with ChangeNotifier {
|
|||||||
|
|
||||||
final result = await _repository.markAllAsRead();
|
final result = await _repository.markAllAsRead();
|
||||||
|
|
||||||
|
if (!context.mounted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case Ok<Map<String, dynamic>>():
|
case Ok<Map<String, dynamic>>():
|
||||||
final response = result.value;
|
final response = result.value;
|
||||||
final success = response['success'] as bool? ?? false;
|
final success = response['success'] as bool? ?? false;
|
||||||
final message = response['message'] as String? ?? 'Unknown response';
|
final message =
|
||||||
|
response['message'] as String? ??
|
||||||
|
NotificationStrings.unknownResponse;
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
if (_notificationResponseModel?.data?.notifications != null) {
|
if (_notificationResponseModel?.data?.notifications != null) {
|
||||||
@@ -118,21 +133,28 @@ class NotificationViewModel with ChangeNotifier {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await getNotifications(page: currentPage, );
|
await getNotifications(page: currentPage);
|
||||||
await getUnreadNotifications();
|
await getUnreadNotifications();
|
||||||
|
|
||||||
|
if (context.mounted) {
|
||||||
// toast success
|
AppToast.success(
|
||||||
AppToast.success(context, 'All notifications marked as read.');
|
context,
|
||||||
|
NotificationStrings.allNotificationMarkedAsRead,
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_errorMessage = message;
|
_errorMessage = message;
|
||||||
AppToast.error(context, message);
|
if (context.mounted) {
|
||||||
|
AppToast.error(context, message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Error<Map<String, dynamic>>():
|
case Error<Map<String, dynamic>>():
|
||||||
_errorMessage = result.error.toString();
|
_errorMessage = result.error.toString();
|
||||||
AppToast.error(context, _errorMessage!);
|
if (context.mounted) {
|
||||||
|
AppToast.error(context, _errorMessage!);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,15 +168,15 @@ class NotificationViewModel with ChangeNotifier {
|
|||||||
final difference = now.difference(createdAt);
|
final difference = now.difference(createdAt);
|
||||||
|
|
||||||
if (difference.inMinutes < 1) {
|
if (difference.inMinutes < 1) {
|
||||||
return 'Now';
|
return NotificationStrings.now;
|
||||||
} else if (difference.inMinutes < 60) {
|
} else if (difference.inMinutes < 60) {
|
||||||
return '${difference.inMinutes} Min ';
|
return '${difference.inMinutes} ${NotificationStrings.min} ';
|
||||||
} else if (difference.inHours < 24) {
|
} else if (difference.inHours < 24) {
|
||||||
return '${difference.inHours} Hour ';
|
return '${difference.inHours} ${NotificationStrings.hour} ';
|
||||||
} else if (difference.inDays == 1) {
|
} else if (difference.inDays == 1) {
|
||||||
return 'Yesterday';
|
return NotificationStrings.yesterday;
|
||||||
} else {
|
} else {
|
||||||
return '${difference.inDays} days ago';
|
return '${difference.inDays} ${NotificationStrings.daysAgo}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,215 +18,217 @@ class CompletionOfDocumentsMobilePage extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
title: CompletionOfDocumentsStrings.completionOfDocuments,
|
title: CompletionOfDocumentsStrings.completionOfDocuments,
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SafeArea(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 12.0.h()),
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 12.0.h()),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Container(
|
children: [
|
||||||
width: double.infinity,
|
Container(
|
||||||
height: 24.0.h(),
|
width: double.infinity,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
height: 24.0.h(),
|
||||||
decoration: BoxDecoration(
|
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||||
color: AppColors.primary20,
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(4),
|
color: AppColors.primary20,
|
||||||
),
|
borderRadius: BorderRadius.circular(4),
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
CompletionOfDocumentsStrings.submissionDeadline,
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.textBlue,
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'2025-06-15',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.grey80,
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 12.0.h()),
|
|
||||||
Container(
|
|
||||||
height: 58.0.h(),
|
|
||||||
width: double.infinity,
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 12.0.w(),
|
|
||||||
vertical: 8.0.h(),
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(color: AppColors.orange10),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
color: AppColors.orange0,
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Match with your profile',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12.0.sp(),
|
|
||||||
color: AppColors.grey80,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
Text(
|
|
||||||
'75%',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12.0.sp(),
|
|
||||||
color: AppColors.cyanTeal,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 4.0.h()),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: LinearProgressIndicator(
|
|
||||||
value: 0.75,
|
|
||||||
backgroundColor: const Color(0xFFE0E0E0),
|
|
||||||
color: AppColors.cyanTeal,
|
|
||||||
minHeight: 6,
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 16.0.h()),
|
|
||||||
_docCard(
|
|
||||||
title: 'Company Registration Certificate',
|
|
||||||
subtitle: 'Legal document proving business registration',
|
|
||||||
status: 'Completed',
|
|
||||||
statusColor: AppColors.green30,
|
|
||||||
statusBackgroundColor: AppColors.green10,
|
|
||||||
backgroundColor: AppColors.primary10,
|
|
||||||
borderSideColor: AppColors.primary20,
|
|
||||||
),
|
|
||||||
_docCard(
|
|
||||||
title: 'Tax Compliance Certificate',
|
|
||||||
subtitle: 'Proof of tax registration and compliance',
|
|
||||||
status: 'Completed',
|
|
||||||
statusColor: AppColors.green30,
|
|
||||||
statusBackgroundColor: AppColors.green10,
|
|
||||||
backgroundColor: AppColors.primary10,
|
|
||||||
borderSideColor: AppColors.primary30,
|
|
||||||
),
|
|
||||||
_docCard(
|
|
||||||
title: 'Technical Proposal',
|
|
||||||
subtitle: 'Detailed technical solution for the tender',
|
|
||||||
status: 'Incomplete',
|
|
||||||
statusColor: AppColors.red20,
|
|
||||||
statusBackgroundColor: AppColors.red10,
|
|
||||||
backgroundColor: AppColors.red0,
|
|
||||||
tag: 'Self apply',
|
|
||||||
tagColor: AppColors.green30,
|
|
||||||
borderSideColor: AppColors.red10,
|
|
||||||
tagBackgroundColor: AppColors.green20,
|
|
||||||
),
|
|
||||||
_docCard(
|
|
||||||
title: 'Financial Proposal',
|
|
||||||
subtitle: 'Detailed cost breakdown and pricing',
|
|
||||||
status: 'Incomplete',
|
|
||||||
statusColor: AppColors.red20,
|
|
||||||
statusBackgroundColor: AppColors.red10,
|
|
||||||
backgroundColor: AppColors.red0,
|
|
||||||
tag: 'Partnership',
|
|
||||||
tagColor: AppColors.purple,
|
|
||||||
borderSideColor: AppColors.red10,
|
|
||||||
tagBackgroundColor: AppColors.purpleLight,
|
|
||||||
),
|
|
||||||
_docCard(
|
|
||||||
title: 'Financial Proposal',
|
|
||||||
subtitle: 'Detailed cost breakdown and pricing',
|
|
||||||
status: 'Incomplete',
|
|
||||||
statusColor: AppColors.red20,
|
|
||||||
statusBackgroundColor: AppColors.red10,
|
|
||||||
backgroundColor: AppColors.red0,
|
|
||||||
borderSideColor: AppColors.red10,
|
|
||||||
),
|
|
||||||
SizedBox(height: 16.0.h()),
|
|
||||||
|
|
||||||
Text(
|
|
||||||
CompletionOfDocumentsStrings.setDeadline,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16.0.sp(),
|
|
||||||
color: AppColors.grey80,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 8.0.h()),
|
|
||||||
Container(
|
|
||||||
height: 48.0.h(),
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.0.w()),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(color: AppColors.grey40),
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'2025/04/10',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16.0.sp(),
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SvgPicture.asset(
|
|
||||||
AssetsManager.calendar,
|
|
||||||
height: 24.0.h(),
|
|
||||||
width: 24.0.w(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 16.0.h()),
|
|
||||||
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(12),
|
|
||||||
height: 100.0.h(),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(color: AppColors.borderColor),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
color: AppColors.grey0,
|
|
||||||
),
|
|
||||||
child: TextField(
|
|
||||||
maxLines: null,
|
|
||||||
decoration: const InputDecoration.collapsed(
|
|
||||||
hintText: CompletionOfDocumentsStrings.note,
|
|
||||||
),
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
CompletionOfDocumentsStrings.submissionDeadline,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.textBlue,
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'2025-06-15',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.grey80,
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12.0.h()),
|
||||||
|
Container(
|
||||||
|
height: 58.0.h(),
|
||||||
|
width: double.infinity,
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 12.0.w(),
|
||||||
|
vertical: 8.0.h(),
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: AppColors.orange10),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
color: AppColors.orange0,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Match with your profile',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0.sp(),
|
||||||
|
color: AppColors.grey80,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Text(
|
||||||
|
'75%',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0.sp(),
|
||||||
|
color: AppColors.cyanTeal,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 4.0.h()),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: LinearProgressIndicator(
|
||||||
|
value: 0.75,
|
||||||
|
backgroundColor: const Color(0xFFE0E0E0),
|
||||||
|
color: AppColors.cyanTeal,
|
||||||
|
minHeight: 6,
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.0.h()),
|
||||||
|
_docCard(
|
||||||
|
title: 'Company Registration Certificate',
|
||||||
|
subtitle: 'Legal document proving business registration',
|
||||||
|
status: 'Completed',
|
||||||
|
statusColor: AppColors.green30,
|
||||||
|
statusBackgroundColor: AppColors.green10,
|
||||||
|
backgroundColor: AppColors.primary10,
|
||||||
|
borderSideColor: AppColors.primary20,
|
||||||
|
),
|
||||||
|
_docCard(
|
||||||
|
title: 'Tax Compliance Certificate',
|
||||||
|
subtitle: 'Proof of tax registration and compliance',
|
||||||
|
status: 'Completed',
|
||||||
|
statusColor: AppColors.green30,
|
||||||
|
statusBackgroundColor: AppColors.green10,
|
||||||
|
backgroundColor: AppColors.primary10,
|
||||||
|
borderSideColor: AppColors.primary30,
|
||||||
|
),
|
||||||
|
_docCard(
|
||||||
|
title: 'Technical Proposal',
|
||||||
|
subtitle: 'Detailed technical solution for the tender',
|
||||||
|
status: 'Incomplete',
|
||||||
|
statusColor: AppColors.red20,
|
||||||
|
statusBackgroundColor: AppColors.red10,
|
||||||
|
backgroundColor: AppColors.red0,
|
||||||
|
tag: 'Self apply',
|
||||||
|
tagColor: AppColors.green30,
|
||||||
|
borderSideColor: AppColors.red10,
|
||||||
|
tagBackgroundColor: AppColors.green20,
|
||||||
|
),
|
||||||
|
_docCard(
|
||||||
|
title: 'Financial Proposal',
|
||||||
|
subtitle: 'Detailed cost breakdown and pricing',
|
||||||
|
status: 'Incomplete',
|
||||||
|
statusColor: AppColors.red20,
|
||||||
|
statusBackgroundColor: AppColors.red10,
|
||||||
|
backgroundColor: AppColors.red0,
|
||||||
|
tag: 'Partnership',
|
||||||
|
tagColor: AppColors.purple,
|
||||||
|
borderSideColor: AppColors.red10,
|
||||||
|
tagBackgroundColor: AppColors.purpleLight,
|
||||||
|
),
|
||||||
|
_docCard(
|
||||||
|
title: 'Financial Proposal',
|
||||||
|
subtitle: 'Detailed cost breakdown and pricing',
|
||||||
|
status: 'Incomplete',
|
||||||
|
statusColor: AppColors.red20,
|
||||||
|
statusBackgroundColor: AppColors.red10,
|
||||||
|
backgroundColor: AppColors.red0,
|
||||||
|
borderSideColor: AppColors.red10,
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.0.h()),
|
||||||
|
|
||||||
|
Text(
|
||||||
|
CompletionOfDocumentsStrings.setDeadline,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16.0.sp(),
|
fontSize: 16.0.sp(),
|
||||||
color: AppColors.grey60,
|
color: AppColors.grey80,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 8.0.h()),
|
||||||
SizedBox(height: 24.0.h()),
|
Container(
|
||||||
BaseButton(
|
height: 48.0.h(),
|
||||||
isEnabled: true,
|
padding: EdgeInsets.symmetric(horizontal: 12.0.w()),
|
||||||
onPressed: () {},
|
decoration: BoxDecoration(
|
||||||
text: CompletionOfDocumentsStrings.submitForCompletion,
|
border: Border.all(color: AppColors.grey40),
|
||||||
textColor: AppColors.textBlue,
|
borderRadius: BorderRadius.circular(12),
|
||||||
backgroundColor: AppColors.primary30,
|
),
|
||||||
),
|
child: Row(
|
||||||
],
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'2025/04/10',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SvgPicture.asset(
|
||||||
|
AssetsManager.calendar,
|
||||||
|
height: 24.0.h(),
|
||||||
|
width: 24.0.w(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.0.h()),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
height: 100.0.h(),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: AppColors.borderColor),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
color: AppColors.grey0,
|
||||||
|
),
|
||||||
|
child: TextField(
|
||||||
|
maxLines: null,
|
||||||
|
decoration: const InputDecoration.collapsed(
|
||||||
|
hintText: CompletionOfDocumentsStrings.note,
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0.sp(),
|
||||||
|
color: AppColors.grey60,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 24.0.h()),
|
||||||
|
BaseButton(
|
||||||
|
isEnabled: true,
|
||||||
|
onPressed: () {},
|
||||||
|
text: CompletionOfDocumentsStrings.submitForCompletion,
|
||||||
|
textColor: AppColors.textBlue,
|
||||||
|
backgroundColor: AppColors.primary30,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -96,44 +96,46 @@ class _TenderDetailDesktopPageState extends State<TenderDetailDesktopPage> {
|
|||||||
return const Center(child: Text(TenderDetailsStrings.tenderNoData));
|
return const Center(child: Text(TenderDetailsStrings.tenderNoData));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Column(
|
return SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
const DesktopNavigationWidget(
|
children: [
|
||||||
currentIndex: 1, // Home index
|
const DesktopNavigationWidget(
|
||||||
),
|
currentIndex: 1, // Home index
|
||||||
Expanded(
|
),
|
||||||
child: SingleChildScrollView(
|
Expanded(
|
||||||
child: Center(
|
child: SingleChildScrollView(
|
||||||
child: SizedBox(
|
child: Center(
|
||||||
width: 740,
|
child: SizedBox(
|
||||||
child: Padding(
|
width: 740,
|
||||||
padding: const EdgeInsets.all(32.0),
|
child: Padding(
|
||||||
child: Column(
|
padding: const EdgeInsets.all(32.0),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
const TabletDesktopAppbar(
|
children: [
|
||||||
title: TenderDetailsStrings.tenderDetailTitle,
|
const TabletDesktopAppbar(
|
||||||
),
|
title: TenderDetailsStrings.tenderDetailTitle,
|
||||||
SizedBox(height: 32.0.h()),
|
),
|
||||||
TenderDetailHeader(
|
SizedBox(height: 32.0.h()),
|
||||||
isScreenBig: true,
|
TenderDetailHeader(
|
||||||
detail: detail,
|
isScreenBig: true,
|
||||||
),
|
detail: detail,
|
||||||
SizedBox(height: 32.0.h()),
|
),
|
||||||
TenderDetailCard(detail: detail),
|
SizedBox(height: 32.0.h()),
|
||||||
SizedBox(height: 24.0.h()),
|
TenderDetailCard(detail: detail),
|
||||||
TenderDetailActions(
|
SizedBox(height: 24.0.h()),
|
||||||
isScreenBig: true,
|
TenderDetailActions(
|
||||||
detail: detail,
|
isScreenBig: true,
|
||||||
),
|
detail: detail,
|
||||||
],
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -102,21 +102,23 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SafeArea(
|
||||||
child: Padding(
|
child: SingleChildScrollView(
|
||||||
padding: EdgeInsets.symmetric(
|
child: Padding(
|
||||||
horizontal: 16.0.w(),
|
padding: EdgeInsets.symmetric(
|
||||||
vertical: 16.0.h(),
|
horizontal: 16.0.w(),
|
||||||
),
|
vertical: 16.0.h(),
|
||||||
child: Column(
|
),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
TenderDetailHeader(isScreenBig: false, detail: detail),
|
children: [
|
||||||
SizedBox(height: 24.0.h()),
|
TenderDetailHeader(isScreenBig: false, detail: detail),
|
||||||
TenderDetailCard(detail: detail),
|
SizedBox(height: 24.0.h()),
|
||||||
SizedBox(height: 24.0.h()),
|
TenderDetailCard(detail: detail),
|
||||||
TenderDetailActions(isScreenBig: false, detail: detail),
|
SizedBox(height: 24.0.h()),
|
||||||
],
|
TenderDetailActions(isScreenBig: false, detail: detail),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -104,26 +104,28 @@ class _TenderDetailTabletPageState extends State<TenderDetailTabletPage> {
|
|||||||
if (detail == null) {
|
if (detail == null) {
|
||||||
return const Center(child: Text(TenderDetailsStrings.tenderNoData));
|
return const Center(child: Text(TenderDetailsStrings.tenderNoData));
|
||||||
}
|
}
|
||||||
return SingleChildScrollView(
|
return SafeArea(
|
||||||
child: Center(
|
child: SingleChildScrollView(
|
||||||
child: SizedBox(
|
child: Center(
|
||||||
width: 768,
|
child: SizedBox(
|
||||||
|
width: 768,
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(24.0),
|
child: Padding(
|
||||||
child: Column(
|
padding: const EdgeInsets.all(24.0),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
const TabletDesktopAppbar(
|
children: [
|
||||||
title: TenderDetailsStrings.tenderDetailTitle,
|
const TabletDesktopAppbar(
|
||||||
),
|
title: TenderDetailsStrings.tenderDetailTitle,
|
||||||
SizedBox(height: 28.0.h()),
|
),
|
||||||
TenderDetailHeader(isScreenBig: true, detail: detail),
|
SizedBox(height: 28.0.h()),
|
||||||
SizedBox(height: 28.0.h()),
|
TenderDetailHeader(isScreenBig: true, detail: detail),
|
||||||
TenderDetailCard(detail: detail),
|
SizedBox(height: 28.0.h()),
|
||||||
SizedBox(height: 24.0.h()),
|
TenderDetailCard(detail: detail),
|
||||||
TenderDetailActions(isScreenBig: true, detail: detail),
|
SizedBox(height: 24.0.h()),
|
||||||
],
|
TenderDetailActions(isScreenBig: true, detail: detail),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
+48
-46
@@ -23,55 +23,57 @@ class FinalCompletionOfDocumentsScreen extends StatelessWidget {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Consumer<FinalCompletionOfDocumentsViewModel>(
|
body: Consumer<FinalCompletionOfDocumentsViewModel>(
|
||||||
builder:
|
builder:
|
||||||
(context, viewModel, child) => Column(
|
(context, viewModel, child) => SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
const DesktopNavigationWidget(currentIndex: 1),
|
children: [
|
||||||
const SizedBox(height: 64.0),
|
const DesktopNavigationWidget(currentIndex: 1),
|
||||||
Expanded(
|
const SizedBox(height: 64.0),
|
||||||
child: SizedBox(
|
Expanded(
|
||||||
width: 740,
|
child: SizedBox(
|
||||||
child: SingleChildScrollView(
|
width: 740,
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
children: [
|
child: Column(
|
||||||
const TabletDesktopAppbar(
|
children: [
|
||||||
title:
|
const TabletDesktopAppbar(
|
||||||
FinalCompletionOfDocumentsStrings
|
title:
|
||||||
.completionOfDocuments,
|
FinalCompletionOfDocumentsStrings
|
||||||
),
|
.completionOfDocuments,
|
||||||
SizedBox(height: 32.0.h()),
|
),
|
||||||
|
SizedBox(height: 32.0.h()),
|
||||||
const SizedBox(height: 32.0),
|
|
||||||
const CommentBox(),
|
const SizedBox(height: 32.0),
|
||||||
const SizedBox(height: 32.0),
|
const CommentBox(),
|
||||||
FormCard(viewModel: viewModel),
|
const SizedBox(height: 32.0),
|
||||||
const SizedBox(height: 40.0),
|
FormCard(viewModel: viewModel),
|
||||||
Row(
|
const SizedBox(height: 40.0),
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
BaseButton(
|
children: [
|
||||||
isEnabled: true,
|
BaseButton(
|
||||||
onPressed: () {},
|
isEnabled: true,
|
||||||
width: 176,
|
onPressed: () {},
|
||||||
backgroundColor: AppColors.primary10,
|
width: 176,
|
||||||
textColor: AppColors.mainBlue,
|
backgroundColor: AppColors.primary10,
|
||||||
text: FinalCompletionOfDocumentsStrings.back,
|
textColor: AppColors.mainBlue,
|
||||||
),
|
text: FinalCompletionOfDocumentsStrings.back,
|
||||||
const SizedBox(width: 16.0),
|
),
|
||||||
BaseButton(
|
const SizedBox(width: 16.0),
|
||||||
isEnabled: true,
|
BaseButton(
|
||||||
onPressed: () {},
|
isEnabled: true,
|
||||||
width: 176,
|
onPressed: () {},
|
||||||
text: FinalCompletionOfDocumentsStrings.next,
|
width: 176,
|
||||||
),
|
text: FinalCompletionOfDocumentsStrings.next,
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
const SizedBox(height: 35.0),
|
),
|
||||||
],
|
const SizedBox(height: 35.0),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -39,26 +39,28 @@ class DesktopHomePage extends StatelessWidget {
|
|||||||
if (homeViewModel.tenderApprovalsStateResponse != null &&
|
if (homeViewModel.tenderApprovalsStateResponse != null &&
|
||||||
homeViewModel.data != null &&
|
homeViewModel.data != null &&
|
||||||
homeViewModel.feedbackStats != null) {
|
homeViewModel.feedbackStats != null) {
|
||||||
return SingleChildScrollView(
|
return SafeArea(
|
||||||
child: SizedBox(
|
child: SingleChildScrollView(
|
||||||
width: 780,
|
child: SizedBox(
|
||||||
child: Column(
|
width: 780,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
const SizedBox(height: 55),
|
children: [
|
||||||
// SizedBox(width: 780, child: NotificationCard()),
|
const SizedBox(height: 55),
|
||||||
const SizedBox(height: 40.0),
|
// SizedBox(width: 780, child: NotificationCard()),
|
||||||
_progressBarsRow(homeViewModel),
|
const SizedBox(height: 40.0),
|
||||||
SizedBox(height: 32.0.h()),
|
_progressBarsRow(homeViewModel),
|
||||||
Padding(
|
SizedBox(height: 32.0.h()),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 15.0.w()),
|
Padding(
|
||||||
child: _firstTenderCardsRow(context, homeViewModel),
|
padding: EdgeInsets.symmetric(horizontal: 15.0.w()),
|
||||||
),
|
child: _firstTenderCardsRow(context, homeViewModel),
|
||||||
SizedBox(height: 32.0.h()),
|
),
|
||||||
_yourTenderText(homeViewModel),
|
SizedBox(height: 32.0.h()),
|
||||||
SizedBox(height: 8.0.h()),
|
_yourTenderText(homeViewModel),
|
||||||
_bottomListView(homeViewModel),
|
SizedBox(height: 8.0.h()),
|
||||||
],
|
_bottomListView(homeViewModel),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,25 +33,27 @@ class MobileHomePage extends StatelessWidget {
|
|||||||
if (homeViewModel.tenderApprovalsStateResponse != null &&
|
if (homeViewModel.tenderApprovalsStateResponse != null &&
|
||||||
homeViewModel.data != null &&
|
homeViewModel.data != null &&
|
||||||
homeViewModel.feedbackStats != null) {
|
homeViewModel.feedbackStats != null) {
|
||||||
return SingleChildScrollView(
|
return SafeArea(
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// SizedBox(height: 18.0.h()),
|
children: [
|
||||||
// NotificationCard(),
|
// SizedBox(height: 18.0.h()),
|
||||||
SizedBox(height: 32.0.h()),
|
// NotificationCard(),
|
||||||
_progressBarsRow(homeViewModel),
|
SizedBox(height: 32.0.h()),
|
||||||
SizedBox(height: 32.0.h()),
|
_progressBarsRow(homeViewModel),
|
||||||
_firstTenderCardsRow(
|
SizedBox(height: 32.0.h()),
|
||||||
context,
|
_firstTenderCardsRow(
|
||||||
homeViewModel.tenderApprovalsStateResponse!,
|
context,
|
||||||
),
|
homeViewModel.tenderApprovalsStateResponse!,
|
||||||
SizedBox(height: 8.0.h()),
|
),
|
||||||
_secondTenderCardsRow(homeViewModel, context),
|
SizedBox(height: 8.0.h()),
|
||||||
SizedBox(height: 40.0.h()),
|
_secondTenderCardsRow(homeViewModel, context),
|
||||||
_yourTenderText(homeViewModel),
|
SizedBox(height: 40.0.h()),
|
||||||
_bottomListView(homeViewModel),
|
_yourTenderText(homeViewModel),
|
||||||
],
|
_bottomListView(homeViewModel),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,24 +50,26 @@ class TabletHomePage extends StatelessWidget {
|
|||||||
24.0.w(),
|
24.0.w(),
|
||||||
24.0.h(),
|
24.0.h(),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: SafeArea(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// NotificationCard(),
|
children: [
|
||||||
SizedBox(height: 40.0.h()),
|
// NotificationCard(),
|
||||||
_progressBarsRow(homeViewModel),
|
SizedBox(height: 40.0.h()),
|
||||||
SizedBox(height: 32.0.h()),
|
_progressBarsRow(homeViewModel),
|
||||||
_firstTenderCardsRow(
|
SizedBox(height: 32.0.h()),
|
||||||
context,
|
_firstTenderCardsRow(
|
||||||
homeViewModel.tenderApprovalsStateResponse!,
|
context,
|
||||||
),
|
homeViewModel.tenderApprovalsStateResponse!,
|
||||||
SizedBox(height: 8.0.h()),
|
),
|
||||||
_secondTenderCardsRow(homeViewModel, context),
|
SizedBox(height: 8.0.h()),
|
||||||
SizedBox(height: 32.0.h()),
|
_secondTenderCardsRow(homeViewModel, context),
|
||||||
_yourTenderText(homeViewModel),
|
SizedBox(height: 32.0.h()),
|
||||||
SizedBox(height: 8.0.h()),
|
_yourTenderText(homeViewModel),
|
||||||
_bottomListView(homeViewModel),
|
SizedBox(height: 8.0.h()),
|
||||||
],
|
_bottomListView(homeViewModel),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -59,71 +59,73 @@ class _LikedTendersDesktopPageState extends State<LikedTendersDesktopPage> {
|
|||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
endDrawer: const LikeFiltersDrawer(),
|
endDrawer: const LikeFiltersDrawer(),
|
||||||
body: Column(
|
body: SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
const DesktopNavigationWidget(currentIndex: 1, haveFilter: true),
|
children: [
|
||||||
const SizedBox(height: 40),
|
const DesktopNavigationWidget(currentIndex: 1, haveFilter: true),
|
||||||
SizedBox(
|
const SizedBox(height: 40),
|
||||||
width: 740,
|
SizedBox(
|
||||||
child: TabletDesktopAppbar(
|
|
||||||
title: LikedTendersStrings.likedTenders,
|
|
||||||
haveFilter: true,
|
|
||||||
onFilterPressed: () {
|
|
||||||
scaffoldKey.currentState?.openEndDrawer();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 24),
|
|
||||||
Expanded(
|
|
||||||
child: SizedBox(
|
|
||||||
width: 740,
|
width: 740,
|
||||||
child: Consumer<LikedTendersViewModel>(
|
child: TabletDesktopAppbar(
|
||||||
builder: (context, viewModel, child) {
|
title: LikedTendersStrings.likedTenders,
|
||||||
if (viewModel.isLoading &&
|
haveFilter: true,
|
||||||
(viewModel.data?.data?.feedback ?? []).isEmpty) {
|
onFilterPressed: () {
|
||||||
return const Center(
|
scaffoldKey.currentState?.openEndDrawer();
|
||||||
child: CircularProgressIndicator(
|
|
||||||
color: AppColors.secondary50,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (viewModel.errorMessage != null) {
|
|
||||||
return Center(child: Text(viewModel.errorMessage!));
|
|
||||||
}
|
|
||||||
|
|
||||||
final feedback = viewModel.data?.data?.feedback ?? [];
|
|
||||||
|
|
||||||
if (feedback.isEmpty) {
|
|
||||||
return const Center(
|
|
||||||
child: Text(LikedTendersStrings.noLikedTenders),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
final currentPage = viewModel.currentPage;
|
|
||||||
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
_likedTendersList(feedback, viewModel),
|
|
||||||
|
|
||||||
SizedBox(height: 10.0.h()),
|
|
||||||
|
|
||||||
_likedTenersListPageControll(
|
|
||||||
context,
|
|
||||||
totalPages,
|
|
||||||
viewModel,
|
|
||||||
currentPage,
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 30.0.h()),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 24),
|
||||||
],
|
Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 740,
|
||||||
|
child: Consumer<LikedTendersViewModel>(
|
||||||
|
builder: (context, viewModel, child) {
|
||||||
|
if (viewModel.isLoading &&
|
||||||
|
(viewModel.data?.data?.feedback ?? []).isEmpty) {
|
||||||
|
return const Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: AppColors.secondary50,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewModel.errorMessage != null) {
|
||||||
|
return Center(child: Text(viewModel.errorMessage!));
|
||||||
|
}
|
||||||
|
|
||||||
|
final feedback = viewModel.data?.data?.feedback ?? [];
|
||||||
|
|
||||||
|
if (feedback.isEmpty) {
|
||||||
|
return const Center(
|
||||||
|
child: Text(LikedTendersStrings.noLikedTenders),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final currentPage = viewModel.currentPage;
|
||||||
|
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
_likedTendersList(feedback, viewModel),
|
||||||
|
|
||||||
|
SizedBox(height: 10.0.h()),
|
||||||
|
|
||||||
|
_likedTenersListPageControll(
|
||||||
|
context,
|
||||||
|
totalPages,
|
||||||
|
viewModel,
|
||||||
|
currentPage,
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(height: 30.0.h()),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -156,91 +156,93 @@ class _LikedTendersMobilePageState extends State<LikedTendersMobilePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
body: Column(
|
body: SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
Expanded(
|
children: [
|
||||||
child: Consumer<LikedTendersViewModel>(
|
Expanded(
|
||||||
builder: (context, viewModel, child) {
|
child: Consumer<LikedTendersViewModel>(
|
||||||
if (viewModel.isLoading &&
|
builder: (context, viewModel, child) {
|
||||||
(viewModel.data?.data?.feedback ?? []).isEmpty) {
|
if (viewModel.isLoading &&
|
||||||
return const Center(
|
(viewModel.data?.data?.feedback ?? []).isEmpty) {
|
||||||
child: CircularProgressIndicator(
|
return const Center(
|
||||||
color: AppColors.secondary50,
|
child: CircularProgressIndicator(
|
||||||
|
color: AppColors.secondary50,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewModel.errorMessage != null) {
|
||||||
|
return Center(child: Text(viewModel.errorMessage!));
|
||||||
|
}
|
||||||
|
|
||||||
|
final feedback = viewModel.data?.data?.feedback ?? [];
|
||||||
|
|
||||||
|
if (feedback.isEmpty) {
|
||||||
|
return const Center(
|
||||||
|
child: Text(LikedTendersStrings.noLikedTenders),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final itemCount =
|
||||||
|
feedback.length + (viewModel.isLoadingMore ? 1 : 0);
|
||||||
|
|
||||||
|
return ListView.builder(
|
||||||
|
controller: _scrollController,
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 24.0.w(),
|
||||||
|
vertical: 15.0.h(),
|
||||||
),
|
),
|
||||||
);
|
itemCount: itemCount,
|
||||||
}
|
itemBuilder: (context, index) {
|
||||||
|
if (index < feedback.length) {
|
||||||
if (viewModel.errorMessage != null) {
|
final item = feedback[index];
|
||||||
return Center(child: Text(viewModel.errorMessage!));
|
|
||||||
}
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 20.0.h()),
|
||||||
final feedback = viewModel.data?.data?.feedback ?? [];
|
child: Dismissible(
|
||||||
|
key: ValueKey(item.tenderId ?? index),
|
||||||
if (feedback.isEmpty) {
|
direction: DismissDirection.endToStart,
|
||||||
return const Center(
|
background: Container(
|
||||||
child: Text(LikedTendersStrings.noLikedTenders),
|
alignment: Alignment.centerRight,
|
||||||
);
|
padding: EdgeInsets.symmetric(
|
||||||
}
|
horizontal: 20.0.w(),
|
||||||
|
),
|
||||||
final itemCount =
|
child: SvgPicture.asset(
|
||||||
feedback.length + (viewModel.isLoadingMore ? 1 : 0);
|
AssetsManager.trash,
|
||||||
|
width: 32.0.w(),
|
||||||
return ListView.builder(
|
height: 32.0.h(),
|
||||||
controller: _scrollController,
|
),
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 24.0.w(),
|
|
||||||
vertical: 15.0.h(),
|
|
||||||
),
|
|
||||||
itemCount: itemCount,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
if (index < feedback.length) {
|
|
||||||
final item = feedback[index];
|
|
||||||
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 20.0.h()),
|
|
||||||
child: Dismissible(
|
|
||||||
key: ValueKey(item.tenderId ?? index),
|
|
||||||
direction: DismissDirection.endToStart,
|
|
||||||
background: Container(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 20.0.w(),
|
|
||||||
),
|
),
|
||||||
child: SvgPicture.asset(
|
onDismissed: (_) {
|
||||||
AssetsManager.trash,
|
if (item.tenderId != null) {
|
||||||
width: 32.0.w(),
|
viewModel.removeTenderById(item.tenderId!);
|
||||||
height: 32.0.h(),
|
}
|
||||||
|
},
|
||||||
|
child: LikedListItem(tender: item.tender!),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
|
||||||
|
child: Center(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 24.0.w(),
|
||||||
|
height: 24.0.h(),
|
||||||
|
child: const CircularProgressIndicator(
|
||||||
|
color: AppColors.secondary50,
|
||||||
|
strokeWidth: 2,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onDismissed: (_) {
|
);
|
||||||
if (item.tenderId != null) {
|
}
|
||||||
viewModel.removeTenderById(item.tenderId!);
|
},
|
||||||
}
|
);
|
||||||
},
|
},
|
||||||
child: LikedListItem(tender: item.tender!),
|
),
|
||||||
),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
|
|
||||||
child: Center(
|
|
||||||
child: SizedBox(
|
|
||||||
width: 24.0.w(),
|
|
||||||
height: 24.0.h(),
|
|
||||||
child: const CircularProgressIndicator(
|
|
||||||
color: AppColors.secondary50,
|
|
||||||
strokeWidth: 2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -63,79 +63,81 @@ class _LikedTendersTabletPageState extends State<LikedTendersTabletPage> {
|
|||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
appBar: tabletAppBar(title: LikedTendersStrings.likedTenders, key: key),
|
appBar: tabletAppBar(title: LikedTendersStrings.likedTenders, key: key),
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 1),
|
drawer: const TabletNavigationWidget(currentIndex: 1),
|
||||||
body: Center(
|
body: SafeArea(
|
||||||
child: SizedBox(
|
child: Center(
|
||||||
width: 720,
|
child: SizedBox(
|
||||||
child: Column(
|
width: 720,
|
||||||
children: [
|
child: Column(
|
||||||
TabletDesktopAppbar(
|
children: [
|
||||||
title: LikedTendersStrings.likedTenders,
|
TabletDesktopAppbar(
|
||||||
haveFilter: true,
|
title: LikedTendersStrings.likedTenders,
|
||||||
onFilterPressed: () {
|
haveFilter: true,
|
||||||
showModalBottomSheet(
|
onFilterPressed: () {
|
||||||
context: context,
|
showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
context: context,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
isScrollControlled: true,
|
||||||
shape: const RoundedRectangleBorder(
|
backgroundColor: AppColors.backgroundColor,
|
||||||
borderRadius: BorderRadius.vertical(
|
shape: const RoundedRectangleBorder(
|
||||||
top: Radius.circular(20),
|
borderRadius: BorderRadius.vertical(
|
||||||
|
top: Radius.circular(20),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
constraints: BoxConstraints(
|
||||||
constraints: BoxConstraints(
|
maxWidth: MediaQuery.sizeOf(context).width,
|
||||||
maxWidth: MediaQuery.sizeOf(context).width,
|
maxHeight: MediaQuery.sizeOf(context).height,
|
||||||
maxHeight: MediaQuery.sizeOf(context).height,
|
),
|
||||||
),
|
builder: (context) => const LikeFiltersBottomSheet(),
|
||||||
builder: (context) => const LikeFiltersBottomSheet(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Consumer<LikedTendersViewModel>(
|
|
||||||
builder: (context, viewModel, child) {
|
|
||||||
if (viewModel.isLoading &&
|
|
||||||
(viewModel.data?.data?.feedback ?? []).isEmpty) {
|
|
||||||
return const Center(
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
color: AppColors.secondary50,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (viewModel.errorMessage != null) {
|
|
||||||
return Center(child: Text(viewModel.errorMessage!));
|
|
||||||
}
|
|
||||||
|
|
||||||
final feedback = viewModel.data?.data?.feedback ?? [];
|
|
||||||
|
|
||||||
if (feedback.isEmpty) {
|
|
||||||
return const Center(
|
|
||||||
child: Text(LikedTendersStrings.noLikedTenders),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
final currentPage = viewModel.currentPage;
|
|
||||||
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
_likedTendersList(feedback, viewModel),
|
|
||||||
|
|
||||||
SizedBox(height: 10.0.h()),
|
|
||||||
|
|
||||||
_likeTendersListPagesControll(
|
|
||||||
context,
|
|
||||||
totalPages,
|
|
||||||
viewModel,
|
|
||||||
currentPage,
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 30.0.h()),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
],
|
child: Consumer<LikedTendersViewModel>(
|
||||||
|
builder: (context, viewModel, child) {
|
||||||
|
if (viewModel.isLoading &&
|
||||||
|
(viewModel.data?.data?.feedback ?? []).isEmpty) {
|
||||||
|
return const Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: AppColors.secondary50,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewModel.errorMessage != null) {
|
||||||
|
return Center(child: Text(viewModel.errorMessage!));
|
||||||
|
}
|
||||||
|
|
||||||
|
final feedback = viewModel.data?.data?.feedback ?? [];
|
||||||
|
|
||||||
|
if (feedback.isEmpty) {
|
||||||
|
return const Center(
|
||||||
|
child: Text(LikedTendersStrings.noLikedTenders),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final currentPage = viewModel.currentPage;
|
||||||
|
final totalPages = viewModel.data?.data?.meta?.pages ?? 1;
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
_likedTendersList(feedback, viewModel),
|
||||||
|
|
||||||
|
SizedBox(height: 10.0.h()),
|
||||||
|
|
||||||
|
_likeTendersListPagesControll(
|
||||||
|
context,
|
||||||
|
totalPages,
|
||||||
|
viewModel,
|
||||||
|
currentPage,
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(height: 30.0.h()),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -40,162 +40,164 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final viewModel = context.watch<NotificationViewModel>();
|
final viewModel = context.watch<NotificationViewModel>();
|
||||||
|
|
||||||
return Scaffold(
|
return SafeArea(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
child: Scaffold(
|
||||||
body: Column(
|
backgroundColor: AppColors.backgroundColor,
|
||||||
children: [
|
body: Column(
|
||||||
const DesktopNavigationWidget(currentIndex: 3),
|
children: [
|
||||||
SizedBox(height: 60.0.h()),
|
const DesktopNavigationWidget(currentIndex: 3),
|
||||||
Expanded(
|
SizedBox(height: 60.0.h()),
|
||||||
child: Center(
|
Expanded(
|
||||||
child: SizedBox(
|
child: Center(
|
||||||
width: 740,
|
child: SizedBox(
|
||||||
child: Column(
|
width: 740,
|
||||||
children: [
|
child: Column(
|
||||||
MainTabBar(
|
children: [
|
||||||
controller: controller,
|
MainTabBar(
|
||||||
titles: [
|
controller: controller,
|
||||||
NotificationStrings.all,
|
titles: [
|
||||||
NotificationStrings.unread,
|
NotificationStrings.all,
|
||||||
NotificationStrings.important,
|
NotificationStrings.unread,
|
||||||
],
|
NotificationStrings.important,
|
||||||
),
|
],
|
||||||
SizedBox(height: 12.0.h()),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsetsDirectional.only(end: 24.0.w()),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
viewModel.markAllAsRead(context);
|
|
||||||
},
|
|
||||||
borderRadius: BorderRadius.circular(99),
|
|
||||||
child: Container(
|
|
||||||
width: 132.0.w(),
|
|
||||||
height: 32.0.h(),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColors.primary20,
|
|
||||||
borderRadius: BorderRadius.circular(99),
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
NotificationStrings.markAllAsReadButton,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color: AppColors.mainBlue,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 12.0.h()),
|
||||||
SizedBox(height: 12.0.h()),
|
Padding(
|
||||||
viewModel.isLoading
|
padding: EdgeInsetsDirectional.only(end: 24.0.w()),
|
||||||
? Container()
|
child: Align(
|
||||||
: Expanded(
|
alignment: Alignment.centerRight,
|
||||||
child: TabBarView(
|
child: InkWell(
|
||||||
controller: controller,
|
onTap: () {
|
||||||
children: const [
|
viewModel.markAllAsRead(context);
|
||||||
NotificationAllTab(),
|
},
|
||||||
NotificationUnreadTab(),
|
borderRadius: BorderRadius.circular(99),
|
||||||
NotificationImportantTab(),
|
child: Container(
|
||||||
],
|
width: 132.0.w(),
|
||||||
),
|
height: 32.0.h(),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
if (viewModel.isLoading) ...[
|
color: AppColors.primary20,
|
||||||
const Spacer(),
|
borderRadius: BorderRadius.circular(99),
|
||||||
const Center(
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
color: AppColors.secondary50,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
],
|
|
||||||
SizedBox(height: 10.0.h()),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
const Spacer(),
|
|
||||||
Text(
|
|
||||||
NotificationStrings.page,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0.sp(),
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 10.0.w()),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
final selectedPage = await showDialog<int>(
|
|
||||||
context: context,
|
|
||||||
builder:
|
|
||||||
(context) => PageSelectionDialog(
|
|
||||||
totalPages: viewModel.totalPages,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedPage != null) {
|
|
||||||
viewModel.jumpToPage(selectedPage);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColors.grey30,
|
|
||||||
width: 1,
|
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: Center(
|
||||||
),
|
child: Text(
|
||||||
child: Row(
|
NotificationStrings.markAllAsReadButton,
|
||||||
children: [
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
Text(
|
|
||||||
viewModel.currentPage.toString(),
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0.sp(),
|
fontSize: 14.0.sp(),
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: AppColors.grey70,
|
color: AppColors.mainBlue,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 5.0.w()),
|
),
|
||||||
Icon(
|
|
||||||
Icons.arrow_drop_down,
|
|
||||||
color: AppColors.grey80,
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.0.w()),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 5.0.w()),
|
),
|
||||||
Text(
|
SizedBox(height: 12.0.h()),
|
||||||
NotificationStrings.of,
|
viewModel.isLoading
|
||||||
style: TextStyle(
|
? Container()
|
||||||
fontSize: 14.0.sp(),
|
: Expanded(
|
||||||
fontWeight: FontWeight.w400,
|
child: TabBarView(
|
||||||
color: AppColors.grey60,
|
controller: controller,
|
||||||
),
|
children: const [
|
||||||
),
|
NotificationAllTab(),
|
||||||
SizedBox(width: 5.0.w()),
|
NotificationUnreadTab(),
|
||||||
Text(
|
NotificationImportantTab(),
|
||||||
viewModel.totalPages.toString(),
|
],
|
||||||
style: TextStyle(
|
),
|
||||||
fontSize: 13.0.sp(),
|
),
|
||||||
fontWeight: FontWeight.w400,
|
if (viewModel.isLoading) ...[
|
||||||
color: AppColors.grey60,
|
const Spacer(),
|
||||||
|
const Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: AppColors.secondary50,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const Spacer(),
|
||||||
],
|
],
|
||||||
),
|
SizedBox(height: 10.0.h()),
|
||||||
SizedBox(height: 30.0.h()),
|
Row(
|
||||||
],
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
Text(
|
||||||
|
NotificationStrings.page,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w300,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.0.w()),
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
final selectedPage = await showDialog<int>(
|
||||||
|
context: context,
|
||||||
|
builder:
|
||||||
|
(context) => PageSelectionDialog(
|
||||||
|
totalPages: viewModel.totalPages,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedPage != null) {
|
||||||
|
viewModel.jumpToPage(selectedPage);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColors.grey30,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
viewModel.currentPage.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Icon(
|
||||||
|
Icons.arrow_drop_down,
|
||||||
|
color: AppColors.grey80,
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
NotificationStrings.of,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.0.w()),
|
||||||
|
Text(
|
||||||
|
viewModel.totalPages.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 30.0.h()),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,17 @@ class _MobileNotificationPageState extends State<MobileNotificationPage>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (viewModel.isLoading) ...[
|
if (viewModel.isMoreLoading) ...[
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 16),
|
||||||
|
child: Center(
|
||||||
|
child: CircularProgressIndicator(color: AppColors.secondary50),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
if (viewModel.isLoading &&
|
||||||
|
(viewModel.notificationResponse?.data?.notifications?.isEmpty ??
|
||||||
|
true)) ...[
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
const Center(
|
const Center(
|
||||||
child: CircularProgressIndicator(color: AppColors.secondary50),
|
child: CircularProgressIndicator(color: AppColors.secondary50),
|
||||||
|
|||||||
@@ -11,5 +11,14 @@ class NotificationStrings {
|
|||||||
static const String currentPage = 'currentPage';
|
static const String currentPage = 'currentPage';
|
||||||
static const String of = 'of';
|
static const String of = 'of';
|
||||||
static const String totalPages = 'totalPages';
|
static const String totalPages = 'totalPages';
|
||||||
|
static const String allNotificationMarkedAsRead = 'All notifications marked as read.';
|
||||||
|
static const String unknownResponse = 'Unknown response';
|
||||||
|
static const String now = 'Now';
|
||||||
|
static const String min = 'Min';
|
||||||
|
static const String hour = 'Hour';
|
||||||
|
static const String yesterday = 'Yesterday';
|
||||||
|
static const String daysAgo = 'days ago';
|
||||||
|
static const String reject = 'reject';
|
||||||
|
static const String info = 'info';
|
||||||
|
static const String noUnreadNotifications = 'No unread notifications';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ 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/notification_data/notification_data.dart';
|
import 'package:tm_app/data/services/model/notification_data/notification_data.dart';
|
||||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||||
|
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||||
|
|
||||||
class NotificationCard extends StatelessWidget {
|
class NotificationCard extends StatelessWidget {
|
||||||
final NotificationItem notification;
|
final NotificationItem notification;
|
||||||
@@ -20,17 +21,17 @@ class NotificationCard extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color:
|
||||||
notification.type == 'reject'
|
notification.type == NotificationStrings.reject
|
||||||
? AppColors.orange10
|
? AppColors.orange10
|
||||||
: notification.type == 'info'
|
: notification.type == NotificationStrings.info
|
||||||
? AppColors.primary10Light
|
? AppColors.primary10Light
|
||||||
: AppColors.green0,
|
: AppColors.green0,
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color:
|
color:
|
||||||
notification.type! == 'reject'
|
notification.type! == NotificationStrings.reject
|
||||||
? AppColors.warningColor
|
? AppColors.warningColor
|
||||||
: notification.type == 'info' ? AppColors.primary20 : AppColors.green20,
|
: notification.type == NotificationStrings.info ? AppColors.primary20 : AppColors.green20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -39,9 +40,9 @@ class NotificationCard extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 3.0.h()),
|
padding: EdgeInsets.only(top: 3.0.h()),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
notification.type! == 'info'
|
notification.type! == NotificationStrings.info
|
||||||
? AssetsManager.notification
|
? AssetsManager.notification
|
||||||
: notification.type! == 'reject'
|
: notification.type! == NotificationStrings.reject
|
||||||
? AssetsManager.danger
|
? AssetsManager.danger
|
||||||
: AssetsManager.tickCircle,
|
: AssetsManager.tickCircle,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:tm_app/core/utils/size_config.dart';
|
import 'package:tm_app/core/utils/size_config.dart';
|
||||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||||
|
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||||
|
|
||||||
import 'notification_card.dart';
|
import 'notification_card.dart';
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ class NotificationUnreadTab extends StatelessWidget {
|
|||||||
viewModel.unreadNotificationResponse?.data?.notifications ?? [];
|
viewModel.unreadNotificationResponse?.data?.notifications ?? [];
|
||||||
|
|
||||||
if (notifications.isEmpty) {
|
if (notifications.isEmpty) {
|
||||||
return const Center(child: Text('No unread notifications'));
|
return const Center(child: Text(NotificationStrings.noUnreadNotifications,));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
|
|||||||
@@ -64,85 +64,87 @@ class _DesktopProfilePageState extends State<DesktopProfilePage> {
|
|||||||
return const Center(child: Text(CommonStrings.noData));
|
return const Center(child: Text(CommonStrings.noData));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Column(
|
return SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
const DesktopNavigationWidget(
|
children: [
|
||||||
currentIndex: 4, // Tenders index
|
const DesktopNavigationWidget(
|
||||||
),
|
currentIndex: 4, // Tenders index
|
||||||
SizedBox(
|
),
|
||||||
width: 740,
|
SizedBox(
|
||||||
child: Column(
|
width: 740,
|
||||||
children: [
|
child: Column(
|
||||||
SizedBox(height: 36.0.h()),
|
children: [
|
||||||
TitleDescription(
|
SizedBox(height: 36.0.h()),
|
||||||
title: ProfileStrings.companyName,
|
TitleDescription(
|
||||||
description: viewModel.companyProfileData!.name!,
|
title: ProfileStrings.companyName,
|
||||||
),
|
description: viewModel.companyProfileData!.name!,
|
||||||
TitleDescription(
|
),
|
||||||
title: ProfileStrings.nationalId,
|
TitleDescription(
|
||||||
description: viewModel.companyProfileData!.id!,
|
title: ProfileStrings.nationalId,
|
||||||
),
|
description: viewModel.companyProfileData!.id!,
|
||||||
TitleDescription(
|
),
|
||||||
title: ProfileStrings.registrationNumber,
|
TitleDescription(
|
||||||
description:
|
title: ProfileStrings.registrationNumber,
|
||||||
viewModel.companyProfileData!.registrationNumber!,
|
description:
|
||||||
),
|
viewModel.companyProfileData!.registrationNumber!,
|
||||||
const TitleDescription(
|
),
|
||||||
title: ProfileStrings.businessType,
|
const TitleDescription(
|
||||||
description: '-',
|
title: ProfileStrings.businessType,
|
||||||
),
|
description: '-',
|
||||||
TitleDescription(
|
),
|
||||||
title: ProfileStrings.founded,
|
TitleDescription(
|
||||||
description:
|
title: ProfileStrings.founded,
|
||||||
viewModel.companyProfileData!.foundedYear!.toString(),
|
description:
|
||||||
),
|
viewModel.companyProfileData!.foundedYear!.toString(),
|
||||||
SizedBox(height: 24.0.h()),
|
),
|
||||||
// Theme Toggle
|
SizedBox(height: 24.0.h()),
|
||||||
Align(
|
// Theme Toggle
|
||||||
alignment: AlignmentDirectional.centerStart,
|
Align(
|
||||||
child: Text(
|
alignment: AlignmentDirectional.centerStart,
|
||||||
ProfileStrings.settings,
|
child: Text(
|
||||||
style: TextStyle(
|
ProfileStrings.settings,
|
||||||
fontSize: 20.0.sp(),
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w600,
|
fontSize: 20.0.sp(),
|
||||||
color: AppColors.grey70,
|
fontWeight: FontWeight.w600,
|
||||||
|
color: AppColors.grey70,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 36.0.h()),
|
||||||
SizedBox(height: 36.0.h()),
|
_themeChangeRow(),
|
||||||
_themeChangeRow(),
|
SizedBox(height: 24.0.h()),
|
||||||
SizedBox(height: 24.0.h()),
|
Divider(color: AppColors.dividerColor, thickness: 1),
|
||||||
Divider(color: AppColors.dividerColor, thickness: 1),
|
SizedBox(height: 24.0.h()),
|
||||||
SizedBox(height: 24.0.h()),
|
// Spacer(),
|
||||||
// Spacer(),
|
Align(
|
||||||
Align(
|
alignment: AlignmentDirectional.centerEnd,
|
||||||
alignment: AlignmentDirectional.centerEnd,
|
child: InkWell(
|
||||||
child: InkWell(
|
onTap: () => viewModel.logout(),
|
||||||
onTap: () => viewModel.logout(),
|
borderRadius: BorderRadius.circular(100),
|
||||||
borderRadius: BorderRadius.circular(100),
|
child: Container(
|
||||||
child: Container(
|
width: 156,
|
||||||
width: 156,
|
height: 56.0.h(),
|
||||||
height: 56.0.h(),
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
color: AppColors.primary20,
|
||||||
color: AppColors.primary20,
|
borderRadius: BorderRadius.circular(100),
|
||||||
borderRadius: BorderRadius.circular(100),
|
),
|
||||||
),
|
alignment: Alignment.center,
|
||||||
alignment: Alignment.center,
|
child: Text(
|
||||||
child: Text(
|
ProfileStrings.logout,
|
||||||
ProfileStrings.logout,
|
style: TextStyle(
|
||||||
style: TextStyle(
|
fontSize: 14.0.sp(),
|
||||||
fontSize: 14.0.sp(),
|
fontWeight: FontWeight.w500,
|
||||||
fontWeight: FontWeight.w500,
|
color: AppColors.primaryColor,
|
||||||
color: AppColors.primaryColor,
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -66,76 +66,78 @@ class _MobileProfilePageState extends State<MobileProfilePage> {
|
|||||||
return const Center(child: Text(CommonStrings.noData));
|
return const Center(child: Text(CommonStrings.noData));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Padding(
|
return SafeArea(
|
||||||
padding: EdgeInsets.symmetric(
|
child: Padding(
|
||||||
horizontal: 24.0.w(),
|
padding: EdgeInsets.symmetric(
|
||||||
vertical: 16.0.h(),
|
horizontal: 24.0.w(),
|
||||||
),
|
vertical: 16.0.h(),
|
||||||
child: Column(
|
),
|
||||||
children: [
|
child: Column(
|
||||||
SizedBox(height: 36.0.h()),
|
children: [
|
||||||
TitleDescription(
|
SizedBox(height: 36.0.h()),
|
||||||
title: ProfileStrings.companyName,
|
TitleDescription(
|
||||||
description: viewModel.companyProfileData!.name!,
|
title: ProfileStrings.companyName,
|
||||||
),
|
description: viewModel.companyProfileData!.name!,
|
||||||
TitleDescription(
|
|
||||||
title: ProfileStrings.nationalId,
|
|
||||||
description: viewModel.companyProfileData!.id!,
|
|
||||||
),
|
|
||||||
TitleDescription(
|
|
||||||
title: ProfileStrings.registrationNumber,
|
|
||||||
description:
|
|
||||||
viewModel.companyProfileData!.registrationNumber!,
|
|
||||||
),
|
|
||||||
const TitleDescription(
|
|
||||||
title: ProfileStrings.businessType,
|
|
||||||
description: '-',
|
|
||||||
),
|
|
||||||
TitleDescription(
|
|
||||||
title: ProfileStrings.founded,
|
|
||||||
description:
|
|
||||||
viewModel.companyProfileData!.foundedYear!.toString(),
|
|
||||||
),
|
|
||||||
SizedBox(height: 32.0.h()),
|
|
||||||
Align(
|
|
||||||
alignment: AlignmentDirectional.centerStart,
|
|
||||||
child: Text(
|
|
||||||
ProfileStrings.settings,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20.0.sp(),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
TitleDescription(
|
||||||
SizedBox(height: 36.0.h()),
|
title: ProfileStrings.nationalId,
|
||||||
_themeChangeRow(),
|
description: viewModel.companyProfileData!.id!,
|
||||||
SizedBox(height: 24.0.h()),
|
),
|
||||||
Divider(color: AppColors.dividerColor, thickness: 1),
|
TitleDescription(
|
||||||
SizedBox(height: 24.0.h()),
|
title: ProfileStrings.registrationNumber,
|
||||||
const Spacer(),
|
description:
|
||||||
InkWell(
|
viewModel.companyProfileData!.registrationNumber!,
|
||||||
onTap: () => viewModel.logout(),
|
),
|
||||||
borderRadius: BorderRadius.circular(100),
|
const TitleDescription(
|
||||||
child: Container(
|
title: ProfileStrings.businessType,
|
||||||
width: double.infinity,
|
description: '-',
|
||||||
height: 56.0.h(),
|
),
|
||||||
decoration: BoxDecoration(
|
TitleDescription(
|
||||||
color: AppColors.primary20,
|
title: ProfileStrings.founded,
|
||||||
borderRadius: BorderRadius.circular(100),
|
description:
|
||||||
),
|
viewModel.companyProfileData!.foundedYear!.toString(),
|
||||||
alignment: Alignment.center,
|
),
|
||||||
|
SizedBox(height: 32.0.h()),
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.centerStart,
|
||||||
child: Text(
|
child: Text(
|
||||||
ProfileStrings.logout,
|
ProfileStrings.settings,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0.sp(),
|
fontSize: 20.0.sp(),
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
color: AppColors.primaryColor,
|
color: AppColors.grey70,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 36.0.h()),
|
||||||
],
|
_themeChangeRow(),
|
||||||
|
SizedBox(height: 24.0.h()),
|
||||||
|
Divider(color: AppColors.dividerColor, thickness: 1),
|
||||||
|
SizedBox(height: 24.0.h()),
|
||||||
|
const Spacer(),
|
||||||
|
InkWell(
|
||||||
|
onTap: () => viewModel.logout(),
|
||||||
|
borderRadius: BorderRadius.circular(100),
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 56.0.h(),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColors.primary20,
|
||||||
|
borderRadius: BorderRadius.circular(100),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
ProfileStrings.logout,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -64,14 +64,14 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
|
|||||||
return const Center(child: Text(CommonStrings.noData));
|
return const Center(child: Text(CommonStrings.noData));
|
||||||
}
|
}
|
||||||
|
|
||||||
return SafeArea(
|
return Scaffold(
|
||||||
child: Scaffold(
|
key: key,
|
||||||
key: key,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
backgroundColor: AppColors.backgroundColor,
|
appBar: tabletAppBar(title: ProfileStrings.profileTitle, key: key),
|
||||||
appBar: tabletAppBar(title: ProfileStrings.profileTitle, key: key),
|
|
||||||
|
drawer: const TabletNavigationWidget(currentIndex: 4),
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 4),
|
body: SafeArea(
|
||||||
body: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 24.0.w(),
|
horizontal: 24.0.w(),
|
||||||
vertical: 16.0.h(),
|
vertical: 16.0.h(),
|
||||||
|
|||||||
@@ -41,10 +41,12 @@ class _DesktopSplashPageState extends State<DesktopSplashPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: SafeArea(
|
||||||
child: Padding(
|
child: Center(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 100),
|
child: Padding(
|
||||||
child: Image.asset(AssetsManager.logoBigPng),
|
padding: const EdgeInsets.symmetric(horizontal: 100),
|
||||||
|
child: Image.asset(AssetsManager.logoBigPng),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -51,10 +51,12 @@ class _MobileSplashPageState extends State<MobileSplashPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: SafeArea(
|
||||||
child: Padding(
|
child: Center(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
child: Padding(
|
||||||
child: Image.asset(AssetsManager.logoBigPng, fit: BoxFit.cover),
|
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||||
|
child: Image.asset(AssetsManager.logoBigPng, fit: BoxFit.cover),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -41,10 +41,12 @@ class _TabletSplashPageState extends State<TabletSplashPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: SafeArea(
|
||||||
child: Padding(
|
child: Center(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
child: Padding(
|
||||||
child: Image.asset(AssetsManager.logoBigPng),
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
|
child: Image.asset(AssetsManager.logoBigPng),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -51,58 +51,60 @@ class _DesktopTendersPageState extends State<DesktopTendersPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
body: Column(
|
body: SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
const DesktopNavigationWidget(currentIndex: 1),
|
children: [
|
||||||
SizedBox(height: 48.0.h()),
|
const DesktopNavigationWidget(currentIndex: 1),
|
||||||
const _SearchBox(),
|
SizedBox(height: 48.0.h()),
|
||||||
const _ActionButtons(),
|
const _SearchBox(),
|
||||||
Expanded(
|
const _ActionButtons(),
|
||||||
child: Consumer<TendersViewModel>(
|
Expanded(
|
||||||
builder: (context, vm, child) {
|
child: Consumer<TendersViewModel>(
|
||||||
if (vm.isLoading) {
|
builder: (context, vm, child) {
|
||||||
return const Center(
|
if (vm.isLoading) {
|
||||||
child: CircularProgressIndicator(
|
return const Center(
|
||||||
color: AppColors.jellyBean,
|
child: CircularProgressIndicator(
|
||||||
),
|
color: AppColors.jellyBean,
|
||||||
);
|
),
|
||||||
}
|
);
|
||||||
if (vm.errorMessage != null) {
|
}
|
||||||
return Center(child: Text(vm.errorMessage!));
|
if (vm.errorMessage != null) {
|
||||||
}
|
return Center(child: Text(vm.errorMessage!));
|
||||||
final tenders = vm.tendersResponse?.data?.tenders ?? [];
|
}
|
||||||
if (tenders.isEmpty) {
|
final tenders = vm.tendersResponse?.data?.tenders ?? [];
|
||||||
return const Center(child: Text(CommonStrings.noData));
|
if (tenders.isEmpty) {
|
||||||
}
|
return const Center(child: Text(CommonStrings.noData));
|
||||||
|
}
|
||||||
return Column(
|
|
||||||
children: [
|
return Column(
|
||||||
Expanded(
|
children: [
|
||||||
child: SingleChildScrollView(
|
Expanded(
|
||||||
child: SizedBox(
|
child: SingleChildScrollView(
|
||||||
width: 740,
|
child: SizedBox(
|
||||||
height: 800,
|
width: 740,
|
||||||
child: Padding(
|
height: 800,
|
||||||
padding: EdgeInsets.symmetric(vertical: 4.0.h()),
|
child: Padding(
|
||||||
child: MainTendersSlider(
|
padding: EdgeInsets.symmetric(vertical: 4.0.h()),
|
||||||
tenders: tenders,
|
child: MainTendersSlider(
|
||||||
isDesktop: true,
|
tenders: tenders,
|
||||||
|
isDesktop: true,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
_DesktopPagination(
|
||||||
_DesktopPagination(
|
totalPages: vm.totalPages,
|
||||||
totalPages: vm.totalPages,
|
currentPage: vm.currentPage,
|
||||||
currentPage: vm.currentPage,
|
onPageSelected: vm.jumpToPage,
|
||||||
onPageSelected: vm.jumpToPage,
|
),
|
||||||
),
|
],
|
||||||
],
|
);
|
||||||
);
|
},
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,10 +60,12 @@ class _MobileTendersPageState extends State<MobileTendersPage> {
|
|||||||
return const Center(child: Text(CommonStrings.noData));
|
return const Center(child: Text(CommonStrings.noData));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Padding(
|
return SafeArea(
|
||||||
padding: EdgeInsets.symmetric(vertical: 18.0.h()),
|
child: Padding(
|
||||||
child: MainTendersSlider(
|
padding: EdgeInsets.symmetric(vertical: 18.0.h()),
|
||||||
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
|
child: MainTendersSlider(
|
||||||
|
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -51,13 +51,15 @@ class _TabletTendersPageState extends State<TabletTendersPage> {
|
|||||||
}
|
}
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Padding(
|
child: SafeArea(
|
||||||
padding: EdgeInsetsDirectional.only(
|
child: Padding(
|
||||||
end: 24.0.w(),
|
padding: EdgeInsetsDirectional.only(
|
||||||
top: 128.0.h(),
|
end: 24.0.w(),
|
||||||
),
|
top: 128.0.h(),
|
||||||
child: MainTendersSlider(
|
),
|
||||||
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
|
child: MainTendersSlider(
|
||||||
|
tenders: viewModel.tendersResponse?.data?.tenders ?? [],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -39,88 +39,90 @@ class _YourTendersDesktopPageState extends State<YourTendersDesktopPage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
body: Column(
|
body: SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
const DesktopNavigationWidget(currentIndex: 1), // Tenders index
|
children: [
|
||||||
Expanded(
|
const DesktopNavigationWidget(currentIndex: 1), // Tenders index
|
||||||
child: SizedBox(
|
Expanded(
|
||||||
width: 740,
|
child: SizedBox(
|
||||||
child: Column(
|
width: 740,
|
||||||
children: [
|
child: Column(
|
||||||
SizedBox(height: 64.0.h()),
|
children: [
|
||||||
const TabletDesktopAppbar(
|
SizedBox(height: 64.0.h()),
|
||||||
title: YourTendersStrings.yourTenders,
|
const TabletDesktopAppbar(
|
||||||
),
|
title: YourTendersStrings.yourTenders,
|
||||||
SizedBox(height: 20.0.h()),
|
|
||||||
const FilterButton(platformType: PlatformType.tabletDesktop),
|
|
||||||
|
|
||||||
Expanded(
|
|
||||||
child: Consumer<YourTendersViewModel>(
|
|
||||||
builder: (context, viewModel, child) {
|
|
||||||
if (viewModel.isLoading &&
|
|
||||||
(viewModel.data == null &&
|
|
||||||
viewModel.likedTendersData == null)) {
|
|
||||||
return const Center(
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
color: AppColors.secondary50,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (viewModel.errorMessage != null) {
|
|
||||||
return Center(child: Text(viewModel.errorMessage!));
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget content;
|
|
||||||
|
|
||||||
if (viewModel.selectedStatus ==
|
|
||||||
YourTendersStrings.likeTenders &&
|
|
||||||
viewModel.likedTendersData != null) {
|
|
||||||
content = LikedDislikedTendersList(
|
|
||||||
data: viewModel.likedTendersData!,
|
|
||||||
status: TenderFeedback.liked.value,
|
|
||||||
isDesktop: true,
|
|
||||||
isMobile: false,
|
|
||||||
);
|
|
||||||
} else if (viewModel.selectedStatus ==
|
|
||||||
YourTendersStrings.dislikeTenders &&
|
|
||||||
viewModel.likedTendersData != null) {
|
|
||||||
content = LikedDislikedTendersList(
|
|
||||||
data: viewModel.likedTendersData!,
|
|
||||||
status: TenderFeedback.disliked.value,
|
|
||||||
isDesktop: true,
|
|
||||||
isMobile: false,
|
|
||||||
);
|
|
||||||
} else if (viewModel.data != null) {
|
|
||||||
content = TendersSubmitted(
|
|
||||||
approvedTenders: viewModel.data!,
|
|
||||||
isDesktop: true,
|
|
||||||
isMobile: false,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
content = const Center(
|
|
||||||
child: Text(YourTendersStrings.noTenders),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
Expanded(child: content),
|
|
||||||
SizedBox(height: 10.0.h()),
|
|
||||||
|
|
||||||
_listPagesControll(context, viewModel),
|
|
||||||
|
|
||||||
SizedBox(height: 30.0.h()),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 20.0.h()),
|
||||||
],
|
const FilterButton(platformType: PlatformType.tabletDesktop),
|
||||||
|
|
||||||
|
Expanded(
|
||||||
|
child: Consumer<YourTendersViewModel>(
|
||||||
|
builder: (context, viewModel, child) {
|
||||||
|
if (viewModel.isLoading &&
|
||||||
|
(viewModel.data == null &&
|
||||||
|
viewModel.likedTendersData == null)) {
|
||||||
|
return const Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: AppColors.secondary50,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewModel.errorMessage != null) {
|
||||||
|
return Center(child: Text(viewModel.errorMessage!));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget content;
|
||||||
|
|
||||||
|
if (viewModel.selectedStatus ==
|
||||||
|
YourTendersStrings.likeTenders &&
|
||||||
|
viewModel.likedTendersData != null) {
|
||||||
|
content = LikedDislikedTendersList(
|
||||||
|
data: viewModel.likedTendersData!,
|
||||||
|
status: TenderFeedback.liked.value,
|
||||||
|
isDesktop: true,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
} else if (viewModel.selectedStatus ==
|
||||||
|
YourTendersStrings.dislikeTenders &&
|
||||||
|
viewModel.likedTendersData != null) {
|
||||||
|
content = LikedDislikedTendersList(
|
||||||
|
data: viewModel.likedTendersData!,
|
||||||
|
status: TenderFeedback.disliked.value,
|
||||||
|
isDesktop: true,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
} else if (viewModel.data != null) {
|
||||||
|
content = TendersSubmitted(
|
||||||
|
approvedTenders: viewModel.data!,
|
||||||
|
isDesktop: true,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
content = const Center(
|
||||||
|
child: Text(YourTendersStrings.noTenders),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Expanded(child: content),
|
||||||
|
SizedBox(height: 10.0.h()),
|
||||||
|
|
||||||
|
_listPagesControll(context, viewModel),
|
||||||
|
|
||||||
|
SizedBox(height: 30.0.h()),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,71 +38,73 @@ class _YourTendersMobilePageState extends State<YourTendersMobilePage> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
appBar: appBar(context: context, title: YourTendersStrings.yourTenders),
|
appBar: appBar(context: context, title: YourTendersStrings.yourTenders),
|
||||||
body: Column(
|
body: SafeArea(
|
||||||
children: [
|
child: Column(
|
||||||
const FilterButton(platformType: PlatformType.mobile),
|
children: [
|
||||||
Expanded(
|
const FilterButton(platformType: PlatformType.mobile),
|
||||||
child: Consumer<YourTendersViewModel>(
|
Expanded(
|
||||||
builder: (context, viewModel, child) {
|
child: Consumer<YourTendersViewModel>(
|
||||||
if (viewModel.isLoading &&
|
builder: (context, viewModel, child) {
|
||||||
(viewModel.data?.data?.tenders ?? []).isEmpty &&
|
if (viewModel.isLoading &&
|
||||||
(viewModel.likedTendersData?.data?.feedback ?? [])
|
(viewModel.data?.data?.tenders ?? []).isEmpty &&
|
||||||
.isEmpty) {
|
(viewModel.likedTendersData?.data?.feedback ?? [])
|
||||||
return const Center(
|
.isEmpty) {
|
||||||
child: CircularProgressIndicator(
|
return const Center(
|
||||||
color: AppColors.secondary50,
|
child: CircularProgressIndicator(
|
||||||
),
|
color: AppColors.secondary50,
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (viewModel.errorMessage != null) {
|
|
||||||
return Center(child: Text(viewModel.errorMessage!));
|
|
||||||
}
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
if (viewModel.selectedStatus ==
|
|
||||||
YourTendersStrings.likeTenders &&
|
|
||||||
viewModel.likedTendersData != null)
|
|
||||||
Expanded(
|
|
||||||
child: LikedDislikedTendersList(
|
|
||||||
data: viewModel.likedTendersData!,
|
|
||||||
status: TenderFeedback.liked.value,
|
|
||||||
isDesktop: false,
|
|
||||||
isMobile: true,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else if (viewModel.selectedStatus ==
|
|
||||||
YourTendersStrings.dislikeTenders &&
|
|
||||||
viewModel.likedTendersData != null)
|
|
||||||
Expanded(
|
|
||||||
child: LikedDislikedTendersList(
|
|
||||||
data: viewModel.likedTendersData!,
|
|
||||||
status: TenderFeedback.disliked.value,
|
|
||||||
isDesktop: false,
|
|
||||||
isMobile: true,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else if (viewModel.data != null)
|
|
||||||
Expanded(
|
|
||||||
child: TendersSubmitted(
|
|
||||||
approvedTenders: viewModel.data!,
|
|
||||||
isDesktop: false,
|
|
||||||
isMobile: true,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else
|
|
||||||
const Expanded(
|
|
||||||
child: Center(
|
|
||||||
child: Text(YourTendersStrings.noTenders),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
);
|
||||||
);
|
}
|
||||||
},
|
|
||||||
|
if (viewModel.errorMessage != null) {
|
||||||
|
return Center(child: Text(viewModel.errorMessage!));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
if (viewModel.selectedStatus ==
|
||||||
|
YourTendersStrings.likeTenders &&
|
||||||
|
viewModel.likedTendersData != null)
|
||||||
|
Expanded(
|
||||||
|
child: LikedDislikedTendersList(
|
||||||
|
data: viewModel.likedTendersData!,
|
||||||
|
status: TenderFeedback.liked.value,
|
||||||
|
isDesktop: false,
|
||||||
|
isMobile: true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else if (viewModel.selectedStatus ==
|
||||||
|
YourTendersStrings.dislikeTenders &&
|
||||||
|
viewModel.likedTendersData != null)
|
||||||
|
Expanded(
|
||||||
|
child: LikedDislikedTendersList(
|
||||||
|
data: viewModel.likedTendersData!,
|
||||||
|
status: TenderFeedback.disliked.value,
|
||||||
|
isDesktop: false,
|
||||||
|
isMobile: true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else if (viewModel.data != null)
|
||||||
|
Expanded(
|
||||||
|
child: TendersSubmitted(
|
||||||
|
approvedTenders: viewModel.data!,
|
||||||
|
isDesktop: false,
|
||||||
|
isMobile: true,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
const Expanded(
|
||||||
|
child: Center(
|
||||||
|
child: Text(YourTendersStrings.noTenders),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,84 +44,86 @@ class _YourTendersTabletPageState extends State<YourTendersTabletPage>
|
|||||||
backgroundColor: AppColors.backgroundColor,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
appBar: tabletAppBar(title: YourTendersStrings.yourTenders, key: key),
|
appBar: tabletAppBar(title: YourTendersStrings.yourTenders, key: key),
|
||||||
drawer: const TabletNavigationWidget(currentIndex: 1),
|
drawer: const TabletNavigationWidget(currentIndex: 1),
|
||||||
body: Center(
|
body: SafeArea(
|
||||||
child: SizedBox(
|
child: Center(
|
||||||
width: 720,
|
child: SizedBox(
|
||||||
child: Column(
|
width: 720,
|
||||||
children: [
|
child: Column(
|
||||||
const SizedBox(height: 64.0),
|
children: [
|
||||||
Padding(
|
const SizedBox(height: 64.0),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
Padding(
|
||||||
child: const TabletDesktopAppbar(
|
padding: EdgeInsets.symmetric(horizontal: 8.0.w()),
|
||||||
title: YourTendersStrings.yourTenders,
|
child: const TabletDesktopAppbar(
|
||||||
|
title: YourTendersStrings.yourTenders,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 24.0.h()),
|
||||||
SizedBox(height: 24.0.h()),
|
const FilterButton(platformType: PlatformType.tabletDesktop),
|
||||||
const FilterButton(platformType: PlatformType.tabletDesktop),
|
|
||||||
|
Expanded(
|
||||||
Expanded(
|
child: Consumer<YourTendersViewModel>(
|
||||||
child: Consumer<YourTendersViewModel>(
|
builder: (context, viewModel, child) {
|
||||||
builder: (context, viewModel, child) {
|
if (viewModel.isLoading &&
|
||||||
if (viewModel.isLoading &&
|
(viewModel.data == null &&
|
||||||
(viewModel.data == null &&
|
viewModel.likedTendersData == null)) {
|
||||||
viewModel.likedTendersData == null)) {
|
return const Center(
|
||||||
return const Center(
|
child: CircularProgressIndicator(
|
||||||
child: CircularProgressIndicator(
|
color: AppColors.secondary50,
|
||||||
color: AppColors.secondary50,
|
),
|
||||||
),
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (viewModel.errorMessage != null) {
|
||||||
|
return Center(child: Text(viewModel.errorMessage!));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget content;
|
||||||
|
|
||||||
|
if (viewModel.selectedStatus ==
|
||||||
|
YourTendersStrings.likeTenders &&
|
||||||
|
viewModel.likedTendersData != null) {
|
||||||
|
content = LikedDislikedTendersList(
|
||||||
|
data: viewModel.likedTendersData!,
|
||||||
|
status: TenderFeedback.liked.value,
|
||||||
|
isDesktop: false,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
} else if (viewModel.selectedStatus ==
|
||||||
|
YourTendersStrings.dislikeTenders &&
|
||||||
|
viewModel.likedTendersData != null) {
|
||||||
|
content = LikedDislikedTendersList(
|
||||||
|
data: viewModel.likedTendersData!,
|
||||||
|
status: TenderFeedback.disliked.value,
|
||||||
|
isDesktop: false,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
} else if (viewModel.data != null) {
|
||||||
|
content = TendersSubmitted(
|
||||||
|
approvedTenders: viewModel.data!,
|
||||||
|
isDesktop: false,
|
||||||
|
isMobile: false,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
content = const Center(
|
||||||
|
child: Text(YourTendersStrings.noTenders),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Expanded(child: content),
|
||||||
|
SizedBox(height: 10.0.h()),
|
||||||
|
|
||||||
|
_listPagesControll(context, viewModel),
|
||||||
|
|
||||||
|
const SizedBox(height: 30.0),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
|
),
|
||||||
if (viewModel.errorMessage != null) {
|
|
||||||
return Center(child: Text(viewModel.errorMessage!));
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget content;
|
|
||||||
|
|
||||||
if (viewModel.selectedStatus ==
|
|
||||||
YourTendersStrings.likeTenders &&
|
|
||||||
viewModel.likedTendersData != null) {
|
|
||||||
content = LikedDislikedTendersList(
|
|
||||||
data: viewModel.likedTendersData!,
|
|
||||||
status: TenderFeedback.liked.value,
|
|
||||||
isDesktop: false,
|
|
||||||
isMobile: false,
|
|
||||||
);
|
|
||||||
} else if (viewModel.selectedStatus ==
|
|
||||||
YourTendersStrings.dislikeTenders &&
|
|
||||||
viewModel.likedTendersData != null) {
|
|
||||||
content = LikedDislikedTendersList(
|
|
||||||
data: viewModel.likedTendersData!,
|
|
||||||
status: TenderFeedback.disliked.value,
|
|
||||||
isDesktop: false,
|
|
||||||
isMobile: false,
|
|
||||||
);
|
|
||||||
} else if (viewModel.data != null) {
|
|
||||||
content = TendersSubmitted(
|
|
||||||
approvedTenders: viewModel.data!,
|
|
||||||
isDesktop: false,
|
|
||||||
isMobile: false,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
content = const Center(
|
|
||||||
child: Text(YourTendersStrings.noTenders),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
Expanded(child: content),
|
|
||||||
SizedBox(height: 10.0.h()),
|
|
||||||
|
|
||||||
_listPagesControll(context, viewModel),
|
|
||||||
|
|
||||||
const SizedBox(height: 30.0),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user