From d4922044511b7dc780954c9ff7189577e3305f0a Mon Sep 17 00:00:00 2001 From: yaso Date: Mon, 13 Jan 2025 13:09:03 +0200 Subject: [PATCH] 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,