Merge pull request 'changed border color and tender tablet sizes' (#29) from login_changes into main

Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/29
This commit is contained in:
a.ghabeli
2025-08-11 08:10:33 +03:30
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,
),
],
),
),
],
),
),
);
+8 -1
View File
@@ -68,7 +68,9 @@ class LoginTextField extends StatelessWidget {
width: 24.0.w(),
height: 24.0.h(),
colorFilter: ColorFilter.mode(
focusNode.hasFocus ? AppColors.grey80 : AppColors.grey60,
focusNode.hasFocus
? AppColors.grey80
: AppColors.grey60,
BlendMode.srcIn,
),
),
@@ -76,6 +78,11 @@ class LoginTextField extends StatelessWidget {
: null,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(borderRedus ?? 12.0.w()),
borderSide: BorderSide(color: AppColors.grey40),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(borderRedus ?? 12.0.w()),
borderSide: BorderSide(color: AppColors.grey40),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: AppColors.borderBlue),
+5 -1
View File
@@ -14,7 +14,11 @@ class TabletTendersPage extends StatelessWidget {
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 24.0.h()),
padding: EdgeInsets.only(
left: 24.0.w(),
right: 24.0.w(),
top: 128.0.h(),
),
child: MainTendersSlider(),
),
),