fix auth padding and install button

This commit is contained in:
2025-06-06 11:47:38 +02:00
parent 564ca2e6d9
commit d99a26a9b8
3 changed files with 89 additions and 80 deletions

View File

@@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'package:mzansi_innovation_hub/mih_apis/mih_install_services.dart';
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
@@ -235,14 +236,11 @@ class _RegisterState extends State<Register> {
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: MihButton( child: MihButton(
onPressed: () { onPressed: () {
Navigator.of(context).pushNamed( MihInstallServices().installMihTrigger(context);
'/about',
arguments: 0,
);
}, },
buttonColor: buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 300, width: 150,
child: Text( child: Text(
"Install MIH", "Install MIH",
style: TextStyle( style: TextStyle(
@@ -255,10 +253,7 @@ class _RegisterState extends State<Register> {
), ),
iconSize: 35, iconSize: 35,
onTap: () { onTap: () {
Navigator.of(context).pushNamed( MihInstallServices().installMihTrigger(context);
'/about',
arguments: 0,
);
}, },
), ),
); );
@@ -352,7 +347,7 @@ class _RegisterState extends State<Register> {
), ),
), ),
//spacer //spacer
const SizedBox(height: 25), // const SizedBox(height: 20),
MihForm( MihForm(
formKey: _formKey, formKey: _formKey,
formFields: [ formFields: [

View File

@@ -180,7 +180,7 @@ class _ResetPasswordState extends State<ResetPassword> {
); );
} }
MIHBody getBody() { MIHBody getBody(double width) {
return MIHBody( return MIHBody(
borderOn: false, borderOn: false,
bodyItems: [ bodyItems: [
@@ -200,7 +200,10 @@ class _ResetPasswordState extends State<ResetPassword> {
child: SingleChildScrollView( child: SingleChildScrollView(
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
child: Padding( child: Padding(
padding: const EdgeInsets.all(25.0), padding: MzanziInnovationHub.of(context)!.theme.screenType ==
"desktop"
? EdgeInsets.symmetric(horizontal: width * 0.2)
: EdgeInsets.symmetric(horizontal: width * 0.075),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@@ -295,24 +298,26 @@ class _ResetPasswordState extends State<ResetPassword> {
//spacer //spacer
const SizedBox(height: 25), const SizedBox(height: 25),
// sign in button // sign in button
MihButton( Center(
onPressed: () { child: MihButton(
if (_formKey.currentState!.validate()) { onPressed: () {
submitFormInput(); if (_formKey.currentState!.validate()) {
} submitFormInput();
}, }
buttonColor: MzanziInnovationHub.of(context)! },
.theme buttonColor: MzanziInnovationHub.of(context)!
.secondaryColor(), .theme
width: 300, .secondaryColor(),
child: Text( width: 300,
"Reset Password", child: Text(
style: TextStyle( "Reset Password",
color: MzanziInnovationHub.of(context)! style: TextStyle(
.theme color: MzanziInnovationHub.of(context)!
.primaryColor(), .theme
fontSize: 20, .primaryColor(),
fontWeight: FontWeight.bold, fontSize: 20,
fontWeight: FontWeight.bold,
),
), ),
), ),
), ),
@@ -344,11 +349,12 @@ class _ResetPasswordState extends State<ResetPassword> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MIHLayoutBuilder( return MIHLayoutBuilder(
actionButton: getActionButton(), actionButton: getActionButton(),
header: getHeader(), header: getHeader(),
secondaryActionButton: null, secondaryActionButton: null,
body: getBody(), body: getBody(screenWidth),
actionDrawer: null, actionDrawer: null,
secondaryActionDrawer: null, secondaryActionDrawer: null,
bottomNavBar: null, bottomNavBar: null,

View File

@@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:mzansi_innovation_hub/mih_apis/mih_install_Services.dart';
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart'; import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
@@ -293,14 +294,11 @@ class _SignInState extends State<SignIn> {
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: MihButton( child: MihButton(
onPressed: () { onPressed: () {
Navigator.of(context).pushNamed( MihInstallServices().installMihTrigger(context);
'/about',
arguments: 0,
);
}, },
buttonColor: buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 300, width: 150,
child: Text( child: Text(
"Install MIH", "Install MIH",
style: TextStyle( style: TextStyle(
@@ -361,7 +359,7 @@ class _SignInState extends State<SignIn> {
); );
} }
MIHBody getBody() { MIHBody getBody(double width) {
return MIHBody( return MIHBody(
borderOn: false, borderOn: false,
bodyItems: [ bodyItems: [
@@ -381,7 +379,10 @@ class _SignInState extends State<SignIn> {
child: SingleChildScrollView( child: SingleChildScrollView(
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
child: Padding( child: Padding(
padding: const EdgeInsets.all(25.0), padding: MzanziInnovationHub.of(context)!.theme.screenType ==
"desktop"
? EdgeInsets.symmetric(horizontal: width * 0.2)
: EdgeInsets.symmetric(horizontal: width * 0.075),
child: AutofillGroup( child: AutofillGroup(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@@ -408,7 +409,7 @@ class _SignInState extends State<SignIn> {
), ),
), ),
//spacer //spacer
const SizedBox(height: 25), const SizedBox(height: 10),
MihForm( MihForm(
formKey: _formKey, formKey: _formKey,
formFields: [ formFields: [
@@ -450,8 +451,9 @@ class _SignInState extends State<SignIn> {
.validatePassword(value); .validatePassword(value);
}, },
), ),
const SizedBox(height: 10),
SizedBox( SizedBox(
width: 500.0, // width: 500.0,
//height: 100.0, //height: 100.0,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@@ -532,49 +534,54 @@ class _SignInState extends State<SignIn> {
), ),
//spacer //spacer
const SizedBox(height: 20), const SizedBox(height: 35),
SizedBox( Visibility(
width: 500.0, visible: AppEnviroment.getEnv() == "Dev",
//height: 100.0, child: Center(
child: Row( child: SizedBox(
mainAxisAlignment: MainAxisAlignment.center, width: width,
children: [ //height: 100.0,
const Flexible( child: Row(
flex: 1, mainAxisAlignment: MainAxisAlignment.center,
child: Padding( children: [
padding: EdgeInsets.only(right: 10.0), const Flexible(
child: Divider(), flex: 1,
), child: Padding(
), padding: EdgeInsets.only(right: 10.0),
Flexible( child: Divider(),
flex: 1, ),
child: GestureDetector( ),
child: Text( Flexible(
'Use Sandox Profile', flex: 1,
textAlign: TextAlign.center, child: GestureDetector(
style: TextStyle( child: Text(
fontWeight: FontWeight.bold, 'Use Sandox Profile',
fontSize: 15, textAlign: TextAlign.center,
color: style: TextStyle(
MzanziInnovationHub.of(context)! fontWeight: FontWeight.bold,
fontSize: 15,
color: MzanziInnovationHub.of(
context)!
.theme .theme
.secondaryColor()), .secondaryColor()),
),
onTap: () {
setState(() {
showProfiles = !showProfiles;
});
},
),
), ),
onTap: () { const Flexible(
setState(() { flex: 1,
showProfiles = !showProfiles; child: Padding(
}); padding: EdgeInsets.only(left: 10.0),
}, child: Divider(),
), ),
),
],
), ),
const Flexible( ),
flex: 1,
child: Padding(
padding: EdgeInsets.only(left: 10.0),
child: Divider(),
),
),
],
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
@@ -647,11 +654,12 @@ class _SignInState extends State<SignIn> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MIHLayoutBuilder( return MIHLayoutBuilder(
actionButton: getActionButton(), actionButton: getActionButton(),
header: getHeader(), header: getHeader(),
secondaryActionButton: getSecondaryActionButton(), secondaryActionButton: getSecondaryActionButton(),
body: getBody(), body: getBody(screenWidth),
actionDrawer: null, actionDrawer: null,
secondaryActionDrawer: null, secondaryActionDrawer: null,
bottomNavBar: null, bottomNavBar: null,