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

@@ -204,7 +204,7 @@ class _ForgotPasswordState extends State<ForgotPassword> {
);
}
MIHBody getBody() {
MIHBody getBody(double width) {
return MIHBody(
borderOn: false,
bodyItems: [
@@ -222,7 +222,12 @@ class _ForgotPasswordState extends State<ForgotPassword> {
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
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(
mainAxisAlignment: MainAxisAlignment.center,
children: [
@@ -320,11 +325,12 @@ class _ForgotPasswordState extends State<ForgotPassword> {
@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

@@ -303,7 +303,7 @@ class _RegisterState extends State<Register> {
);
}
MIHBody getBody() {
MIHBody getBody(double width) {
return MIHBody(
borderOn: false,
bodyItems: [
@@ -323,7 +323,10 @@ class _RegisterState extends State<Register> {
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: [
@@ -415,62 +418,55 @@ class _RegisterState extends State<Register> {
const SizedBox(height: 20),
// sign up button
Center(
child: MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
submitFormInput();
}
},
buttonColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
width: 300,
child: Text(
"Create New Account",
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
const SizedBox(height: 10),
//register text
SizedBox(
width: 300.0,
//height: 100.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
child: Wrap(
alignment: WrapAlignment.center,
runAlignment: WrapAlignment.center,
spacing: 10,
runSpacing: 10,
children: [
const Text(
'Already a User?',
style:
TextStyle(fontSize: 18, color: Colors.grey),
),
const SizedBox(
width: 6,
),
GestureDetector(
onTap: widget.onTap,
MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
submitFormInput();
}
},
buttonColor: MzanziInnovationHub.of(context)!
.theme
.successColor(),
width: 300,
child: Text(
'Sign In',
"Create New Account",
style: TextStyle(
fontSize: 18,
color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
)
),
MihButton(
onPressed: widget.onTap,
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
width: 300,
child: Text(
"I have an account",
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
],
),
//here
),
//here
],
)
],
@@ -494,11 +490,12 @@ class _RegisterState extends State<Register> {
@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,

View File

@@ -235,146 +235,154 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return MihPackageToolBody(
borderOn: false,
innerHorizontalPadding: 10,
bodyItem: getBody(),
bodyItem: getBody(screenWidth),
);
}
Widget getBody() {
Widget getBody(double width) {
return MihSingleChildScroll(
child: Column(
children: [
MihForm(
formKey: _formKey,
formFields: [
Center(
child: MihCircleAvatar(
imageFile: propicPreview,
width: 150,
editable: true,
fileNameController: proPicController,
userSelectedfile: proPic,
frameColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
onChange: (selectedImage) {
setState(() {
proPic = selectedImage;
});
},
child: Padding(
padding: MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.2)
: EdgeInsets.symmetric(horizontal: width * 0.075),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
MihForm(
formKey: _formKey,
formFields: [
Center(
child: MihCircleAvatar(
imageFile: propicPreview,
width: 150,
editable: true,
fileNameController: proPicController,
userSelectedfile: proPic,
frameColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
backgroundColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
onChange: (selectedImage) {
setState(() {
proPic = selectedImage;
});
},
),
),
),
const SizedBox(height: 25.0),
Visibility(
visible: false,
child: MihTextFormField(
const SizedBox(height: 25.0),
Visibility(
visible: false,
child: MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: proPicController,
multiLineInput: false,
requiredText: true,
readOnly: true,
hintText: "Selected File Name",
),
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: proPicController,
controller: usernameController,
multiLineInput: false,
requiredText: true,
readOnly: true,
hintText: "Selected File Name",
),
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: usernameController,
multiLineInput: false,
requiredText: true,
hintText: "Username",
validator: (value) {
return MihValidationServices().validateUsername(value);
},
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: fnameController,
multiLineInput: false,
requiredText: true,
hintText: "First Name",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: lnameController,
multiLineInput: false,
requiredText: true,
hintText: "Last Name",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
"Activate Business Account",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
),
),
const SizedBox(
width: 10,
),
Switch(
value: businessUser,
onChanged: (bool value) {
setState(() {
businessUser = value;
});
},
),
],
),
const SizedBox(height: 30.0),
Center(
child: MihButton(
onPressed: () {
//Add validation here
if (_formKey.currentState!.validate()) {
submitForm();
}
hintText: "Username",
validator: (value) {
return MihValidationServices().validateUsername(value);
},
buttonColor:
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 300,
child: Text(
"Update",
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: fnameController,
multiLineInput: false,
requiredText: true,
hintText: "First Name",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 10.0),
MihTextFormField(
fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: lnameController,
multiLineInput: false,
requiredText: true,
hintText: "Last Name",
validator: (value) {
return MihValidationServices().isEmpty(value);
},
),
const SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
"Activate Business Account",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
),
),
const SizedBox(
width: 10,
),
Switch(
value: businessUser,
onChanged: (bool value) {
setState(() {
businessUser = value;
});
},
),
],
),
const SizedBox(height: 30.0),
Center(
child: MihButton(
onPressed: () {
//Add validation here
if (_formKey.currentState!.validate()) {
submitForm();
}
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
width: 300,
child: Text(
"Update",
style: TextStyle(
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
),
],
),
],
],
),
],
),
),
);
}