added notifications and change in forgot password
This commit is contained in:
@@ -59,12 +59,27 @@ class DesktopForgotPasswordPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.usernameHint,
|
||||
iconPath: AssetsManager.userIcon,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.emailAddressHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.companyIdHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 70.0.h()),
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
|
||||
@@ -54,12 +54,27 @@ class MobileForgotPasswordPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.usernameHint,
|
||||
iconPath: AssetsManager.userIcon,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.emailAddressHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.companyIdHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 70.0.h()),
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
|
||||
@@ -53,12 +53,27 @@ class TabletForgotPasswordPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.usernameHint,
|
||||
iconPath: AssetsManager.userIcon,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.emailAddressHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 24.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: ForgotPasswordStrings.companyIdHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 70.0.h()),
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
|
||||
@@ -8,4 +8,6 @@ class ForgotPasswordStrings {
|
||||
static const String emailAddressHint = 'Email Address';
|
||||
static const String backToSignInButton = 'Back to Sign In';
|
||||
static const String resetLink = 'Reset Link';
|
||||
static const String usernameHint = 'Username';
|
||||
static const String companyIdHint = 'Company ID';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DesktopNotificationPage extends StatelessWidget {
|
||||
const DesktopNotificationPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import 'package:flutter/material.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/tender_app_bar.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';
|
||||
|
||||
class MobileNotificationPage extends StatefulWidget {
|
||||
const MobileNotificationPage({super.key});
|
||||
|
||||
@override
|
||||
State<MobileNotificationPage> createState() => _MobileNotificationPageState();
|
||||
}
|
||||
|
||||
class _MobileNotificationPageState extends State<MobileNotificationPage>
|
||||
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 Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
appBar: tenderMobileAppBar(title: NotificationStrings.notificationTitle),
|
||||
body: 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(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/views/notification/pages/d_notification_page.dart';
|
||||
import 'package:tm_app/views/notification/pages/m_notification_page.dart';
|
||||
import 'package:tm_app/views/notification/pages/t_notification_page.dart';
|
||||
import 'package:tm_app/views/shared/responsive_builder.dart';
|
||||
|
||||
class NotificationScreen extends StatelessWidget {
|
||||
const NotificationScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SizeConfig.init(context);
|
||||
return ResponsiveBuilder(
|
||||
mobile: MobileNotificationPage(),
|
||||
tablet: TabletNotificationPage(),
|
||||
desktop: DesktopNotificationPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
||||
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',
|
||||
),
|
||||
];
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TabletNotificationPage extends StatelessWidget {
|
||||
const TabletNotificationPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class NotificationStrings {
|
||||
NotificationStrings._();
|
||||
|
||||
static const String notificationTitle = 'Notification';
|
||||
static const String all = 'All';
|
||||
static const String unread = 'Unread';
|
||||
static const String important = 'Important';
|
||||
static const String markAllAsReadButton = 'Mark all as read';
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
import '../pages/notification_screen.dart';
|
||||
import 'notification_card.dart';
|
||||
|
||||
class NotificationAllTab extends StatelessWidget {
|
||||
const NotificationAllTab({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: notifications.length,
|
||||
itemBuilder: (context, index) {
|
||||
final notification = notifications[index];
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 16.0.h()),
|
||||
child: NotificationCard(notification: notification),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
+20
-13
@@ -4,15 +4,17 @@ 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 '../strings/home_strings.dart';
|
||||
import '../pages/notification_screen.dart';
|
||||
|
||||
class NotificationCard extends StatelessWidget {
|
||||
const NotificationCard({super.key});
|
||||
const NotificationCard({required this.notification, super.key});
|
||||
final NotificationModel notification;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
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()),
|
||||
decoration: BoxDecoration(
|
||||
@@ -21,13 +23,14 @@ class NotificationCard extends StatelessWidget {
|
||||
border: Border.all(color: AppColors.mainBlue.withValues(alpha: 0.15)),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset(AssetsManager.notification),
|
||||
SizedBox(width: 8.0.w()),
|
||||
Text(
|
||||
HomeStrings.welcome,
|
||||
notification.title,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -37,25 +40,29 @@ class NotificationCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8.0.h()),
|
||||
Text(
|
||||
'You’ve been invited Lorem ipsum dolor sit amet consectetur. Volutpat velit tincidunt amet diam. Placerat congue ut Sed facilisis',
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey60,
|
||||
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),
|
||||
padding: EdgeInsetsDirectional.only(start: 28.0.w()),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(AssetsManager.calendar),
|
||||
SizedBox(width: 4.0.w()),
|
||||
Text(
|
||||
'5 Min',
|
||||
notification.time,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
color: AppColors.grey60,
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
import '../pages/notification_screen.dart';
|
||||
import 'notification_card.dart';
|
||||
|
||||
class NotificationImportantTab extends StatelessWidget {
|
||||
const NotificationImportantTab({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: notifications.length,
|
||||
itemBuilder: (context, index) {
|
||||
final notification = notifications[index];
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 16.0.h()),
|
||||
child: NotificationCard(notification: notification),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
import '../pages/notification_screen.dart';
|
||||
import 'notification_card.dart';
|
||||
|
||||
class NotificationUnreadTab extends StatelessWidget {
|
||||
const NotificationUnreadTab({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: notifications.length,
|
||||
itemBuilder: (context, index) {
|
||||
final notification = notifications[index];
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: 16.0.h()),
|
||||
child: NotificationCard(notification: notification),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,12 @@ import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/routes/app_routes.dart';
|
||||
import 'package:tm_app/view_models/profile_view_model.dart';
|
||||
import 'package:tm_app/views/profile/widgets/theme_toggle.dart';
|
||||
import 'package:tm_app/views/shared/tender_app_bar.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/common_strings.dart';
|
||||
import '../../../core/theme/colors.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
import '../../shared/tender_app_bar.dart';
|
||||
import '../strings/profile_strings.dart';
|
||||
import '../widgets/title_description.dart';
|
||||
|
||||
|
||||
@@ -48,7 +48,11 @@ class _MainTabBarState extends State<MainTabBar> {
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
tabs: [Tab(text: widget.titles[0]), Tab(text: widget.titles[1])],
|
||||
tabs: [
|
||||
Tab(text: widget.titles[0]),
|
||||
Tab(text: widget.titles[1]),
|
||||
Tab(text: widget.titles[2]),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user