From 1c91e4f46fe1fca8b33ea2e2d2465e2316877e47 Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Wed, 29 Dec 2021 13:21:30 +0530 Subject: [PATCH 1/7] corrected screen height --- lib/ui/views/authentication/login_view.dart | 6 ++++-- lib/ui/views/authentication/signup_view.dart | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/ui/views/authentication/login_view.dart b/lib/ui/views/authentication/login_view.dart index 93340370..f2889cf0 100644 --- a/lib/ui/views/authentication/login_view.dart +++ b/lib/ui/views/authentication/login_view.dart @@ -12,6 +12,7 @@ import 'package:mobile_app/ui/views/cv_landing_view.dart'; import 'package:mobile_app/utils/snackbar_utils.dart'; import 'package:mobile_app/utils/validators.dart'; import 'package:mobile_app/viewmodels/authentication/login_viewmodel.dart'; +import 'package:sizer/sizer.dart'; class LoginView extends StatefulWidget { const LoginView({Key key}) : super(key: key); @@ -42,7 +43,7 @@ class _LoginViewState extends State { child: SafeArea( child: Image.asset( 'assets/images/login/cv_login.png', - height: 300, + height: MediaQuery.of(context).size.height * 0.385, ), ), ); @@ -107,6 +108,7 @@ class _LoginViewState extends State { text: 'Sign Up', style: TextStyle( color: CVTheme.highlightText(context), + fontSize: 16, ), ), ], @@ -162,7 +164,7 @@ class _LoginViewState extends State { _buildLoginButton(), const SizedBox(height: 8), _buildNewUserSignUpComponent(), - const SizedBox(height: 32), + const SizedBox(height: 25), const AuthOptionsView(isSignUp: false), ], ), diff --git a/lib/ui/views/authentication/signup_view.dart b/lib/ui/views/authentication/signup_view.dart index 2616aaf3..fae5dd35 100644 --- a/lib/ui/views/authentication/signup_view.dart +++ b/lib/ui/views/authentication/signup_view.dart @@ -44,7 +44,7 @@ class _SignupViewState extends State { child: SafeArea( child: Image.asset( 'assets/images/signup/cv_signup.png', - height: 300, + height: MediaQuery.of(context).size.height * 0.345, ), ), ); @@ -108,6 +108,7 @@ class _SignupViewState extends State { text: 'Login', style: TextStyle( color: CVTheme.highlightText(context), + fontSize: 16, ), ), ], @@ -161,11 +162,11 @@ class _SignupViewState extends State { _buildNameInput(), _buildEmailInput(), _buildPasswordInput(), - const SizedBox(height: 16), + const SizedBox(height: 14), _buildRegisterButton(), const SizedBox(height: 8), _buildAlreadyRegisteredComponent(), - const SizedBox(height: 32), + const SizedBox(height: 15), const AuthOptionsView(isSignUp: true), ], ), From b45c6efd40281e7b348171f47cce8a0931a464ec Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Wed, 29 Dec 2021 13:21:42 +0530 Subject: [PATCH 2/7] add sizer package --- pubspec.lock | 14 ++++++++++++++ pubspec.yaml | 1 + 2 files changed, 15 insertions(+) diff --git a/pubspec.lock b/pubspec.lock index 917f76a6..7a59d6af 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -842,6 +842,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.4" + sizer: + dependency: "direct main" + description: + name: sizer + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.15" sky_engine: dependency: transitive description: flutter @@ -952,6 +959,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + universal_io: + dependency: transitive + description: + name: universal_io + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" url_launcher: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 3f206d8d..b9da9dc5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -58,6 +58,7 @@ dependencies: flutter_math_fork: ^0.5.0 scroll_to_index: ^2.0.0 showcaseview: ^1.1.4 + sizer: ^2.0.15 dev_dependencies: flutter_test: From e6c1f1de4386249aa98ee103284b39bc503d6bae Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Wed, 29 Dec 2021 13:31:35 +0530 Subject: [PATCH 3/7] checks --- lib/ui/views/authentication/login_view.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ui/views/authentication/login_view.dart b/lib/ui/views/authentication/login_view.dart index f2889cf0..da67fedb 100644 --- a/lib/ui/views/authentication/login_view.dart +++ b/lib/ui/views/authentication/login_view.dart @@ -12,7 +12,6 @@ import 'package:mobile_app/ui/views/cv_landing_view.dart'; import 'package:mobile_app/utils/snackbar_utils.dart'; import 'package:mobile_app/utils/validators.dart'; import 'package:mobile_app/viewmodels/authentication/login_viewmodel.dart'; -import 'package:sizer/sizer.dart'; class LoginView extends StatefulWidget { const LoginView({Key key}) : super(key: key); From ad797efa38d219232764618ab66a94eee8d45bfd Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Wed, 29 Dec 2021 16:00:38 +0530 Subject: [PATCH 4/7] pass checks --- lib/ui/views/authentication/login_view.dart | 3 ++- lib/ui/views/authentication/signup_view.dart | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ui/views/authentication/login_view.dart b/lib/ui/views/authentication/login_view.dart index da67fedb..2e778f44 100644 --- a/lib/ui/views/authentication/login_view.dart +++ b/lib/ui/views/authentication/login_view.dart @@ -37,12 +37,13 @@ class _LoginViewState extends State { Widget _buildLoginImage() { return Container( width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.475, color: CVTheme.imageBackground, padding: const EdgeInsets.all(16), child: SafeArea( child: Image.asset( 'assets/images/login/cv_login.png', - height: MediaQuery.of(context).size.height * 0.385, + height: 300, ), ), ); diff --git a/lib/ui/views/authentication/signup_view.dart b/lib/ui/views/authentication/signup_view.dart index fae5dd35..10eebc0b 100644 --- a/lib/ui/views/authentication/signup_view.dart +++ b/lib/ui/views/authentication/signup_view.dart @@ -39,12 +39,13 @@ class _SignupViewState extends State { Widget _buildSignUpImage() { return Container( width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.43, color: CVTheme.imageBackground, padding: const EdgeInsets.all(16), child: SafeArea( child: Image.asset( 'assets/images/signup/cv_signup.png', - height: MediaQuery.of(context).size.height * 0.345, + height: 300, ), ), ); From 6516574edd6525c02d78c961e2b14fc8321aacaa Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Sat, 1 Jan 2022 12:25:20 +0530 Subject: [PATCH 5/7] removed sizer --- pubspec.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index b9da9dc5..3f206d8d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -58,7 +58,6 @@ dependencies: flutter_math_fork: ^0.5.0 scroll_to_index: ^2.0.0 showcaseview: ^1.1.4 - sizer: ^2.0.15 dev_dependencies: flutter_test: From 0e110c2462c87b8cfda87cb08c211d7f6548ae12 Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Sat, 1 Jan 2022 12:26:05 +0530 Subject: [PATCH 6/7] removed sizer --- pubspec.lock | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 7a59d6af..917f76a6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -842,13 +842,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.4" - sizer: - dependency: "direct main" - description: - name: sizer - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.15" sky_engine: dependency: transitive description: flutter @@ -959,13 +952,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" - universal_io: - dependency: transitive - description: - name: universal_io - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" url_launcher: dependency: "direct main" description: From 948214ff78a89d1653461579452ab3073abfa8e4 Mon Sep 17 00:00:00 2001 From: ItsAdityaKSingh Date: Sat, 1 Jan 2022 23:54:21 +0530 Subject: [PATCH 7/7] final updates --- lib/ui/views/authentication/login_view.dart | 12 ++++-------- lib/ui/views/authentication/signup_view.dart | 6 ++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/ui/views/authentication/login_view.dart b/lib/ui/views/authentication/login_view.dart index 2e778f44..9908e361 100644 --- a/lib/ui/views/authentication/login_view.dart +++ b/lib/ui/views/authentication/login_view.dart @@ -15,9 +15,7 @@ import 'package:mobile_app/viewmodels/authentication/login_viewmodel.dart'; class LoginView extends StatefulWidget { const LoginView({Key key}) : super(key: key); - static const String id = 'login_view'; - @override _LoginViewState createState() => _LoginViewState(); } @@ -27,7 +25,6 @@ class _LoginViewState extends State { final _formKey = GlobalKey(); String _email, _password; final _emailFocusNode = FocusNode(); - @override void dispose() { _emailFocusNode.dispose(); @@ -37,7 +34,9 @@ class _LoginViewState extends State { Widget _buildLoginImage() { return Container( width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height * 0.475, + height: MediaQuery.of(context).size.height > 800 + ? MediaQuery.of(context).size.height * 0.56 + : MediaQuery.of(context).size.height * 0.475, color: CVTheme.imageBackground, padding: const EdgeInsets.all(16), child: SafeArea( @@ -121,16 +120,13 @@ class _LoginViewState extends State { if (Validators.validateAndSaveForm(_formKey) && !_model.isBusy(_model.LOGIN)) { FocusScope.of(context).requestFocus(FocusNode()); - await _model.login(_email, _password); - if (_model.isSuccess(_model.LOGIN)) { // show login successful snackbar.. SnackBarUtils.showDark( 'Login Successful', 'Welcome back!', ); - // move to home view on successful login.. await Future.delayed(const Duration(seconds: 1)); await Get.offAllNamed(CVLandingView.id); @@ -164,7 +160,7 @@ class _LoginViewState extends State { _buildLoginButton(), const SizedBox(height: 8), _buildNewUserSignUpComponent(), - const SizedBox(height: 25), + const SizedBox(height: 30), const AuthOptionsView(isSignUp: false), ], ), diff --git a/lib/ui/views/authentication/signup_view.dart b/lib/ui/views/authentication/signup_view.dart index 10eebc0b..2d3a46a3 100644 --- a/lib/ui/views/authentication/signup_view.dart +++ b/lib/ui/views/authentication/signup_view.dart @@ -39,7 +39,9 @@ class _SignupViewState extends State { Widget _buildSignUpImage() { return Container( width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height * 0.43, + height: MediaQuery.of(context).size.height > 800 + ? MediaQuery.of(context).size.height * 0.52 + : MediaQuery.of(context).size.height * 0.43, color: CVTheme.imageBackground, padding: const EdgeInsets.all(16), child: SafeArea( @@ -167,7 +169,7 @@ class _SignupViewState extends State { _buildRegisterButton(), const SizedBox(height: 8), _buildAlreadyRegisteredComponent(), - const SizedBox(height: 15), + const SizedBox(height: 20), const AuthOptionsView(isSignUp: true), ], ),