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,7 +298,8 @@ class _ResetPasswordState extends State<ResetPassword> {
//spacer //spacer
const SizedBox(height: 25), const SizedBox(height: 25),
// sign in button // sign in button
MihButton( Center(
child: MihButton(
onPressed: () { onPressed: () {
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
submitFormInput(); submitFormInput();
@@ -316,6 +320,7 @@ class _ResetPasswordState extends State<ResetPassword> {
), ),
), ),
), ),
),
], ],
), ),
], ],
@@ -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,9 +534,12 @@ class _SignInState extends State<SignIn> {
), ),
//spacer //spacer
const SizedBox(height: 20), const SizedBox(height: 35),
SizedBox( Visibility(
width: 500.0, visible: AppEnviroment.getEnv() == "Dev",
child: Center(
child: SizedBox(
width: width,
//height: 100.0, //height: 100.0,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@@ -555,8 +560,8 @@ class _SignInState extends State<SignIn> {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 15, fontSize: 15,
color: color: MzanziInnovationHub.of(
MzanziInnovationHub.of(context)! context)!
.theme .theme
.secondaryColor()), .secondaryColor()),
), ),
@@ -577,6 +582,8 @@ class _SignInState extends State<SignIn> {
], ],
), ),
), ),
),
),
const SizedBox(height: 10), const SizedBox(height: 10),
Visibility( Visibility(
visible: showProfiles, visible: showProfiles,
@@ -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,