Added notification logic and view api
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:tm_app/core/constants/assets.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||
import 'package:tm_app/views/shared/page_selection_dialog.dart';
|
||||
import 'package:tm_app/views/shared/desktop_navigation_widget.dart';
|
||||
|
||||
import '../../shared/main_tab_bar.dart';
|
||||
import '../widgets/notification_all_tab.dart';
|
||||
import '../widgets/notification_important_tab.dart';
|
||||
import '../widgets/notification_unread_tab.dart';
|
||||
import '../../shared/main_tab_bar.dart';
|
||||
|
||||
class DesktopNotificationPage extends StatefulWidget {
|
||||
const DesktopNotificationPage({super.key});
|
||||
@@ -38,14 +37,14 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewModel = context.watch<NotificationViewModel>();
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
body: Column(
|
||||
children: [
|
||||
const DesktopNavigationWidget(currentIndex: 3),
|
||||
|
||||
SizedBox(height: 60.0.h()),
|
||||
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
@@ -60,15 +59,13 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
||||
NotificationStrings.important,
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 12.0.h()),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(end: 24.0.w()),
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
onTap: viewModel.markAllAsRead,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
child: Container(
|
||||
width: 132.0.w(),
|
||||
@@ -119,14 +116,14 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
||||
onTap: () async {
|
||||
final selectedPage = await showDialog<int>(
|
||||
context: context,
|
||||
builder:
|
||||
(context) =>
|
||||
const PageSelectionDialog(totalPages: 10),
|
||||
builder: (context) => PageSelectionDialog(
|
||||
totalPages: viewModel.totalPages),
|
||||
);
|
||||
|
||||
if (selectedPage != null) {}
|
||||
if (selectedPage != null) {
|
||||
viewModel.jumpToPage(selectedPage);
|
||||
}
|
||||
},
|
||||
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
@@ -139,7 +136,7 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
||||
children: [
|
||||
SizedBox(width: 5.0.w()),
|
||||
Text(
|
||||
NotificationStrings.currentPage,
|
||||
viewModel.currentPage.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -147,12 +144,9 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
||||
),
|
||||
),
|
||||
SizedBox(width: 5.0.w()),
|
||||
SvgPicture.asset(
|
||||
AssetsManager.arrowDownSmall,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColors.grey80,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: AppColors.grey80,
|
||||
),
|
||||
SizedBox(width: 5.0.w()),
|
||||
],
|
||||
@@ -170,7 +164,7 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
||||
),
|
||||
SizedBox(width: 5.0.w()),
|
||||
Text(
|
||||
NotificationStrings.totalPages,
|
||||
viewModel.totalPages.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 13.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
@@ -179,7 +173,6 @@ class _DesktopNotificationPageState extends State<DesktopNotificationPage>
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 30.0.h()),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||
import 'package:tm_app/views/shared/tender_app_bar.dart';
|
||||
|
||||
@@ -19,21 +21,38 @@ class MobileNotificationPage extends StatefulWidget {
|
||||
class _MobileNotificationPageState extends State<MobileNotificationPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late TabController controller;
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
controller = TabController(length: 3, vsync: this);
|
||||
|
||||
_scrollController.addListener(() {
|
||||
final viewModel = context.read<NotificationViewModel>();
|
||||
if (_scrollController.position.pixels >=
|
||||
_scrollController.position.maxScrollExtent - 100 &&
|
||||
!viewModel.isLoading &&
|
||||
viewModel.hasMoreData) {
|
||||
viewModel.getNotifications(
|
||||
page: viewModel.currentPage + 1,
|
||||
isMobile: true,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
_scrollController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewModel = context.watch<NotificationViewModel>(); // ✅ وصل به ویومدل
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
appBar: tenderMobileAppBar(title: NotificationStrings.notificationTitle),
|
||||
@@ -53,7 +72,7 @@ class _MobileNotificationPageState extends State<MobileNotificationPage>
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
onTap: viewModel.markAllAsRead, // ✅ مثل دسکتاپ/تبلت
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
child: Container(
|
||||
width: 132.0.w(),
|
||||
@@ -80,13 +99,18 @@ class _MobileNotificationPageState extends State<MobileNotificationPage>
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
controller: controller,
|
||||
children: const [
|
||||
NotificationAllTab(),
|
||||
NotificationUnreadTab(),
|
||||
NotificationImportantTab(),
|
||||
children: [
|
||||
NotificationAllTab(scrollController: _scrollController),
|
||||
NotificationUnreadTab(scrollController: _scrollController),
|
||||
NotificationImportantTab(scrollController: _scrollController),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (viewModel.isLoading) ...[
|
||||
SizedBox(height: 10.0.h()),
|
||||
const Center(child: CircularProgressIndicator()),
|
||||
SizedBox(height: 10.0.h()),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -19,49 +19,49 @@ class NotificationScreen extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class NotificationModel {
|
||||
final String title;
|
||||
final String description;
|
||||
final String time;
|
||||
final String type;
|
||||
// class NotificationModel {
|
||||
// final String title;
|
||||
// final String description;
|
||||
// final String time;
|
||||
// final String type;
|
||||
|
||||
NotificationModel({
|
||||
required this.title,
|
||||
required this.description,
|
||||
required this.time,
|
||||
required this.type,
|
||||
});
|
||||
}
|
||||
// NotificationModel({
|
||||
// required this.title,
|
||||
// required this.description,
|
||||
// required this.time,
|
||||
// required this.type,
|
||||
// });
|
||||
// }
|
||||
|
||||
final List<NotificationModel> notifications = [
|
||||
NotificationModel(
|
||||
title: 'New Tender Invitation',
|
||||
description: 'You’ve been invited to tender #A-778.',
|
||||
time: '5 Min',
|
||||
type: 'new',
|
||||
),
|
||||
NotificationModel(
|
||||
title: 'New Tender Invitation',
|
||||
description: 'You’ve been invited to tender #N-3762.',
|
||||
time: '28 Min',
|
||||
type: 'new',
|
||||
),
|
||||
NotificationModel(
|
||||
title: 'Tender Submitted',
|
||||
description: 'You submitted bid for tender #B-554.',
|
||||
time: '28 Min',
|
||||
type: 'submit',
|
||||
),
|
||||
NotificationModel(
|
||||
title: 'New Tender Invitation',
|
||||
description: 'You’ve been invited to tender #N-3762.',
|
||||
time: '28 Min',
|
||||
type: 'new',
|
||||
),
|
||||
NotificationModel(
|
||||
title: 'Missing Documents',
|
||||
description: 'Please upload your company registration certificate.',
|
||||
time: '2 days ago',
|
||||
type: 'missing',
|
||||
),
|
||||
];
|
||||
// final List<NotificationModel> notifications = [
|
||||
// NotificationModel(
|
||||
// title: 'New Tender Invitation',
|
||||
// description: 'You’ve been invited to tender #A-778.',
|
||||
// time: '5 Min',
|
||||
// type: 'new',
|
||||
// ),
|
||||
// NotificationModel(
|
||||
// title: 'New Tender Invitation',
|
||||
// description: 'You’ve been invited to tender #N-3762.',
|
||||
// time: '28 Min',
|
||||
// type: 'new',
|
||||
// ),
|
||||
// NotificationModel(
|
||||
// title: 'Tender Submitted',
|
||||
// description: 'You submitted bid for tender #B-554.',
|
||||
// time: '28 Min',
|
||||
// type: 'submit',
|
||||
// ),
|
||||
// NotificationModel(
|
||||
// title: 'New Tender Invitation',
|
||||
// description: 'You’ve been invited to tender #N-3762.',
|
||||
// time: '28 Min',
|
||||
// type: 'new',
|
||||
// ),
|
||||
// NotificationModel(
|
||||
// title: 'Missing Documents',
|
||||
// description: 'Please upload your company registration certificate.',
|
||||
// time: '2 days ago',
|
||||
// type: 'missing',
|
||||
// ),
|
||||
// ];
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/constants/assets.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||
import 'package:tm_app/views/notification/strings/notification_strings.dart';
|
||||
import 'package:tm_app/views/shared/page_selection_dialog.dart';
|
||||
import 'package:tm_app/views/shared/tablet_navigation_widget.dart';
|
||||
@@ -38,7 +40,9 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewModel = context.watch<NotificationViewModel>();
|
||||
final GlobalKey<ScaffoldState> key = GlobalKey();
|
||||
|
||||
return Scaffold(
|
||||
key: key,
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
@@ -66,7 +70,7 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
onTap: viewModel.markAllAsRead,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
child: Container(
|
||||
width: 132.0.w(),
|
||||
@@ -101,7 +105,6 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.0.h()),
|
||||
|
||||
Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
@@ -118,12 +121,14 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
||||
onTap: () async {
|
||||
final selectedPage = await showDialog<int>(
|
||||
context: context,
|
||||
builder:
|
||||
(context) =>
|
||||
const PageSelectionDialog(totalPages: 10),
|
||||
builder: (context) => PageSelectionDialog(
|
||||
totalPages: viewModel.totalPages,
|
||||
),
|
||||
);
|
||||
|
||||
if (selectedPage != null) {}
|
||||
if (selectedPage != null) {
|
||||
viewModel.jumpToPage(selectedPage);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -134,7 +139,7 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
||||
children: [
|
||||
SizedBox(width: 5.0.w()),
|
||||
Text(
|
||||
NotificationStrings.currentPage,
|
||||
viewModel.currentPage.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -165,7 +170,7 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
||||
),
|
||||
SizedBox(width: 5.0.w()),
|
||||
Text(
|
||||
NotificationStrings.totalPages,
|
||||
viewModel.totalPages.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 13.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
@@ -174,7 +179,6 @@ class _TabletNotificationPageState extends State<TabletNotificationPage>
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 30.0.h()),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||
|
||||
import '../pages/notification_screen.dart';
|
||||
import 'notification_card.dart';
|
||||
|
||||
class NotificationAllTab extends StatelessWidget {
|
||||
const NotificationAllTab({super.key});
|
||||
const NotificationAllTab({this.scrollController, super.key});
|
||||
|
||||
final ScrollController? scrollController;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewModel = context.watch<NotificationViewModel>();
|
||||
final notifications =
|
||||
viewModel.notificationResponse?.data?.notifications ?? [];
|
||||
|
||||
return ListView.builder(
|
||||
controller: scrollController,
|
||||
itemCount: notifications.length,
|
||||
itemBuilder: (context, index) {
|
||||
final notification = notifications[index];
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 16.0.h()),
|
||||
padding: const EdgeInsets.only(bottom: 16.0),
|
||||
child: NotificationCard(notification: notification),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1,93 +1,90 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:provider/provider.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 '../pages/notification_screen.dart';
|
||||
import 'package:tm_app/data/services/model/notification_data/notification_data.dart';
|
||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||
|
||||
class NotificationCard extends StatelessWidget {
|
||||
final NotificationItem notification;
|
||||
const NotificationCard({required this.notification, super.key});
|
||||
final NotificationModel notification;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewModel = context.read<NotificationViewModel>();
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
// height: 108.0.h(),
|
||||
margin: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.0.w(), vertical: 16.0.h()),
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
notification.title == 'Tender Submitted'
|
||||
notification.type == 'reject'
|
||||
? AppColors.orange10
|
||||
: notification.title == 'New Tender Invitation'
|
||||
? AppColors.mainBlue.withValues(alpha: 0.03)
|
||||
: notification.type == 'info'
|
||||
? AppColors.primary10Light
|
||||
: AppColors.green0,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
border: Border.all(
|
||||
color:
|
||||
notification.title == 'Tender Submitted'
|
||||
notification.type! == 'reject'
|
||||
? AppColors.warningColor
|
||||
: notification.title == 'New Tender Invitation'
|
||||
? AppColors.mainBlue.withValues(alpha: 0.15)
|
||||
: AppColors.green20,
|
||||
: notification.type == 'info' ? AppColors.primary20 : AppColors.green20,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 3.0.h()),
|
||||
child: SvgPicture.asset(
|
||||
notification.type! == 'info'
|
||||
? AssetsManager.notification
|
||||
: notification.type! == 'reject'
|
||||
? AssetsManager.danger
|
||||
: AssetsManager.tickCircle,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 5.0.w()),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
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,
|
||||
notification.title!,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.grey80,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(start: 28.0.w()),
|
||||
child: Text(
|
||||
notification.description,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey60,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(start: 28.0.w()),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(AssetsManager.calendar),
|
||||
SizedBox(width: 4.0.w()),
|
||||
Text(
|
||||
notification.time,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
color: AppColors.grey60,
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,21 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||
|
||||
import '../pages/notification_screen.dart';
|
||||
import 'notification_card.dart';
|
||||
|
||||
class NotificationImportantTab extends StatelessWidget {
|
||||
const NotificationImportantTab({super.key});
|
||||
const NotificationImportantTab({this.scrollController, super.key});
|
||||
|
||||
final ScrollController? scrollController;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewModel = context.watch<NotificationViewModel>();
|
||||
final allNotifications =
|
||||
viewModel.notificationResponse?.data?.notifications ?? [];
|
||||
|
||||
final importantNotifications = allNotifications
|
||||
.where((n) => n.priority?.toLowerCase() == 'important')
|
||||
.toList();
|
||||
|
||||
return ListView.builder(
|
||||
itemCount: notifications.length,
|
||||
controller: scrollController,
|
||||
itemCount: importantNotifications.length,
|
||||
itemBuilder: (context, index) {
|
||||
final notification = notifications[index];
|
||||
final notification = importantNotifications[index];
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 16.0.h()),
|
||||
child: NotificationCard(notification: notification),
|
||||
padding: const EdgeInsets.only(bottom: 16.0),
|
||||
child: NotificationCard(
|
||||
notification: notification,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/view_models/notification_view_model.dart';
|
||||
|
||||
import '../pages/notification_screen.dart';
|
||||
import 'notification_card.dart';
|
||||
|
||||
class NotificationUnreadTab extends StatelessWidget {
|
||||
const NotificationUnreadTab({super.key});
|
||||
final ScrollController? scrollController;
|
||||
const NotificationUnreadTab({this.scrollController, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewModel = context.watch<NotificationViewModel>();
|
||||
final notifications =
|
||||
viewModel.notificationResponse?.data?.notifications ?? [];
|
||||
return ListView.builder(
|
||||
itemCount: notifications.length,
|
||||
itemBuilder: (context, index) {
|
||||
|
||||
Reference in New Issue
Block a user