added notification some design and added item to navbar

This commit is contained in:
llsajjad
2025-09-13 08:03:54 +03:30
parent 91a2f11393
commit ffa964f7e5
17 changed files with 561 additions and 38 deletions
+2 -1
View File
@@ -128,7 +128,8 @@ class TabletHomePage extends StatelessWidget {
width: double.infinity,
height: 148,
onTap: () {
YourTendersRouteData().push(context);
//YourTendersRouteData().push(context);
NotificationRouteData().push(context);
},
),
),
@@ -1,10 +1,205 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:tm_app/core/constants/assets.dart';
import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/core/utils/size_config.dart';
import 'package:tm_app/views/notification/strings/notification_strings.dart';
import 'package:tm_app/views/shared/desktop_navigation_widget.dart';
class DesktopNotificationPage extends StatelessWidget {
import '../../shared/main_tab_bar.dart';
import '../widgets/notification_all_tab.dart';
import '../widgets/notification_important_tab.dart';
import '../widgets/notification_unread_tab.dart';
class DesktopNotificationPage extends StatefulWidget {
const DesktopNotificationPage({super.key});
@override
State<DesktopNotificationPage> createState() =>
_DesktopNotificationPageState();
}
class _DesktopNotificationPageState extends State<DesktopNotificationPage>
with SingleTickerProviderStateMixin {
late TabController controller;
@override
void initState() {
super.initState();
controller = TabController(length: 3, vsync: this);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return const Scaffold();
return Scaffold(
backgroundColor: AppColors.backgroundColor,
body: Column(
children: [
DesktopNavigationWidget(currentIndex: 3),
SizedBox(height: 60.0.h()),
Expanded(
child: Center(
child: SizedBox(
width: 740,
child: Column(
children: [
MainTabBar(
controller: controller,
titles: [
NotificationStrings.all,
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: () {},
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()),
Expanded(
child: TabBarView(
controller: controller,
children: const [
NotificationAllTab(),
NotificationUnreadTab(),
NotificationImportantTab(),
],
),
),
SizedBox(height: 10.0.h()),
Row(
children: [
const Spacer(),
Text(
'page',
style: TextStyle(
fontSize: 13.0.sp(),
fontWeight: FontWeight.w300,
color: AppColors.grey60,
),
),
SizedBox(width: 10.0.w()),
InkWell(
onTap: () async {
final _ = await showDialog<int>(
context: context,
builder: (context) {
return AlertDialog(
title: const Text('selectPage'),
content: SizedBox(
width: 200,
height: 300,
child: ListView.builder(
itemCount: 1,
itemBuilder: (context, index) {
final pageNumber = index + 1;
return ListTile(
title: Text(
'{LikedTendersStrings.page} $pageNumber',
),
onTap:
() => Navigator.pop(
context,
pageNumber,
),
);
},
),
),
);
},
);
},
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(
'currentPage',
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.grey70,
),
),
SizedBox(width: 5.0.w()),
SvgPicture.asset(AssetsManager.arrowdownSmall),
SizedBox(width: 5.0.w()),
],
),
),
),
SizedBox(width: 5.0.w()),
Text(
'of',
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
),
SizedBox(width: 5.0.w()),
Text(
'totalPages',
style: TextStyle(
fontSize: 13.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
),
],
),
SizedBox(height: 30.0.h()),
],
),
),
),
),
],
),
);
}
}
@@ -1,10 +1,196 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:tm_app/core/constants/assets.dart';
import 'package:tm_app/core/theme/colors.dart';
import 'package:tm_app/core/utils/size_config.dart';
import 'package:tm_app/views/notification/strings/notification_strings.dart';
import 'package:tm_app/views/shared/tablet_navigation_widget.dart';
import 'package:tm_app/views/shared/tender_app_bar.dart';
class TabletNotificationPage extends StatelessWidget {
import '../../shared/main_tab_bar.dart';
import '../widgets/notification_all_tab.dart';
import '../widgets/notification_important_tab.dart';
import '../widgets/notification_unread_tab.dart';
class TabletNotificationPage extends StatefulWidget {
const TabletNotificationPage({super.key});
@override
State<TabletNotificationPage> createState() => _TabletNotificationPageState();
}
class _TabletNotificationPageState extends State<TabletNotificationPage>
with SingleTickerProviderStateMixin {
late TabController controller;
@override
void initState() {
super.initState();
controller = TabController(length: 3, vsync: this);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return const Scaffold();
final GlobalKey<ScaffoldState> key = GlobalKey();
return Scaffold(
key: key,
backgroundColor: AppColors.backgroundColor,
appBar: tabletAppBar(
title: NotificationStrings.notificationTitle,
key: key,
),
drawer: TabletNavigationWidget(currentIndex: 3),
body: Center(
child: SizedBox(
width: 720,
child: Column(
children: [
MainTabBar(
controller: controller,
titles: [
NotificationStrings.all,
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: () {},
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()),
Expanded(
child: TabBarView(
controller: controller,
children: [
NotificationAllTab(),
NotificationUnreadTab(),
NotificationImportantTab(),
],
),
),
SizedBox(height: 10.0.h()),
Row(
children: [
const Spacer(),
Text(
'page',
style: TextStyle(
fontSize: 13.0.sp(),
fontWeight: FontWeight.w300,
color: AppColors.grey60,
),
),
SizedBox(width: 10.0.w()),
InkWell(
onTap: () async {
final _ = await showDialog<int>(
context: context,
builder: (context) {
return AlertDialog(
title: const Text('selectPage'),
content: SizedBox(
width: 200,
height: 300,
child: ListView.builder(
itemCount: 1,
itemBuilder: (context, index) {
final pageNumber = index + 1;
return ListTile(
title: Text(
'{LikedTendersStrings.page} $pageNumber',
),
onTap:
() =>
Navigator.pop(context, pageNumber),
);
},
),
),
);
},
);
},
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(
'currentPage',
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w500,
color: AppColors.grey70,
),
),
SizedBox(width: 5.0.w()),
SvgPicture.asset(AssetsManager.arrowdownSmall),
SizedBox(width: 5.0.w()),
],
),
),
),
SizedBox(width: 5.0.w()),
Text(
'of',
style: TextStyle(
fontSize: 14.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
),
SizedBox(width: 5.0.w()),
Text(
'totalPages',
style: TextStyle(
fontSize: 13.0.sp(),
fontWeight: FontWeight.w400,
color: AppColors.grey60,
),
),
],
),
SizedBox(height: 30.0.h()),
],
),
),
),
);
}
}
@@ -18,16 +18,34 @@ class NotificationCard extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 24.0.w()),
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 16.0.h()),
decoration: BoxDecoration(
color: AppColors.mainBlue.withValues(alpha: 0.03),
color:
notification.title == 'Tender Submitted'
? AppColors.orange10
: notification.title == 'New Tender Invitation'
? AppColors.mainBlue.withValues(alpha: 0.03)
: AppColors.green0,
borderRadius: BorderRadius.circular(4),
border: Border.all(color: AppColors.mainBlue.withValues(alpha: 0.15)),
border: Border.all(
color:
notification.title == 'Tender Submitted'
? AppColors.warningColor
: notification.title == 'New Tender Invitation'
? AppColors.mainBlue.withValues(alpha: 0.15)
: AppColors.green20,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
SvgPicture.asset(AssetsManager.notification),
SvgPicture.asset(
notification.title == 'Tender Submitted'
? AssetsManager.danger
: notification.title == 'New Tender Invitation'
? AssetsManager.notification
: AssetsManager.tickCircle,
),
SizedBox(width: 8.0.w()),
Text(
notification.title,
+1 -1
View File
@@ -70,7 +70,7 @@ class _TabletProfilePageState extends State<TabletProfilePage> {
backgroundColor: AppColors.backgroundColor,
appBar: tabletAppBar(title: ProfileStrings.profileTitle, key: key),
drawer: TabletNavigationWidget(currentIndex: 2),
drawer: TabletNavigationWidget(currentIndex: 4),
body: Padding(
padding: EdgeInsets.symmetric(
horizontal: 24.0.w(),
@@ -11,4 +11,6 @@ class ProfileStrings {
static const String businessType = 'Business Type';
static const String founded = 'Founded';
static const String logout = 'Logout';
static const String contracts = 'Contracts';
static const String notifications = 'Notifications';
}
@@ -64,6 +64,41 @@ class DesktopNavigationWidget extends StatelessWidget {
activeIconPath: AssetsManager.tendersActive,
),
SizedBox(width: 24),
_navigationItem(
context: context,
text: TendersStrings.contracts,
isActive: currentIndex == 2,
onTap: () {
if (currentIndex == 2) {
return;
} else {
// Router.neglect(context, () => TendersRouteData().go(context));
// context.read<TendersViewModel>().getTenders();
}
},
iconPath: AssetsManager.contracts,
activeIconPath: AssetsManager.contracts,
),
SizedBox(width: 24),
_navigationItem(
context: context,
text: TendersStrings.notifications,
isActive: currentIndex == 3,
onTap: () {
if (currentIndex == 3) {
return;
} else {
Router.neglect(
context,
() => NotificationRouteData().go(context),
);
//context.read<notificationViewModel>().getTenders();
}
},
iconPath: AssetsManager.notify,
activeIconPath: AssetsManager.notifyActive,
),
SizedBox(width: 24),
_navigationItem(
context: context,
text: ProfileStrings.profileTitle,
@@ -96,7 +131,7 @@ class DesktopNavigationWidget extends StatelessWidget {
return InkWell(
onTap: onTap,
child: SizedBox(
width: 100.0,
width: 115.0,
height: 64,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
+31 -1
View File
@@ -59,11 +59,41 @@ class TabletNavigationWidget extends StatelessWidget {
),
_navigationItem(
context: context,
text: ProfileStrings.profileTitle,
text: ProfileStrings.contracts,
isActive: currentIndex == 2,
onTap: () {
if (currentIndex == 2) {
return;
} else {
// context.pop();
// Router.neglect(context, () => ProfileRouteData().go(context));
}
},
iconPath: AssetsManager.contracts,
activeIconPath: AssetsManager.contracts,
),
_navigationItem(
context: context,
text: ProfileStrings.notifications,
isActive: currentIndex == 3,
onTap: () {
if (currentIndex == 3) {
return;
} else {
context.pop();
Router.neglect(context, () => NotificationRouteData().go(context));
}
},
iconPath: AssetsManager.notify,
activeIconPath: AssetsManager.notifyActive,
),
_navigationItem(
context: context,
text: ProfileStrings.profileTitle,
isActive: currentIndex == 4,
onTap: () {
if (currentIndex == 4) {
return;
} else {
context.pop();
Router.neglect(context, () => ProfileRouteData().go(context));
@@ -8,4 +8,6 @@ class TendersStrings {
static const String dislike = 'Dislike';
static const String like = 'Like';
static const String tenderDeadlineLabel = 'Deadline';
static const String contracts = 'Contracts';
static const String notifications = 'Notifications';
}