add logo on auth to take you to about page

This commit is contained in:
2024-09-27 13:26:23 +02:00
parent c3298877e1
commit 033274d1e3
2 changed files with 390 additions and 349 deletions

View File

@@ -248,125 +248,146 @@ class _RegisterState extends State<Register> {
child: Scaffold(
//backgroundColor: Colors.white,
body: SafeArea(
child: Center(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Padding(
padding: const EdgeInsets.all(25.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
//logo
Icon(
Icons.lock,
size: 100,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
//spacer
const SizedBox(height: 10),
//Heading
Text(
'Register',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
//spacer
const SizedBox(height: 25),
//email input
SizedBox(
width: 500.0,
child: MIHTextField(
controller: emailController,
hintText: 'Email',
editable: true,
required: true,
),
),
//spacer
const SizedBox(height: 10),
//password input
SizedBox(
width: 500.0,
child: MIHPassField(
controller: passwordController,
hintText: 'Password',
required: true,
signIn: false,
),
),
//spacer
const SizedBox(height: 10),
//password input
SizedBox(
width: 500.0,
child: MIHPassField(
controller: confirmPasswordController,
hintText: 'Confirm Password',
required: true,
signIn: false,
),
),
//spacer
const SizedBox(height: 30),
// sign up button
SizedBox(
width: 500.0,
height: 50.0,
child: MIHButton(
buttonText: "Sign Up",
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
textColor: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
onTap: () async {
validateInput();
},
),
),
const SizedBox(height: 10),
//register text
SizedBox(
width: 500.0,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const Text(
'Already a User?',
style: TextStyle(fontSize: 18, color: Colors.grey),
child: Stack(
children: [
Center(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Padding(
padding: const EdgeInsets.all(25.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
//logo
Icon(
Icons.lock,
size: 100,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
//spacer
const SizedBox(height: 10),
//Heading
Text(
'Register',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
const SizedBox(
width: 6,
),
//spacer
const SizedBox(height: 25),
//email input
SizedBox(
width: 500.0,
child: MIHTextField(
controller: emailController,
hintText: 'Email',
editable: true,
required: true,
),
GestureDetector(
onTap: widget.onTap,
child: Text(
'Sign In',
style: TextStyle(
fontSize: 18,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontWeight: FontWeight.bold,
),
//spacer
const SizedBox(height: 10),
//password input
SizedBox(
width: 500.0,
child: MIHPassField(
controller: passwordController,
hintText: 'Password',
required: true,
signIn: false,
),
),
//spacer
const SizedBox(height: 10),
//password input
SizedBox(
width: 500.0,
child: MIHPassField(
controller: confirmPasswordController,
hintText: 'Confirm Password',
required: true,
signIn: false,
),
),
//spacer
const SizedBox(height: 30),
// sign up button
SizedBox(
width: 500.0,
height: 50.0,
child: MIHButton(
buttonText: "Sign Up",
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
textColor: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
onTap: () async {
validateInput();
},
),
),
const SizedBox(height: 10),
//register text
SizedBox(
width: 500.0,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const Text(
'Already a User?',
style:
TextStyle(fontSize: 18, color: Colors.grey),
),
),
)
],
),
)
],
const SizedBox(
width: 6,
),
GestureDetector(
onTap: widget.onTap,
child: Text(
'Sign In',
style: TextStyle(
fontSize: 18,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontWeight: FontWeight.bold,
),
),
)
],
),
)
],
),
),
),
),
),
Positioned(
top: 5,
left: 5,
width: 75,
height: 75,
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/about',
//arguments: widget.signedInUser,
);
},
child:
const Image(image: AssetImage('images/logo_light.png')),
),
),
],
),
),
),

View File

