some changes
This commit is contained in:
@@ -92,10 +92,7 @@ class MobileShellPage extends StatelessWidget {
|
|||||||
width: 64.0.w(),
|
width: 64.0.w(),
|
||||||
height: 72.0.h(),
|
height: 72.0.h(),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding: EdgeInsets.only(top: 12.0.h(), bottom: 14.0.h()),
|
||||||
iconPath != AssetsManager.notify
|
|
||||||
? EdgeInsets.only(top: 12.0.h(), bottom: 14.0.h())
|
|
||||||
: EdgeInsets.only(top: 6.0.h(), bottom: 12.0.h()),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -75,55 +75,50 @@ class _TenderDetailMobilePageState extends State<TenderDetailMobilePage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Directionality(
|
return Scaffold(
|
||||||
textDirection: TextDirection.rtl,
|
backgroundColor: AppColors.backgroundColor,
|
||||||
child: Scaffold(
|
appBar: appBar(
|
||||||
backgroundColor: AppColors.backgroundColor,
|
context: context,
|
||||||
appBar: appBar(
|
title: TenderDetailsStrings.tenderDetailTitle,
|
||||||
context: context,
|
),
|
||||||
title: TenderDetailsStrings.tenderDetailTitle,
|
body: Consumer<TenderDetailViewModel>(
|
||||||
),
|
builder: (context, tenderViewModel, child) {
|
||||||
body: Consumer<TenderDetailViewModel>(
|
if (tenderViewModel.isLoading) {
|
||||||
builder: (context, tenderViewModel, child) {
|
return const Center(
|
||||||
if (tenderViewModel.isLoading) {
|
child: CircularProgressIndicator(color: AppColors.secondary50),
|
||||||
return const Center(
|
);
|
||||||
child: CircularProgressIndicator(color: AppColors.secondary50),
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tenderViewModel.errorMessage != null) {
|
if (tenderViewModel.errorMessage != null) {
|
||||||
return Center(child: Text(tenderViewModel.errorMessage!));
|
return Center(child: Text(tenderViewModel.errorMessage!));
|
||||||
}
|
}
|
||||||
|
|
||||||
final detail = tenderViewModel.tenderDetail;
|
final detail = tenderViewModel.tenderDetail;
|
||||||
if (detail == null) {
|
if (detail == null) {
|
||||||
return const Center(
|
return const Center(child: Text(TenderDetailsStrings.tenderNoData));
|
||||||
child: Text(TenderDetailsStrings.tenderNoData),
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 16.0.w(),
|
horizontal: 16.0.w(),
|
||||||
vertical: 16.0.h(),
|
vertical: 16.0.h(),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
TenderDetailHeader(isScreenBig: false, detail: detail),
|
TenderDetailHeader(isScreenBig: false, detail: detail),
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
TenderDetailCard(detail: detail),
|
TenderDetailCard(detail: detail),
|
||||||
SizedBox(height: 24.0.h()),
|
SizedBox(height: 24.0.h()),
|
||||||
TenderDetailActions(isScreenBig: false, detail: detail),
|
TenderDetailActions(isScreenBig: false, detail: detail),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
),
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ 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,72 +19,96 @@ class NotificationCard extends StatelessWidget {
|
|||||||
margin: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
margin: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: AppColors.primary10Light,
|
||||||
notification.type == NotificationStrings.reject
|
|
||||||
? AppColors.orange10
|
|
||||||
: notification.type == NotificationStrings.info
|
|
||||||
? AppColors.primary10Light
|
|
||||||
: AppColors.green0,
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(color: AppColors.primary20),
|
||||||
color:
|
|
||||||
notification.type! == NotificationStrings.reject
|
|
||||||
? AppColors.warningColor
|
|
||||||
: notification.type == NotificationStrings.info ? AppColors.primary20 : AppColors.green20,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 3.0.h()),
|
padding: EdgeInsets.only(top: 3.0.h()),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(AssetsManager.notification),
|
||||||
notification.type! == NotificationStrings.info
|
|
||||||
? AssetsManager.notification
|
|
||||||
: notification.type! == NotificationStrings.reject
|
|
||||||
? AssetsManager.danger
|
|
||||||
: AssetsManager.tickCircle,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 5.0.w()),
|
SizedBox(width: 5.0.w()),
|
||||||
Column(
|
Expanded(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Text(
|
children: [
|
||||||
notification.title!,
|
Row(
|
||||||
style: TextStyle(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
fontSize: 16.0.sp(),
|
children: [
|
||||||
fontWeight: FontWeight.w600,
|
Text(
|
||||||
color: AppColors.grey80,
|
notification.title!,
|
||||||
),
|
style: TextStyle(
|
||||||
),
|
fontSize: 16.0.sp(),
|
||||||
SizedBox(height: 8.0.h()),
|
fontWeight: FontWeight.w600,
|
||||||
Text(
|
color: AppColors.grey80,
|
||||||
notification.message!,
|
),
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 8.0.h()),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
SvgPicture.asset(AssetsManager.calendar),
|
|
||||||
SizedBox(width: 4.0.w()),
|
|
||||||
Text(
|
|
||||||
viewModel.timeAgo(notification.createdAt!),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12.0.sp(),
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: AppColors.grey60,
|
|
||||||
),
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Visibility(
|
||||||
|
visible: notification.priority == 'important',
|
||||||
|
child: Container(
|
||||||
|
width: 86.0.w(),
|
||||||
|
height: 24.0.h(),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColors.blue0,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
'Important',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0.sp(),
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.cyanTeal,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: !notification.seen! ? 8.0.w() : 0),
|
||||||
|
!notification.seen!
|
||||||
|
? Container(
|
||||||
|
width: 12.0.w(),
|
||||||
|
height: 12.0.w(),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: AppColors.mainBlue,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.0.h()),
|
||||||
|
Text(
|
||||||
|
notification.message!,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey70,
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
SizedBox(height: 8.0.h()),
|
||||||
],
|
Row(
|
||||||
|
children: [
|
||||||
|
SvgPicture.asset(AssetsManager.calendar),
|
||||||
|
SizedBox(width: 4.0.w()),
|
||||||
|
Text(
|
||||||
|
viewModel.timeAgo(notification.createdAt!),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0.sp(),
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: AppColors.grey60,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -47,8 +47,10 @@ class _MobileTendersPageState extends State<MobileTendersPage> {
|
|||||||
child: Consumer<TendersViewModel>(
|
child: Consumer<TendersViewModel>(
|
||||||
builder: (context, viewModel, child) {
|
builder: (context, viewModel, child) {
|
||||||
if (viewModel.isLoading) {
|
if (viewModel.isLoading) {
|
||||||
return const Center(
|
return const Expanded(
|
||||||
child: CircularProgressIndicator(color: AppColors.jellyBean),
|
child: Center(
|
||||||
|
child: CircularProgressIndicator(color: AppColors.jellyBean),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (viewModel.errorMessage != null) {
|
if (viewModel.errorMessage != null) {
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class TenderCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
timeConvertor(tender.tenderDeadline ?? 0),
|
timeConvertor(tender.submissionDeadline ?? 0),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.grey80,
|
color: AppColors.grey80,
|
||||||
fontSize: 14.0.sp(),
|
fontSize: 14.0.sp(),
|
||||||
|
|||||||
Reference in New Issue
Block a user