fix biz prof padding

This commit is contained in:
2025-06-06 12:23:35 +02:00
parent c42bb62477
commit 42cc4f62ab
5 changed files with 786 additions and 735 deletions

View File

@@ -142,7 +142,7 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
} }
} }
void updateEmployeePopUp(int index) { void updateEmployeePopUp(int index, double width) {
setState(() { setState(() {
accessController.text = widget.employees[index].access; accessController.text = widget.employees[index].access;
typeController.text = widget.employees[index].title; typeController.text = widget.employees[index].title;
@@ -178,7 +178,12 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
}, },
windowBody: Column( windowBody: Padding(
padding:
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.05)
: const EdgeInsets.symmetric(horizontal: 0),
child: Column(
children: [ children: [
MihForm( MihForm(
formKey: _formKey, formKey: _formKey,
@@ -242,8 +247,9 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
} }
} }
}, },
buttonColor: buttonColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.secondaryColor(), .theme
.secondaryColor(),
width: 300, width: 300,
child: Text( child: Text(
"Update", "Update",
@@ -262,6 +268,7 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
], ],
), ),
), ),
),
); );
} }
@@ -287,6 +294,7 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
@@ -314,7 +322,7 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
), ),
), ),
onTap: () { onTap: () {
updateEmployeePopUp(index); updateEmployeePopUp(index, screenWidth);
}, },
); );
}, },

View File

@@ -114,7 +114,7 @@ class _BuildUserListState extends State<BuildUserList> {
return "$firstLetter********@$end"; return "$firstLetter********@$end";
} }
void addEmployeePopUp(int index) { void addEmployeePopUp(int index, double width) {
setState(() { setState(() {
//accessController.text = widget.users[index].access; //accessController.text = widget.users[index].access;
//typeController.text = widget.users[index].title; //typeController.text = widget.users[index].title;
@@ -129,7 +129,12 @@ class _BuildUserListState extends State<BuildUserList> {
builder: (context) => MihPackageWindow( builder: (context) => MihPackageWindow(
fullscreen: false, fullscreen: false,
windowTitle: "Add Employee", windowTitle: "Add Employee",
windowBody: Column( windowBody: Padding(
padding:
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.05)
: const EdgeInsets.symmetric(horizontal: 0),
child: Column(
children: [ children: [
MihForm( MihForm(
formKey: _formKey, formKey: _formKey,
@@ -138,8 +143,9 @@ class _BuildUserListState extends State<BuildUserList> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: usernameController, controller: usernameController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -151,8 +157,9 @@ class _BuildUserListState extends State<BuildUserList> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: emailController, controller: emailController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -211,11 +218,11 @@ class _BuildUserListState extends State<BuildUserList> {
), ),
), ),
), ),
const SizedBox(height: 10.0),
], ],
), ),
], ],
), ),
),
onWindowTapClose: () { onWindowTapClose: () {
Navigator.pop(context); Navigator.pop(context);
})); }));
@@ -232,6 +239,7 @@ class _BuildUserListState extends State<BuildUserList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
@@ -256,7 +264,7 @@ class _BuildUserListState extends State<BuildUserList> {
), ),
), ),
onTap: () { onTap: () {
addEmployeePopUp(index); addEmployeePopUp(index, screenWidth);
}, },
); );
}, },

View File

@@ -223,15 +223,20 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
@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(context), bodyItem: getBody(screenWidth, context),
); );
} }
Widget getBody(BuildContext context) { Widget getBody(double width, BuildContext context) {
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(
children: [ children: [
MihForm( MihForm(
@@ -273,7 +278,8 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
MihTextFormField( MihTextFormField(
fillColor: fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: regController, controller: regController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -286,7 +292,8 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
MihTextFormField( MihTextFormField(
fillColor: fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: nameController, controller: nameController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -308,7 +315,8 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
MihTextFormField( MihTextFormField(
fillColor: fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: practiceNoController, controller: practiceNoController,
multiLineInput: false, multiLineInput: false,
requiredText: typeController.text == "Doctors Office", requiredText: typeController.text == "Doctors Office",
@@ -321,7 +329,8 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
MihTextFormField( MihTextFormField(
fillColor: fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: vatNoController, controller: vatNoController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -334,7 +343,8 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
MihTextFormField( MihTextFormField(
fillColor: fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: contactController, controller: contactController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -347,7 +357,8 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
MihTextFormField( MihTextFormField(
fillColor: fillColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(), MzanziInnovationHub.of(context)!.theme.secondaryColor(),
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(), inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: emailController, controller: emailController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -362,8 +373,9 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
children: [ children: [
Flexible( Flexible(
child: MihTextFormField( child: MihTextFormField(
fillColor: fillColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.secondaryColor(), .theme
.secondaryColor(),
inputColor: inputColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(), MzanziInnovationHub.of(context)!.theme.primaryColor(),
controller: locationController, controller: locationController,
@@ -390,8 +402,9 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
child: Text( child: Text(
"Set", "Set",
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,
), ),
@@ -425,6 +438,7 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
], ],
), ),
], ],
),
)); ));
} }
} }

View File

@@ -203,15 +203,20 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
@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(
children: [ children: [
MihForm( MihForm(
@@ -369,8 +374,9 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
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,
), ),
@@ -382,6 +388,7 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
), ),
], ],
), ),
),
); );
} }
} }

View File

@@ -297,7 +297,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
); );
} }
MIHBody getBody() { MIHBody getBody(double width) {
return MIHBody( return MIHBody(
borderOn: false, borderOn: false,
bodyItems: [ bodyItems: [
@@ -313,6 +313,11 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
} }
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
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(
children: [ children: [
const Text( const Text(
@@ -334,8 +339,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: regController, controller: regController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -349,8 +355,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: nameController, controller: nameController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -371,8 +378,8 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
ValueListenableBuilder( ValueListenableBuilder(
valueListenable: busType, valueListenable: busType,
builder: builder: (BuildContext context, String value,
(BuildContext context, String value, Widget? child) { Widget? child) {
return Visibility( return Visibility(
visible: value == "Doctors Office", visible: value == "Doctors Office",
child: MihTextFormField( child: MihTextFormField(
@@ -402,8 +409,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: vatNoController, controller: vatNoController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -417,8 +425,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: contactController, controller: contactController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -432,8 +441,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: emailController, controller: emailController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -520,8 +530,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: fnameController, controller: fnameController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -535,8 +546,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
fillColor: MzanziInnovationHub.of(context)! fillColor: MzanziInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
inputColor: inputColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.primaryColor(), .theme
.primaryColor(),
controller: lnameController, controller: lnameController,
multiLineInput: false, multiLineInput: false,
requiredText: true, requiredText: true,
@@ -584,6 +596,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
), ),
), ),
), ),
),
], ],
); );
} }
@@ -626,11 +639,12 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
@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(),
secondaryActionButton: null, secondaryActionButton: null,
header: getHeader(), header: getHeader(),
body: getBody(), body: getBody(screenWidth),
actionDrawer: null, actionDrawer: null,
secondaryActionDrawer: null, secondaryActionDrawer: null,
bottomNavBar: null, bottomNavBar: null,