Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credential Page Sizings #187

Merged
merged 7 commits into from
Jan 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions lib/ui/views/authentication/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -27,7 +25,6 @@ class _LoginViewState extends State<LoginView> {
final _formKey = GlobalKey<FormState>();
String _email, _password;
final _emailFocusNode = FocusNode();

@override
void dispose() {
_emailFocusNode.dispose();
Expand All @@ -37,6 +34,9 @@ class _LoginViewState extends State<LoginView> {
Widget _buildLoginImage() {
return Container(
width: MediaQuery.of(context).size.width,
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(
Expand Down Expand Up @@ -107,6 +107,7 @@ class _LoginViewState extends State<LoginView> {
text: 'Sign Up',
style: TextStyle(
color: CVTheme.highlightText(context),
fontSize: 16,
),
),
],
Expand All @@ -119,16 +120,13 @@ class _LoginViewState extends State<LoginView> {
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);
Expand Down Expand Up @@ -162,7 +160,7 @@ class _LoginViewState extends State<LoginView> {
_buildLoginButton(),
const SizedBox(height: 8),
_buildNewUserSignUpComponent(),
const SizedBox(height: 32),
const SizedBox(height: 30),
const AuthOptionsView(isSignUp: false),
],
),
Expand Down
8 changes: 6 additions & 2 deletions lib/ui/views/authentication/signup_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class _SignupViewState extends State<SignupView> {
Widget _buildSignUpImage() {
return Container(
width: MediaQuery.of(context).size.width,
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(
Expand Down Expand Up @@ -108,6 +111,7 @@ class _SignupViewState extends State<SignupView> {
text: 'Login',
style: TextStyle(
color: CVTheme.highlightText(context),
fontSize: 16,
),
),
],
Expand Down Expand Up @@ -161,11 +165,11 @@ class _SignupViewState extends State<SignupView> {
_buildNameInput(),
_buildEmailInput(),
_buildPasswordInput(),
const SizedBox(height: 16),
const SizedBox(height: 14),
_buildRegisterButton(),
const SizedBox(height: 8),
_buildAlreadyRegisteredComponent(),
const SizedBox(height: 32),
const SizedBox(height: 20),
const AuthOptionsView(isSignUp: true),
],
),
Expand Down