From 2dfb5e0cee720687915cc2a82552a2c29d3de233 Mon Sep 17 00:00:00 2001 From: yaso Date: Mon, 13 Jan 2025 12:51:04 +0200 Subject: [PATCH 1/4] remove useless test comments --- Frontend/lib/mih_apis/mih_api_calls.dart | 8 ++++---- Frontend/lib/mih_packages/mih_home/mih_home.dart | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Frontend/lib/mih_apis/mih_api_calls.dart b/Frontend/lib/mih_apis/mih_api_calls.dart index feeab0d2..6c26ebc3 100644 --- a/Frontend/lib/mih_apis/mih_api_calls.dart +++ b/Frontend/lib/mih_apis/mih_api_calls.dart @@ -141,12 +141,12 @@ class MIHApiCalls { // var errorBody = response.body; if (response.statusCode == 200) { - print("Here1"); + // print("Here1"); var decodedData = jsonDecode(response.body); - print("Here2"); + // print("Here2"); Patient patients = Patient.fromJson(decodedData as Map); - print("Here3"); - print(patients); + // print("Here3"); + // print(patients); patientData = patients; } else { patientData = null; diff --git a/Frontend/lib/mih_packages/mih_home/mih_home.dart b/Frontend/lib/mih_packages/mih_home/mih_home.dart index d0fec1c4..7e9317e1 100644 --- a/Frontend/lib/mih_packages/mih_home/mih_home.dart +++ b/Frontend/lib/mih_packages/mih_home/mih_home.dart @@ -172,7 +172,7 @@ class _MIHHomeState extends State { p: getPrim(), s: getSec(), )); - print("Pat Prof: ${widget.patient}"); + // print("Pat Prof: ${widget.patient}"); if (widget.patient != null) { tileList.add(MIHTile( videoID: "NUDdoWrbXNc", From 38183df535379549f8e7cee0f0a5a2b5e2b2394b Mon Sep 17 00:00:00 2001 From: yaso Date: Mon, 13 Jan 2025 12:51:24 +0200 Subject: [PATCH 2/4] add error print when signing out --- Frontend/lib/mih_components/mih_layout/mih_app_drawer.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frontend/lib/mih_components/mih_layout/mih_app_drawer.dart b/Frontend/lib/mih_components/mih_layout/mih_app_drawer.dart index e4ab0d80..e2b97130 100644 --- a/Frontend/lib/mih_components/mih_layout/mih_app_drawer.dart +++ b/Frontend/lib/mih_components/mih_layout/mih_app_drawer.dart @@ -283,7 +283,7 @@ class _MIHAppDrawerState extends State { onTap: () async { await SuperTokens.signOut( completionHandler: (error) { - //print(error); + print(error); }); if (await SuperTokens.doesSessionExist() == false) { From d4922044511b7dc780954c9ff7189577e3305f0a Mon Sep 17 00:00:00 2001 From: yaso Date: Mon, 13 Jan 2025 13:09:03 +0200 Subject: [PATCH 3/4] add create ew account button on sign in page --- .../mih_inputs_and_buttons/mih_button.dart | 2 +- .../mih_packages/authentication/register.dart | 21 ++++- .../mih_packages/authentication/signin.dart | 76 +++++++++++-------- 3 files changed, 65 insertions(+), 34 deletions(-) diff --git a/Frontend/lib/mih_components/mih_inputs_and_buttons/mih_button.dart b/Frontend/lib/mih_components/mih_inputs_and_buttons/mih_button.dart index 012b4dc0..d2892ae8 100644 --- a/Frontend/lib/mih_components/mih_inputs_and_buttons/mih_button.dart +++ b/Frontend/lib/mih_components/mih_inputs_and_buttons/mih_button.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class MIHButton extends StatefulWidget { - final void Function() onTap; + final void Function()? onTap; final String buttonText; final Color buttonColor; final Color textColor; diff --git a/Frontend/lib/mih_packages/authentication/register.dart b/Frontend/lib/mih_packages/authentication/register.dart index 7ca9124e..1c9746b2 100644 --- a/Frontend/lib/mih_packages/authentication/register.dart +++ b/Frontend/lib/mih_packages/authentication/register.dart @@ -297,7 +297,7 @@ class _RegisterState extends State { const SizedBox(height: 10), //Heading Text( - 'Register', + 'Create a New Account', style: TextStyle( fontSize: 25, fontWeight: FontWeight.bold, @@ -349,10 +349,10 @@ class _RegisterState extends State { width: 500.0, height: 50.0, child: MIHButton( - buttonText: "Sign Up", + buttonText: "Create New Account", buttonColor: MzanziInnovationHub.of(context)! .theme - .secondaryColor(), + .successColor(), textColor: MzanziInnovationHub.of(context)! .theme .primaryColor(), @@ -362,6 +362,21 @@ class _RegisterState extends State { ), ), const SizedBox(height: 10), + // SizedBox( + // width: 500.0, + // height: 50.0, + // child: MIHButton( + // buttonText: "Sign In", + // buttonColor: MzanziInnovationHub.of(context)! + // .theme + // .secondaryColor(), + // textColor: MzanziInnovationHub.of(context)! + // .theme + // .primaryColor(), + // onTap: widget.onTap, + // ), + // ), + // const SizedBox(height: 10), //register text SizedBox( width: 500.0, diff --git a/Frontend/lib/mih_packages/authentication/signin.dart b/Frontend/lib/mih_packages/authentication/signin.dart index 66fef97a..7fd93774 100644 --- a/Frontend/lib/mih_packages/authentication/signin.dart +++ b/Frontend/lib/mih_packages/authentication/signin.dart @@ -457,41 +457,57 @@ class _SignInState extends State { ), //spacer const SizedBox(height: 10), - //register text SizedBox( width: 500.0, - //height: 100.0, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Text( - 'New User?', - style: TextStyle( - fontSize: 18, - color: MzanziInnovationHub.of(context)! - .theme - .messageTextColor()), - ), - const SizedBox( - width: 6, - ), - GestureDetector( - onTap: widget.onTap, - child: Text( - 'Register Now', - style: TextStyle( - fontSize: 18, - color: MzanziInnovationHub.of(context)! - .theme - .secondaryColor(), - fontWeight: FontWeight.bold, - ), - ), - ), - ], + height: 50.0, + child: MIHButton( + buttonText: "Create New Account", + buttonColor: MzanziInnovationHub.of(context)! + .theme + .successColor(), + textColor: MzanziInnovationHub.of(context)! + .theme + .primaryColor(), + onTap: widget.onTap, ), ), //spacer + const SizedBox(height: 10), + //register text + // SizedBox( + // width: 500.0, + // //height: 100.0, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Text( + // 'New User?', + // style: TextStyle( + // fontSize: 18, + // color: MzanziInnovationHub.of(context)! + // .theme + // .messageTextColor()), + // ), + // const SizedBox( + // width: 6, + // ), + // GestureDetector( + // onTap: widget.onTap, + // child: Text( + // 'Register Now', + // style: TextStyle( + // fontSize: 18, + // color: MzanziInnovationHub.of(context)! + // .theme + // .secondaryColor(), + // fontWeight: FontWeight.bold, + // ), + // ), + // ), + // ], + // ), + // ), + //spacer const SizedBox(height: 15), SizedBox( width: 500.0, From f922001f86c87fbe2d932e714f93f54069c49445 Mon Sep 17 00:00:00 2001 From: yaso Date: Mon, 13 Jan 2025 13:16:59 +0200 Subject: [PATCH 4/4] fix back button press on after register --- .../lib/mih_packages/mzansi_profile/profile_user_update.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/Frontend/lib/mih_packages/mzansi_profile/profile_user_update.dart b/Frontend/lib/mih_packages/mzansi_profile/profile_user_update.dart index 5c6353d2..c2935cba 100644 --- a/Frontend/lib/mih_packages/mzansi_profile/profile_user_update.dart +++ b/Frontend/lib/mih_packages/mzansi_profile/profile_user_update.dart @@ -164,6 +164,7 @@ class _ProfileUserUpdateState extends State { //print("Here4"); //print(response.statusCode); if (response.statusCode == 200) { + Navigator.of(context).pop(); Navigator.of(context) .popAndPushNamed('/', arguments: widget.arguments.signedInUser); String message =