This commit is contained in:
2025-06-06 10:11:51 +02:00
parent 7d6b42640c
commit efb9098835
6 changed files with 373 additions and 354 deletions

View File

@@ -94,9 +94,10 @@ class _PackageToolOneState extends State<PackageToolOne> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody( return MihPackageToolBody(
borderOn: false, borderOn: false,
bodyItem: getBody(), bodyItem: getBody(screenWidth),
); );
} }
@@ -119,12 +120,15 @@ class _PackageToolOneState extends State<PackageToolOne> {
}); });
} }
Widget getBody() { Widget getBody(double width) {
return Stack( return Stack(
children: [ children: [
Padding( MihSingleChildScroll(
padding: const EdgeInsets.symmetric(horizontal: 10.0), child: Padding(
child: MihSingleChildScroll( 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,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

View File

@@ -84,7 +84,8 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return Center(
child: SizedBox(
width: widget.width, width: widget.width,
height: widget.height, height: widget.height,
child: Theme( child: Theme(
@@ -139,8 +140,9 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
borderRadius: borderRadius:
BorderRadius.circular(widget.borderRadius ?? 8.0), BorderRadius.circular(widget.borderRadius ?? 8.0),
child: SizedBox( child: SizedBox(
height: height: widget.height != null
widget.height != null ? widget.height! - 25 : null, ? widget.height! - 25
: null,
child: TextFormField( child: TextFormField(
controller: widget.controller, controller: widget.controller,
cursorColor: widget.inputColor, cursorColor: widget.inputColor,
@@ -249,7 +251,8 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
Row( Row(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0, top: 4.0), padding:
const EdgeInsets.only(left: 8.0, top: 4.0),
child: Text( child: Text(
field.errorText ?? '', field.errorText ?? '',
style: TextStyle( style: TextStyle(
@@ -270,6 +273,7 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
], ],
), ),
), ),
),
); );
} }
} }

View File

@@ -15,13 +15,13 @@ abstract class AppEnviroment {
case Enviroment.dev: case Enviroment.dev:
{ {
//================= Android Dev Urls ================= //================= Android Dev Urls =================
baseApiUrl = "http://10.0.2.2:8080"; // baseApiUrl = "http://10.0.2.2:8080";
baseFileUrl = "http://10.0.2.2:9000"; // baseFileUrl = "http://10.0.2.2:9000";
baseAiUrl = "http://10.0.2.2:11434"; // baseAiUrl = "http://10.0.2.2:11434";
//================= Web Dev Urls ================= //================= Web Dev Urls =================
// baseApiUrl = "http://localhost:8080"; baseApiUrl = "http://localhost:8080";
// baseFileUrl = "http://localhost:9000"; baseFileUrl = "http://localhost:9000";
// baseAiUrl = "http://localhost:11434"; baseAiUrl = "http://localhost:11434";
break; break;
} }
case Enviroment.prod: case Enviroment.prod:

View File

@@ -204,7 +204,7 @@ class _ForgotPasswordState extends State<ForgotPassword> {
); );
} }
MIHBody getBody() { MIHBody getBody(double width) {
return MIHBody( return MIHBody(
borderOn: false, borderOn: false,
bodyItems: [ bodyItems: [
@@ -222,7 +222,12 @@ class _ForgotPasswordState extends State<ForgotPassword> {
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(
vertical: 25, horizontal: width * 0.2)
: EdgeInsets.symmetric(
vertical: 25, horizontal: width * 0.075),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@@ -320,11 +325,12 @@ class _ForgotPasswordState extends State<ForgotPassword> {
@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

@@ -303,7 +303,7 @@ class _RegisterState extends State<Register> {
); );
} }
MIHBody getBody() { MIHBody getBody(double width) {
return MIHBody( return MIHBody(
borderOn: false, borderOn: false,
bodyItems: [ bodyItems: [
@@ -323,7 +323,10 @@ class _RegisterState extends State<Register> {
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: [
@@ -415,7 +418,13 @@ class _RegisterState extends State<Register> {
const SizedBox(height: 20), const SizedBox(height: 20),
// sign up button // sign up button
Center( Center(
child: MihButton( child: Wrap(
alignment: WrapAlignment.center,
runAlignment: WrapAlignment.center,
spacing: 10,
runSpacing: 10,
children: [
MihButton(
onPressed: () { onPressed: () {
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
submitFormInput(); submitFormInput();
@@ -436,41 +445,28 @@ class _RegisterState extends State<Register> {
), ),
), ),
), ),
), MihButton(
onPressed: widget.onTap,
const SizedBox(height: 10), buttonColor: MzanziInnovationHub.of(context)!
//register text
SizedBox(
width: 300.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 .theme
.secondaryColor(), .secondaryColor(),
width: 300,
child: Text(
"I have an account",
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
) ),
], ],
), ),
//here
), ),
//here
], ],
) )
], ],
@@ -494,11 +490,12 @@ class _RegisterState extends State<Register> {
@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,

View File

@@ -235,16 +235,22 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody( return MihPackageToolBody(
borderOn: false, borderOn: false,
innerHorizontalPadding: 10, innerHorizontalPadding: 10,
bodyItem: getBody(), bodyItem: getBody(screenWidth),
); );
} }
Widget getBody() { Widget getBody(double width) {
return MihSingleChildScroll( return MihSingleChildScroll(
child: Padding(
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.start,
children: [ children: [
MihForm( MihForm(
formKey: _formKey, formKey: _formKey,
@@ -364,8 +370,9 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
child: Text( child: Text(
"Update", "Update",
style: TextStyle( style: TextStyle(
color: color: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@@ -376,6 +383,7 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
), ),
], ],
), ),
),
); );
} }
} }