forgot password ui added
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/theme/colors.dart';
|
||||
import '../../../view_models/auth_view_model.dart';
|
||||
import '../../login/widgets/login_textfield.dart';
|
||||
import '../../shared/base_button.dart';
|
||||
|
||||
class DesktopForgotPasswordPage extends StatelessWidget {
|
||||
const DesktopForgotPasswordPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
body: Center(
|
||||
child: Consumer<AuthViewModel>(
|
||||
builder: (context, viewModel, _) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 120),
|
||||
child: SizedBox(
|
||||
width: 364,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.logoBig,
|
||||
width: double.infinity,
|
||||
height: 50.0.h(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 72.0.h()),
|
||||
Text(
|
||||
AppStrings.forgotPasswordTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 28.0.sp(),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.grey80,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16.0.h()),
|
||||
Text(
|
||||
AppStrings.forgotPasswordSubtitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey60,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: AppStrings.emailAddressHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 70.0.h()),
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
text: AppStrings.resetLink,
|
||||
onPressed: () async {
|
||||
if (viewModel.isLoginEnabled) {
|
||||
await viewModel.login();
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
child: Text(
|
||||
AppStrings.backToSignInButton,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(32.0),
|
||||
child: Image.asset(
|
||||
AssetsManager.forgotPasswordImage,
|
||||
width: 796.0,
|
||||
height: 944.0,
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../shared/responsive_builder.dart';
|
||||
import 'd_forgot_apssword_page.dart';
|
||||
import 'm_forgot_password_page.dart';
|
||||
import 't_forgot_password_page.dart';
|
||||
|
||||
class ForgotPasswordScreen extends StatelessWidget {
|
||||
const ForgotPasswordScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(
|
||||
mobile: MobileForgotPasswordPage(),
|
||||
tablet: TabletForgotPasswordPage(),
|
||||
desktop: DesktopForgotPasswordPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/theme/colors.dart';
|
||||
import '../../../view_models/auth_view_model.dart';
|
||||
import '../../login/widgets/login_textfield.dart';
|
||||
import '../../shared/base_button.dart';
|
||||
|
||||
class MobileForgotPasswordPage extends StatelessWidget {
|
||||
const MobileForgotPasswordPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
body: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||
child: Consumer<AuthViewModel>(
|
||||
builder: (context, viewModel, _) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.logoBig,
|
||||
width: double.infinity,
|
||||
height: 50.0.h(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 72.0.h()),
|
||||
Text(
|
||||
AppStrings.forgotPasswordTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 28.0.sp(),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.grey80,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16.0.h()),
|
||||
Text(
|
||||
AppStrings.forgotPasswordSubtitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey60,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: AppStrings.emailAddressHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 70.0.h()),
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
text: AppStrings.resetLink,
|
||||
onPressed: () async {
|
||||
if (viewModel.isLoginEnabled) {
|
||||
await viewModel.login();
|
||||
}
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
child: Text(
|
||||
AppStrings.backToSignInButton,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/theme/colors.dart';
|
||||
import '../../../view_models/auth_view_model.dart';
|
||||
import '../../login/widgets/login_textfield.dart';
|
||||
import '../../shared/base_button.dart';
|
||||
|
||||
class TabletForgotPasswordPage extends StatelessWidget {
|
||||
const TabletForgotPasswordPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Consumer<AuthViewModel>(
|
||||
builder: (context, viewModel, _) {
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: 364,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.logoBig,
|
||||
width: double.infinity,
|
||||
height: 50.0.h(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 72.0.h()),
|
||||
Text(
|
||||
AppStrings.forgotPasswordTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 28.0.sp(),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.grey80,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16.0.h()),
|
||||
Text(
|
||||
AppStrings.forgotPasswordSubtitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.grey60,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40.0.h()),
|
||||
LoginTextField(
|
||||
controller: viewModel.emailController,
|
||||
focusNode: viewModel.emailFocus,
|
||||
label: AppStrings.emailAddressHint,
|
||||
isPassword: false,
|
||||
),
|
||||
SizedBox(height: 70.0.h()),
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
text: AppStrings.resetLink,
|
||||
onPressed: () async {
|
||||
if (viewModel.isLoginEnabled) {
|
||||
await viewModel.login();
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
child: Text(
|
||||
AppStrings.backToSignInButton,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import 'package:tm_app/core/theme/colors.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/routes/app_routes.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
import '../../../view_models/auth_view_model.dart';
|
||||
import '../widgets/widgets.dart';
|
||||
@@ -46,7 +47,6 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SizeConfig.init(context);
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
body: Center(
|
||||
@@ -55,7 +55,7 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
|
||||
kIsWeb ? MainAxisAlignment.spaceAround : MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 526,
|
||||
width: 536,
|
||||
child: Consumer<AuthViewModel>(
|
||||
builder: (context, viewModel, _) {
|
||||
return Column(
|
||||
@@ -108,6 +108,20 @@ class _LoginDesktopPageState extends State<LoginDesktopPage> {
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(height: 32.0),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
ForgotPasswordRouteData().push(context);
|
||||
},
|
||||
child: Text(
|
||||
AppStrings.forgotPassword,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tm_app/core/routes/app_routes.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
@@ -103,6 +104,20 @@ class _LoginMobilePageState extends State<LoginMobilePage> {
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
ForgotPasswordRouteData().push(context);
|
||||
},
|
||||
child: Text(
|
||||
AppStrings.forgotPassword,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:tm_app/core/theme/colors.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/routes/app_routes.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
import '../../../view_models/auth_view_model.dart';
|
||||
import '../widgets/widgets.dart';
|
||||
@@ -45,7 +46,6 @@ class _LoginTabletPageState extends State<LoginTabletPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SizeConfig.init(context);
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.backgroundColor,
|
||||
body: Center(
|
||||
@@ -101,6 +101,20 @@ class _LoginTabletPageState extends State<LoginTabletPage> {
|
||||
}
|
||||
: null,
|
||||
),
|
||||
SizedBox(height: 32.0),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
ForgotPasswordRouteData().push(context);
|
||||
},
|
||||
child: Text(
|
||||
AppStrings.forgotPassword,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ class LoginTextField extends StatelessWidget {
|
||||
final TextEditingController controller;
|
||||
final FocusNode focusNode;
|
||||
final String label;
|
||||
final String iconPath;
|
||||
final String? iconPath;
|
||||
final bool isPassword;
|
||||
final bool obscureText;
|
||||
final double? borderRedus;
|
||||
@@ -21,7 +21,7 @@ class LoginTextField extends StatelessWidget {
|
||||
required this.controller,
|
||||
required this.focusNode,
|
||||
required this.label,
|
||||
required this.iconPath,
|
||||
this.iconPath,
|
||||
super.key,
|
||||
this.isPassword = false,
|
||||
this.obscureText = false,
|
||||
@@ -45,18 +45,23 @@ class LoginTextField extends StatelessWidget {
|
||||
horizontal: 12.0.w(),
|
||||
),
|
||||
labelText: label,
|
||||
prefixIcon: Padding(
|
||||
padding: EdgeInsets.all(prefixIconPadding ?? 12.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
iconPath,
|
||||
width: 24.0.w(),
|
||||
height: 24.0.h(),
|
||||
colorFilter: ColorFilter.mode(
|
||||
focusNode.hasFocus ? AppColors.grey80 : AppColors.grey60,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
prefixIcon:
|
||||
iconPath != null
|
||||
? Padding(
|
||||
padding: EdgeInsets.all(prefixIconPadding ?? 12.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
iconPath!,
|
||||
width: 24.0.w(),
|
||||
height: 24.0.h(),
|
||||
colorFilter: ColorFilter.mode(
|
||||
focusNode.hasFocus
|
||||
? AppColors.grey80
|
||||
: AppColors.grey60,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
suffixIcon:
|
||||
isPassword
|
||||
? IconButton(
|
||||
|
||||
Reference in New Issue
Block a user