From 8dd85fdf1a878879ea73d9e144ee790d5cf45420 Mon Sep 17 00:00:00 2001 From: maxxkim Date: Wed, 5 Jun 2024 11:09:51 +0000 Subject: [PATCH] revert e72a55f8760296cce741cb36d7eef570703f05dd revert revert 6b997a69fe7f69d53c776736f1a45c088571087e revert refactor(app): Some issues fixed --- .../auth/auth_screen/auth_screen.dart | 55 ++++++------------- lib/widgets/custom_bottom_bar.dart | 5 +- lib/widgets/custom_text_form_field.dart | 4 +- 3 files changed, 20 insertions(+), 44 deletions(-) diff --git a/lib/presentation/auth/auth_screen/auth_screen.dart b/lib/presentation/auth/auth_screen/auth_screen.dart index e934925b..bdd2d785 100644 --- a/lib/presentation/auth/auth_screen/auth_screen.dart +++ b/lib/presentation/auth/auth_screen/auth_screen.dart @@ -27,12 +27,11 @@ class AuthScreen extends StatelessWidget { @override Widget build(BuildContext context) { mediaQueryData = MediaQuery.of(context); - return Scaffold( - resizeToAvoidBottomInset: false, - appBar: _buildAppBar(context), - body:GestureDetector( - onTap: () => FocusScope.of(context).unfocus(), - child: Container( + return BlocBuilder(builder: (context, state) { + return Scaffold( + resizeToAvoidBottomInset: false, + appBar: _buildAppBar(context), + body: Container( width: double.maxFinite, padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 9.v), child: Column(children: [ @@ -42,24 +41,16 @@ class AuthScreen extends StatelessWidget { SizedBox(height: 60.v), Text("email".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 3.v), - BlocSelector( - selector: (state) => state.emailController, - builder: (context, emailController) { - return CustomTextFormField( - controller: emailController, - textInputAction: TextInputAction.done); - }), + CustomTextFormField( + controller: state.emailController, + textInputAction: TextInputAction.done), SizedBox(height: 22.v), Text("password".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 5.v), - BlocSelector( - selector: (state) => state.passwordController, - builder: (context, passwordController) { - return CustomTextFormField( - obscureText: true, - controller: passwordController, - ); - }), + CustomTextFormField( + obscureText: true, + controller: state.passwordController, + ), SizedBox(height: 50.v), NextStepButton( text: "no_account".tr.toUpperCase(), @@ -67,27 +58,15 @@ class AuthScreen extends StatelessWidget { EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, onPressed: onTapNoAccount(context)), - /*NextStepButton( - text: "Тест дневника".toUpperCase(), - margin: - EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), - buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapDiaryTest(context)), NextStepButton( - text: "Тест чата".toUpperCase(), + text: "authentificate".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapProfileTest(context)),*/ - BlocBuilder(builder: (context, state) { - return NextStepButton( - text: "authentificate".tr.toUpperCase(), - margin: - EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), - buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapAuth(state, context)); - }), - ])))); + onPressed: onTapAuth(state, context)), + ]), + )); + }); } onTapAuth(AuthState state, BuildContext context) { diff --git a/lib/widgets/custom_bottom_bar.dart b/lib/widgets/custom_bottom_bar.dart index 283982b8..3dd396dd 100644 --- a/lib/widgets/custom_bottom_bar.dart +++ b/lib/widgets/custom_bottom_bar.dart @@ -56,7 +56,6 @@ class CustomBottomBarState extends State { @override Widget build(BuildContext context) { return Container( - height: 100.v, decoration: BoxDecoration( border: Border.all( color: appTheme.whiteA700, @@ -105,7 +104,6 @@ class CustomBottomBarState extends State { double iconWidth; if (index == 0) { - iconHeight = 50.v; iconWidth = 50.h; } else if (index == bottomMenuList.length - 2) { @@ -139,8 +137,7 @@ class CustomBottomBarState extends State { shadowColor: Colors.white, surfaceTintColor: Colors.white, position: RelativeRect.fromLTRB( - MediaQuery.of(context).size.width - - 50, + MediaQuery.of(context).size.width - 50, kToolbarHeight + 340, 0, // Не смещаем по горизонтали 0, // Не смещаем по вертикали diff --git a/lib/widgets/custom_text_form_field.dart b/lib/widgets/custom_text_form_field.dart index 86a2a237..7b76f706 100644 --- a/lib/widgets/custom_text_form_field.dart +++ b/lib/widgets/custom_text_form_field.dart @@ -123,8 +123,8 @@ class CustomTextFormField extends StatelessWidget { width: width ?? double.maxFinite, child: TextFormField( controller: controller, - focusNode: focusNode ?? FocusNode(), - autofocus: autofocus!, + focusNode: focusNode ?? null, + autofocus: autofocus ?? false, style: textStyle ?? theme.textTheme.titleMedium, obscureText: obscureText!, textInputAction: textInputAction,