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 '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_components/mih_package_components/mih_button.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),
child: MihButton(
onPressed: () {
Navigator.of(context).pushNamed(
'/about',
arguments: 0,
);
MihInstallServices().installMihTrigger(context);
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 300,
width: 150,
child: Text(
"Install MIH",
style: TextStyle(
@@ -255,10 +253,7 @@ class _RegisterState extends State<Register> {
),
iconSize: 35,
onTap: () {
Navigator.of(context).pushNamed(
'/about',
arguments: 0,
);
MihInstallServices().installMihTrigger(context);
},
),
);
@@ -352,7 +347,7 @@ class _RegisterState extends State<Register> {
),
),
//spacer
const SizedBox(height: 25),
// const SizedBox(height: 20),
MihForm(
formKey: _formKey,
formFields: [

View File

@@ -180,7 +180,7 @@ class _ResetPasswordState extends State<ResetPassword> {
);
}
MIHBody getBody() {
MIHBody getBody(double width) {
return MIHBody(
borderOn: false,
bodyItems: [
@@ -200,7 +200,10 @@ class _ResetPasswordState extends State<ResetPassword> {
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
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(
mainAxisAlignment: MainAxisAlignment.center,
children: [
@@ -295,7 +298,8 @@ class _ResetPasswordState extends State<ResetPassword> {
//spacer
const SizedBox(height: 25),
// sign in button
MihButton(
Center(
child: MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
submitFormInput();
@@ -316,6 +320,7 @@ class _ResetPasswordState extends State<ResetPassword> {
),
),
),
),
],
),
],
@@ -344,11 +349,12 @@ class _ResetPasswordState extends State<ResetPassword> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MIHLayoutBuilder(
actionButton: getActionButton(),
header: getHeader(),
secondaryActionButton: null,
body: getBody(),
body: getBody(screenWidth),
actionDrawer: null,
secondaryActionDrawer: null,
bottomNavBar: null,

View File

@@ -1,4 +1,5 @@
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_components/mih_package_components/mih_button.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),
child: MihButton(
onPressed: () {
Navigator.of(context).pushNamed(
'/about',
arguments: 0,
);
MihInstallServices().installMihTrigger(context);
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 300,
width: 150,
child: Text(
"Install MIH",
style: TextStyle(
@@ -361,7 +359,7 @@ class _SignInState extends State<SignIn> {
);
}
MIHBody getBody() {
MIHBody getBody(double width) {
return MIHBody(
borderOn: false,
bodyItems: [
@@ -381,7 +379,10 @@ class _SignInState extends State<SignIn> {
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
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: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -408,7 +409,7 @@ class _SignInState extends State<SignIn> {
),
),
//spacer
const SizedBox(height: 25),
const SizedBox(height: 10),
MihForm(
formKey: _formKey,
formFields: [
@@ -450,8 +451,9 @@ class _SignInState extends State<SignIn> {
.validatePassword(value);
},
),
const SizedBox(height: 10),
SizedBox(
width: 500.0,
// width: 500.0,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
@@ -532,9 +534,12 @@ class _SignInState extends State<SignIn> {
),
//spacer
const SizedBox(height: 20),
SizedBox(
width: 500.0,
const SizedBox(height: 35),
Visibility(
visible: AppEnviroment.getEnv() == "Dev",
child: Center(
child: SizedBox(
width: width,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -555,8 +560,8 @@ class _SignInState extends State<SignIn> {
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 15,
color:
MzanziInnovationHub.of(context)!
color: MzanziInnovationHub.of(
context)!
.theme
.secondaryColor()),
),
@@ -577,6 +582,8 @@ class _SignInState extends State<SignIn> {
],
),
),
),
),
const SizedBox(height: 10),
Visibility(
visible: showProfiles,
@@ -647,11 +654,12 @@ class _SignInState extends State<SignIn> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MIHLayoutBuilder(
actionButton: getActionButton(),
header: getHeader(),
secondaryActionButton: getSecondaryActionButton(),
body: getBody(),
body: getBody(screenWidth),
actionDrawer: null,
secondaryActionDrawer: null,
bottomNavBar: null,