fixed auth pages sizes and push notification navigate bug
This commit is contained in:
@@ -46,79 +46,81 @@ class _LoginMobilePageState extends State<LoginMobilePage> {
|
||||
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: [
|
||||
// LoginLogo(width: 190.0.w(), height: 88.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.logoBig,
|
||||
width: double.infinity,
|
||||
height: 50.0.h(),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
const LoginTitle(),
|
||||
SizedBox(height: 32.0.h()),
|
||||
|
||||
LoginTextField(
|
||||
controller: viewModel.usernameController,
|
||||
focusNode: viewModel.usernameFocus,
|
||||
label: LoginStrings.usernameLabel,
|
||||
iconPath: AssetsManager.userIcon,
|
||||
),
|
||||
SizedBox(height: 16.0.h()),
|
||||
|
||||
LoginTextField(
|
||||
controller: viewModel.passwordController,
|
||||
focusNode: viewModel.passwordFocus,
|
||||
label: LoginStrings.passwordLabel,
|
||||
iconPath: AssetsManager.passwordIcon,
|
||||
isPassword: true,
|
||||
obscureText: viewModel.obscurePassword,
|
||||
onToggleVisibility: viewModel.togglePasswordVisibility,
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
|
||||
if (viewModel.isLoading)
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
onPressed: null,
|
||||
isLoading: true,
|
||||
textColor: AppColors.white,
|
||||
)
|
||||
else
|
||||
BaseButton(
|
||||
isEnabled: viewModel.isLoginEnabled,
|
||||
onPressed: () async {
|
||||
if (viewModel.isLoginEnabled) {
|
||||
await viewModel.login();
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
const ForgotPasswordRouteData().push(context);
|
||||
},
|
||||
child: Text(
|
||||
LoginStrings.forgotPassword,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
|
||||
child: Consumer<AuthViewModel>(
|
||||
builder: (context, viewModel, _) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// LoginLogo(width: 190.0.w(), height: 88.0.h()),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
AssetsManager.logoBig,
|
||||
width: double.infinity,
|
||||
height: 50.0.h(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
SizedBox(height: 32.0.h()),
|
||||
const LoginTitle(),
|
||||
SizedBox(height: 32.0.h()),
|
||||
|
||||
LoginTextField(
|
||||
controller: viewModel.usernameController,
|
||||
focusNode: viewModel.usernameFocus,
|
||||
label: LoginStrings.usernameLabel,
|
||||
iconPath: AssetsManager.userIcon,
|
||||
),
|
||||
SizedBox(height: 16.0.h()),
|
||||
|
||||
LoginTextField(
|
||||
controller: viewModel.passwordController,
|
||||
focusNode: viewModel.passwordFocus,
|
||||
label: LoginStrings.passwordLabel,
|
||||
iconPath: AssetsManager.passwordIcon,
|
||||
isPassword: true,
|
||||
obscureText: viewModel.obscurePassword,
|
||||
onToggleVisibility: viewModel.togglePasswordVisibility,
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
|
||||
if (viewModel.isLoading)
|
||||
BaseButton(
|
||||
isEnabled: false,
|
||||
onPressed: null,
|
||||
isLoading: true,
|
||||
textColor: AppColors.white,
|
||||
)
|
||||
else
|
||||
BaseButton(
|
||||
isEnabled: viewModel.isLoginEnabled,
|
||||
onPressed: () async {
|
||||
if (viewModel.isLoginEnabled) {
|
||||
await viewModel.login();
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(height: 32.0.h()),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
const ForgotPasswordRouteData().push(context);
|
||||
},
|
||||
child: Text(
|
||||
LoginStrings.forgotPassword,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user