changed border color and tender tablet sizes

This commit is contained in:
amirrezaghabeli
2025-08-11 08:10:06 +03:30
parent a3af2db260
commit d7deb592fa
3 changed files with 90 additions and 84 deletions
+77 -82
View File
@@ -18,93 +18,88 @@ class LoginDesktopPage extends StatelessWidget {
return Scaffold(
backgroundColor: AppColors.backgroundColor,
body: Center(
child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 24.0.w()),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(
width: 526,
child: Consumer<AuthViewModel>(
builder: (context, viewModel, _) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
LoginLogo(width: 190.0.w(), height: 88.0.h()),
SizedBox(height: 32.0.h()),
const LoginTitle(),
SizedBox(height: 32.0.h()),
LoginTextField(
controller: viewModel.usernameController,
focusNode: viewModel.usernameFocus,
label: AppStrings.usernameLabel,
iconPath: AssetsManager.userIcon,
fieldHeight: 60.0.h(),
borderRedus: 12,
prefixIconPadding: 7.0.w(),
),
SizedBox(height: 16.0.h()),
LoginTextField(
controller: viewModel.passwordController,
focusNode: viewModel.passwordFocus,
label: AppStrings.passwordLabel,
iconPath: AssetsManager.passwordIcon,
prefixIconPadding: 7.0.w(),
isPassword: true,
obscureText: viewModel.obscurePassword,
fieldHeight: 60.0.h(),
onToggleVisibility:
viewModel.togglePasswordVisibility,
borderRedus: 12,
),
SizedBox(height: 32.0.h()),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(
width: 526,
child: Consumer<AuthViewModel>(
builder: (context, viewModel, _) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
LoginLogo(width: 190.0.w(), height: 88.0.h()),
SizedBox(height: 32.0.h()),
const LoginTitle(),
SizedBox(height: 32.0.h()),
LoginTextField(
controller: viewModel.usernameController,
focusNode: viewModel.usernameFocus,
label: AppStrings.usernameLabel,
iconPath: AssetsManager.userIcon,
fieldHeight: 60.0.h(),
borderRedus: 12,
prefixIconPadding: 7.0.w(),
),
SizedBox(height: 16.0.h()),
LoginTextField(
controller: viewModel.passwordController,
focusNode: viewModel.passwordFocus,
label: AppStrings.passwordLabel,
iconPath: AssetsManager.passwordIcon,
prefixIconPadding: 7.0.w(),
isPassword: true,
obscureText: viewModel.obscurePassword,
fieldHeight: 60.0.h(),
onToggleVisibility: viewModel.togglePasswordVisibility,
borderRedus: 12,
),
SizedBox(height: 32.0.h()),
if (viewModel.isLoading)
BaseButton(
isEnabled: false,
onPressed: null,
isLoading: true,
)
else
BaseButton(
isEnabled: viewModel.isLoginEnabled,
onPressed:
viewModel.isLoginEnabled
? () async {
await viewModel.login();
if (viewModel.loggedInUser != null) {
HomeRouteData().go(context);
} else if (viewModel.errorMessage !=
null) {
ScaffoldMessenger.of(
context,
).showSnackBar(
SnackBar(
content: Text(
viewModel.errorMessage!,
),
if (viewModel.isLoading)
BaseButton(
isEnabled: false,
onPressed: null,
isLoading: true,
)
else
BaseButton(
isEnabled: viewModel.isLoginEnabled,
onPressed:
viewModel.isLoginEnabled
? () async {
await viewModel.login();
if (viewModel.loggedInUser != null) {
HomeRouteData().go(context);
} else if (viewModel.errorMessage != null) {
ScaffoldMessenger.of(
context,
).showSnackBar(
SnackBar(
content: Text(
viewModel.errorMessage!,
),
);
}
),
);
}
: null,
),
],
);
},
),
}
: null,
),
],
);
},
),
Padding(
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
child: Image.asset(
AssetsManager.webLoginImage,
width: 796.0.w(),
height: 944.0.h(),
fit: BoxFit.fitHeight,
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 20.0.h()),
child: Image.asset(
AssetsManager.webLoginImage,
width: 796.0,
height: 944.0,
fit: BoxFit.fitWidth,
),
],
),
),
],
),
),
);