@@ -286,253 +286,273 @@ class _SignInState extends State<SignIn> {
child: Scaffold(
//backgroundColor: Colors.white,
body: SafeArea(
child: Center(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Padding(
padding: const EdgeInsets.all(25.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
//logo
Icon(
Icons.lock,
size: 100,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
//spacer
const SizedBox(height: 10),
//Heading
Text(
'Sign In',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
//spacer
const SizedBox(height: 25),
child: Stack(
children: [
Center(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Padding(
padding: const EdgeInsets.all(25.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
//logo
Icon(
Icons.lock,
size: 100,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
//spacer
const SizedBox(height: 10),
//Heading
Text(
'Sign In',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
//spacer
const SizedBox(height: 25),
// SizedBox(
// width: 500.0,
// //height: 100.0,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// GestureDetector(
// onTap: () {
// showSandboxProfiles();
// },
// child: Text(
// 'Sandbox Profile',
// style: TextStyle(
// fontSize: 18,
// color: MzanziInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// ],
// ),
// ),
// const SizedBox(height: 10),
//email input
SizedBox(
width: 500.0,
child: MIHTextField(
controller: emailController,
hintText: 'Email',
editable: true,
required: true,
),
),
// SizedBox(
// width: 500.0,
// //height: 100.0,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// GestureDetector(
// onTap: () {
// showSandboxProfiles();
// },
// child: Text(
// 'Sandbox Profile',
// style: TextStyle(
// fontSize: 18,
// color: MzanziInnovationHub.of(context)!
// .theme
// .secondaryColor(),
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
// ],
// ),
// ),
// const SizedBox(height: 10),
//email input
SizedBox(
width: 500.0,
child: MIHTextField(
controller: emailController,
hintText: 'Email',
editable: true,
required: true,
),
),
//spacer
const SizedBox(height: 10),
//password input
SizedBox(
width: 500.0,
child: MIHPassField(
controller: passwordController,
hintText: 'Password',
required: true,
signIn: true,
),
),
SizedBox(
width: 500.0,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/forgot-password',
);
},
child: Text(
'Forgot Password?',
style: TextStyle(
fontSize: 15,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontWeight: FontWeight.bold,
),
),
//spacer
const SizedBox(height: 10),
//password input
SizedBox(
width: 500.0,
child: MIHPassField(
controller: passwordController,
hintText: 'Password',
required: true,
signIn: true,
),
],
),
),
//spacer
const SizedBox(height: 30),
// sign in button
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: () async {
validateInput();
},
),
),
//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,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Flexible(
flex: 1,
child: Padding(
padding: EdgeInsets.only(right: 10.0),
child: Divider(),
),
),
Flexible(
flex: 1,
child: GestureDetector(
child: Text(
'Use Sandox Profile',
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
),
SizedBox(
width: 500.0,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/forgot-password',
);
},
child: Text(
'Forgot Password?',
style: TextStyle(
fontSize: 15,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor()),
.secondaryColor(),
fontWeight: FontWeight.bold,
),
),
),
onTap: () {
setState(() {
showProfiles = !showProfiles;
});
},
),
],
),
const Flexible(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 10.0),
child: Divider(),
),
),
],
),
),
const SizedBox(height: 10),
Visibility(
visible: showProfiles,
child: SizedBox(
width: 500,
child: Column(
//mainAxisSize: MainAxisSize.max,
children: [
GridView.builder(
// physics: ,
shrinkWrap: true,
itemCount: sandboxProfileList.length,
gridDelegate:
const SliverGridDelegateWithMaxCrossAxisExtent(
mainAxisSpacing: 10,
maxCrossAxisExtent: 100),
itemBuilder: (context, index) {
return sandboxProfileList[index];
},
),
const SizedBox(height: 20),
Text(
"NB: These accounts are used for test purposes. Please do not store personal information on these profiles.",
textAlign: TextAlign.center,
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
//spacer
const SizedBox(height: 30),
// sign in button
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: () async {
validateInput();
},
),
),
//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,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Flexible(
flex: 1,
child: Padding(
padding: EdgeInsets.only(right: 10.0),
child: Divider(),
),
),
Flexible(
flex: 1,
child: GestureDetector(
child: Text(
'Use Sandox Profile',
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 15,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor()),
),
onTap: () {
setState(() {
showProfiles = !showProfiles;
});
},
),
),
const Flexible(
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 10.0),
child: Divider(),
),
),
],
),
),
const SizedBox(height: 10),
Visibility(
visible: showProfiles,
child: SizedBox(
width: 500,
child: Column(
//mainAxisSize: MainAxisSize.max,
children: [
GridView.builder(
// physics: ,
shrinkWrap: true,
itemCount: sandboxProfileList.length,
gridDelegate:
const SliverGridDelegateWithMaxCrossAxisExtent(
mainAxisSpacing: 10,
maxCrossAxisExtent: 100),
itemBuilder: (context, index) {
return sandboxProfileList[index];
},
),
const SizedBox(height: 20),
Text(
"NB: These accounts are used for test purposes. Please do not store personal information on these profiles.",
textAlign: TextAlign.center,
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
],
),
],
),
),
),
),
Positioned(
top: 5,
left: 5,
width: 75,
height: 75,
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/about',
//arguments: widget.signedInUser,
);
},
child:
const Image(image: AssetImage('images/logo_light.png')),
),
),
],
),
),
),