fix biz prof padding
This commit is contained in:
@@ -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,88 +178,95 @@ class _BuildEmployeeListState extends State<BuildEmployeeList> {
|
|||||||
onWindowTapClose: () {
|
onWindowTapClose: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
windowBody: Column(
|
windowBody: Padding(
|
||||||
children: [
|
padding:
|
||||||
MihForm(
|
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
|
||||||
formKey: _formKey,
|
? EdgeInsets.symmetric(horizontal: width * 0.05)
|
||||||
formFields: [
|
: const EdgeInsets.symmetric(horizontal: 0),
|
||||||
MihTextFormField(
|
child: Column(
|
||||||
fillColor:
|
children: [
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MihForm(
|
||||||
inputColor:
|
formKey: _formKey,
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
formFields: [
|
||||||
controller: fnameController,
|
MihTextFormField(
|
||||||
multiLineInput: false,
|
fillColor:
|
||||||
requiredText: true,
|
|
||||||
readOnly: true,
|
|
||||||
hintText: "First Name",
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MihTextFormField(
|
|
||||||
fillColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: lnameController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
readOnly: true,
|
|
||||||
hintText: "Surname",
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: typeController,
|
|
||||||
hintText: "Title",
|
|
||||||
dropdownOptions: const ["Doctor", "Assistant"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: accessController,
|
|
||||||
hintText: "Access",
|
|
||||||
dropdownOptions: const ["Full", "Partial"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20.0),
|
|
||||||
Center(
|
|
||||||
child: MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
if (_formKey.currentState!.validate()) {
|
|
||||||
if (isRequiredFieldsCaptured()) {
|
|
||||||
updateEmployeeAPICall(index);
|
|
||||||
} else {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return const MIHErrorMessage(
|
|
||||||
errorType: "Input Error");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
buttonColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
width: 300,
|
inputColor:
|
||||||
child: Text(
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
"Update",
|
controller: fnameController,
|
||||||
style: TextStyle(
|
multiLineInput: false,
|
||||||
color: MzanziInnovationHub.of(context)!
|
requiredText: true,
|
||||||
.theme
|
readOnly: true,
|
||||||
.primaryColor(),
|
hintText: "First Name",
|
||||||
fontSize: 20,
|
),
|
||||||
fontWeight: FontWeight.bold,
|
const SizedBox(height: 10.0),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: lnameController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
readOnly: true,
|
||||||
|
hintText: "Surname",
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: typeController,
|
||||||
|
hintText: "Title",
|
||||||
|
dropdownOptions: const ["Doctor", "Assistant"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
enableSearch: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: accessController,
|
||||||
|
hintText: "Access",
|
||||||
|
dropdownOptions: const ["Full", "Partial"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
enableSearch: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20.0),
|
||||||
|
Center(
|
||||||
|
child: MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
if (isRequiredFieldsCaptured()) {
|
||||||
|
updateEmployeeAPICall(index);
|
||||||
|
} else {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return const MIHErrorMessage(
|
||||||
|
errorType: "Input Error");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
width: 300,
|
||||||
|
child: Text(
|
||||||
|
"Update",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -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);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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,92 +129,99 @@ 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(
|
||||||
children: [
|
padding:
|
||||||
MihForm(
|
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
|
||||||
formKey: _formKey,
|
? EdgeInsets.symmetric(horizontal: width * 0.05)
|
||||||
formFields: [
|
: const EdgeInsets.symmetric(horizontal: 0),
|
||||||
MihTextFormField(
|
child: Column(
|
||||||
fillColor: MzanziInnovationHub.of(context)!
|
children: [
|
||||||
.theme
|
MihForm(
|
||||||
.secondaryColor(),
|
formKey: _formKey,
|
||||||
inputColor:
|
formFields: [
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MihTextFormField(
|
||||||
controller: usernameController,
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
readOnly: true,
|
|
||||||
hintText: "Username",
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MihTextFormField(
|
|
||||||
fillColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: emailController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
readOnly: true,
|
|
||||||
hintText: "Email",
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: typeController,
|
|
||||||
hintText: "Title",
|
|
||||||
dropdownOptions: const ["Doctor", "Assistant"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: accessController,
|
|
||||||
hintText: "Access",
|
|
||||||
dropdownOptions: const ["Full", "Partial"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
Center(
|
|
||||||
child: MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
if (_formKey.currentState!.validate()) {
|
|
||||||
if (isRequiredFieldsCaptured()) {
|
|
||||||
createBusinessUserAPICall(index);
|
|
||||||
} else {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return const MIHErrorMessage(
|
|
||||||
errorType: "Input Error");
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.secondaryColor(),
|
.secondaryColor(),
|
||||||
width: 300,
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
child: Text(
|
.theme
|
||||||
"Add",
|
.primaryColor(),
|
||||||
style: TextStyle(
|
controller: usernameController,
|
||||||
color: MzanziInnovationHub.of(context)!
|
multiLineInput: false,
|
||||||
.theme
|
requiredText: true,
|
||||||
.primaryColor(),
|
readOnly: true,
|
||||||
fontSize: 20,
|
hintText: "Username",
|
||||||
fontWeight: FontWeight.bold,
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
controller: emailController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
readOnly: true,
|
||||||
|
hintText: "Email",
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: typeController,
|
||||||
|
hintText: "Title",
|
||||||
|
dropdownOptions: const ["Doctor", "Assistant"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
enableSearch: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: accessController,
|
||||||
|
hintText: "Access",
|
||||||
|
dropdownOptions: const ["Full", "Partial"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
enableSearch: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
|
Center(
|
||||||
|
child: MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
if (isRequiredFieldsCaptured()) {
|
||||||
|
createBusinessUserAPICall(index);
|
||||||
|
} else {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return const MIHErrorMessage(
|
||||||
|
errorType: "Input Error");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
width: 300,
|
||||||
|
child: Text(
|
||||||
|
"Add",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
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);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -223,172 +223,208 @@ 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: Column(
|
child: Padding(
|
||||||
children: [
|
padding: MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
|
||||||
MihForm(
|
? EdgeInsets.symmetric(horizontal: width * 0.2)
|
||||||
formKey: _formKey,
|
: EdgeInsets.symmetric(horizontal: width * 0.075),
|
||||||
formFields: [
|
child: Column(
|
||||||
Center(
|
children: [
|
||||||
child: MihCircleAvatar(
|
MihForm(
|
||||||
imageFile: widget.logoImage,
|
formKey: _formKey,
|
||||||
width: 150,
|
formFields: [
|
||||||
editable: true,
|
Center(
|
||||||
fileNameController: fileNameController,
|
child: MihCircleAvatar(
|
||||||
userSelectedfile: imageFile,
|
imageFile: widget.logoImage,
|
||||||
frameColor:
|
width: 150,
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
editable: true,
|
||||||
backgroundColor:
|
fileNameController: fileNameController,
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
userSelectedfile: imageFile,
|
||||||
onChange: (selectedfile) {
|
frameColor:
|
||||||
setState(() {
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
imageFile = selectedfile;
|
backgroundColor:
|
||||||
});
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
},
|
onChange: (selectedfile) {
|
||||||
|
setState(() {
|
||||||
|
imageFile = selectedfile;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Visibility(
|
||||||
Visibility(
|
visible: false,
|
||||||
visible: false,
|
child: MihTextFormField(
|
||||||
child: MihTextFormField(
|
fillColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: fileNameController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
readOnly: true,
|
||||||
|
hintText: "Selected File Name",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
MihTextFormField(
|
||||||
fillColor:
|
fillColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
inputColor:
|
inputColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
controller: fileNameController,
|
controller: regController,
|
||||||
multiLineInput: false,
|
multiLineInput: false,
|
||||||
requiredText: true,
|
requiredText: true,
|
||||||
readOnly: true,
|
hintText: "Registration No.",
|
||||||
hintText: "Selected File Name",
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 10),
|
||||||
const SizedBox(height: 20),
|
MihTextFormField(
|
||||||
MihTextFormField(
|
fillColor:
|
||||||
fillColor:
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
inputColor:
|
||||||
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
controller: regController,
|
controller: nameController,
|
||||||
multiLineInput: false,
|
multiLineInput: false,
|
||||||
requiredText: true,
|
requiredText: true,
|
||||||
hintText: "Registration No.",
|
hintText: "Business Name",
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
return MihValidationServices().isEmpty(value);
|
return MihValidationServices().isEmpty(value);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 15),
|
||||||
MihTextFormField(
|
MIHDropdownField(
|
||||||
fillColor:
|
controller: typeController,
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
hintText: "Business Type",
|
||||||
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
dropdownOptions: const ["Doctors Office", "Other"],
|
||||||
controller: nameController,
|
required: true,
|
||||||
multiLineInput: false,
|
editable: true,
|
||||||
requiredText: true,
|
enableSearch: false,
|
||||||
hintText: "Business Name",
|
),
|
||||||
validator: (value) {
|
const SizedBox(height: 10),
|
||||||
return MihValidationServices().isEmpty(value);
|
MihTextFormField(
|
||||||
},
|
fillColor:
|
||||||
),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
const SizedBox(height: 15),
|
inputColor:
|
||||||
MIHDropdownField(
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
controller: typeController,
|
controller: practiceNoController,
|
||||||
hintText: "Business Type",
|
multiLineInput: false,
|
||||||
dropdownOptions: const ["Doctors Office", "Other"],
|
requiredText: typeController.text == "Doctors Office",
|
||||||
required: true,
|
hintText: "Practice Number",
|
||||||
editable: true,
|
validator: (validateValue) {
|
||||||
enableSearch: false,
|
return MihValidationServices().isEmpty(validateValue);
|
||||||
),
|
},
|
||||||
const SizedBox(height: 10),
|
),
|
||||||
MihTextFormField(
|
const SizedBox(height: 10),
|
||||||
fillColor:
|
MihTextFormField(
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
fillColor:
|
||||||
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
controller: practiceNoController,
|
inputColor:
|
||||||
multiLineInput: false,
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
requiredText: typeController.text == "Doctors Office",
|
controller: vatNoController,
|
||||||
hintText: "Practice Number",
|
multiLineInput: false,
|
||||||
validator: (validateValue) {
|
requiredText: true,
|
||||||
return MihValidationServices().isEmpty(validateValue);
|
hintText: "VAT Number",
|
||||||
},
|
validator: (value) {
|
||||||
),
|
return MihValidationServices().isEmpty(value);
|
||||||
const SizedBox(height: 10),
|
},
|
||||||
MihTextFormField(
|
),
|
||||||
fillColor:
|
const SizedBox(height: 10),
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MihTextFormField(
|
||||||
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
fillColor:
|
||||||
controller: vatNoController,
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
multiLineInput: false,
|
inputColor:
|
||||||
requiredText: true,
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
hintText: "VAT Number",
|
controller: contactController,
|
||||||
validator: (value) {
|
multiLineInput: false,
|
||||||
return MihValidationServices().isEmpty(value);
|
requiredText: true,
|
||||||
},
|
hintText: "Contact Number",
|
||||||
),
|
validator: (value) {
|
||||||
const SizedBox(height: 10),
|
return MihValidationServices().isEmpty(value);
|
||||||
MihTextFormField(
|
},
|
||||||
fillColor:
|
),
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
const SizedBox(height: 10),
|
||||||
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MihTextFormField(
|
||||||
controller: contactController,
|
fillColor:
|
||||||
multiLineInput: false,
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
requiredText: true,
|
inputColor:
|
||||||
hintText: "Contact Number",
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
validator: (value) {
|
controller: emailController,
|
||||||
return MihValidationServices().isEmpty(value);
|
multiLineInput: false,
|
||||||
},
|
requiredText: true,
|
||||||
),
|
hintText: "Business Email",
|
||||||
const SizedBox(height: 10),
|
validator: (value) {
|
||||||
MihTextFormField(
|
return MihValidationServices().validateEmail(value);
|
||||||
fillColor:
|
},
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
),
|
||||||
inputColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
const SizedBox(height: 10),
|
||||||
controller: emailController,
|
Row(
|
||||||
multiLineInput: false,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
requiredText: true,
|
children: [
|
||||||
hintText: "Business Email",
|
Flexible(
|
||||||
validator: (value) {
|
child: MihTextFormField(
|
||||||
return MihValidationServices().validateEmail(value);
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
},
|
.theme
|
||||||
),
|
.secondaryColor(),
|
||||||
const SizedBox(height: 10),
|
inputColor:
|
||||||
Row(
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
controller: locationController,
|
||||||
children: [
|
multiLineInput: false,
|
||||||
Flexible(
|
requiredText: true,
|
||||||
child: MihTextFormField(
|
hintText: "GPS Location",
|
||||||
fillColor:
|
),
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: locationController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
hintText: "GPS Location",
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 10.0),
|
||||||
const SizedBox(width: 10.0),
|
MihButton(
|
||||||
MihButton(
|
onPressed: () {
|
||||||
|
MIHLocationAPI().getGPSPosition(context).then((position) {
|
||||||
|
if (position != null) {
|
||||||
|
setState(() {
|
||||||
|
locationController.text =
|
||||||
|
"${position.latitude}, ${position.longitude}";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buttonColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
width: 100,
|
||||||
|
child: Text(
|
||||||
|
"Set",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15),
|
||||||
|
Center(
|
||||||
|
child: MihButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
MIHLocationAPI().getGPSPosition(context).then((position) {
|
if (_formKey.currentState!.validate()) {
|
||||||
if (position != null) {
|
submitForm();
|
||||||
setState(() {
|
}
|
||||||
locationController.text =
|
|
||||||
"${position.latitude}, ${position.longitude}";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
buttonColor:
|
buttonColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
width: 100,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Set",
|
"Update",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
@@ -397,34 +433,12 @@ class _MihBusinessDetailsState extends State<MihBusinessDetails> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15),
|
|
||||||
Center(
|
|
||||||
child: MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
const SizedBox(height: 20),
|
],
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,184 +203,191 @@ 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: Column(
|
child: Padding(
|
||||||
children: [
|
padding: MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
|
||||||
MihForm(
|
? EdgeInsets.symmetric(horizontal: width * 0.2)
|
||||||
formKey: _formKey,
|
: EdgeInsets.symmetric(horizontal: width * 0.075),
|
||||||
formFields: [
|
child: Column(
|
||||||
Center(
|
children: [
|
||||||
child: MihCircleAvatar(
|
MihForm(
|
||||||
imageFile: widget.userProPicImage,
|
formKey: _formKey,
|
||||||
width: 150,
|
formFields: [
|
||||||
editable: false,
|
Center(
|
||||||
fileNameController: fileNameController,
|
child: MihCircleAvatar(
|
||||||
userSelectedfile: userPicFile,
|
imageFile: widget.userProPicImage,
|
||||||
frameColor:
|
width: 150,
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
editable: false,
|
||||||
backgroundColor:
|
fileNameController: fileNameController,
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
userSelectedfile: userPicFile,
|
||||||
onChange: (_) {},
|
frameColor:
|
||||||
),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
),
|
backgroundColor:
|
||||||
Visibility(
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
visible: false,
|
onChange: (_) {},
|
||||||
child: MihTextFormField(
|
|
||||||
fillColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: fileNameController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
readOnly: true,
|
|
||||||
hintText: "Selected File Name",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: titleDropdownController,
|
|
||||||
hintText: "Title",
|
|
||||||
dropdownOptions: const ["Doctor", "Assistant", "Other"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
MihTextFormField(
|
|
||||||
fillColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: titleTextController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
hintText: "Other Title",
|
|
||||||
validator: (value) {
|
|
||||||
return MihValidationServices().isEmpty(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
MihTextFormField(
|
|
||||||
fillColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: fnameController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
readOnly: true,
|
|
||||||
hintText: "First Name",
|
|
||||||
validator: (value) {
|
|
||||||
return MihValidationServices().isEmpty(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
MihTextFormField(
|
|
||||||
fillColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: lnameController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
readOnly: true,
|
|
||||||
hintText: "Surname",
|
|
||||||
validator: (value) {
|
|
||||||
return MihValidationServices().isEmpty(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
MihTextFormField(
|
|
||||||
fillColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: accessController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
hintText: "Access Level",
|
|
||||||
readOnly: true,
|
|
||||||
validator: (value) {
|
|
||||||
return MihValidationServices().isEmpty(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Container(
|
|
||||||
width: 300,
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: const Text(
|
|
||||||
"Signature:",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Visibility(
|
||||||
Center(
|
visible: false,
|
||||||
child: MihImageDisplay(
|
child: MihTextFormField(
|
||||||
imageFile: widget.userSignatureImage,
|
fillColor:
|
||||||
width: 300,
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
height: 200,
|
inputColor:
|
||||||
editable: true,
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
fileNameController: signtureController,
|
controller: fileNameController,
|
||||||
userSelectedfile: userSignatureFile,
|
multiLineInput: false,
|
||||||
onChange: (selectedFile) {
|
requiredText: true,
|
||||||
setState(() {
|
readOnly: true,
|
||||||
userSignatureFile = selectedFile;
|
hintText: "Selected File Name",
|
||||||
});
|
),
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 20),
|
||||||
const SizedBox(height: 10),
|
MIHDropdownField(
|
||||||
Visibility(
|
controller: titleDropdownController,
|
||||||
visible: false,
|
hintText: "Title",
|
||||||
child: MihTextFormField(
|
dropdownOptions: const ["Doctor", "Assistant", "Other"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
enableSearch: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihTextFormField(
|
||||||
fillColor:
|
fillColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
inputColor:
|
inputColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
controller: fileNameController,
|
controller: titleTextController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Other Title",
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: fnameController,
|
||||||
multiLineInput: false,
|
multiLineInput: false,
|
||||||
requiredText: true,
|
requiredText: true,
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
hintText: "Selected Signature File",
|
hintText: "First Name",
|
||||||
),
|
validator: (value) {
|
||||||
),
|
return MihValidationServices().isEmpty(value);
|
||||||
const SizedBox(height: 15),
|
|
||||||
Center(
|
|
||||||
child: MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
if (_formKey.currentState!.validate()) {
|
|
||||||
submitForm();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
buttonColor:
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: lnameController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
readOnly: true,
|
||||||
|
hintText: "Surname",
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: accessController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Access Level",
|
||||||
|
readOnly: true,
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Container(
|
||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
alignment: Alignment.topLeft,
|
||||||
"Update",
|
child: const Text(
|
||||||
|
"Signature:",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
fontSize: 15,
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Center(
|
||||||
const SizedBox(height: 20),
|
child: MihImageDisplay(
|
||||||
],
|
imageFile: widget.userSignatureImage,
|
||||||
),
|
width: 300,
|
||||||
],
|
height: 200,
|
||||||
|
editable: true,
|
||||||
|
fileNameController: signtureController,
|
||||||
|
userSelectedfile: userSignatureFile,
|
||||||
|
onChange: (selectedFile) {
|
||||||
|
setState(() {
|
||||||
|
userSignatureFile = selectedFile;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Visibility(
|
||||||
|
visible: false,
|
||||||
|
child: MihTextFormField(
|
||||||
|
fillColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: fileNameController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
readOnly: true,
|
||||||
|
hintText: "Selected Signature File",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15),
|
||||||
|
Center(
|
||||||
|
child: MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,173 +313,273 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Padding(
|
||||||
children: [
|
padding:
|
||||||
const Text(
|
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
|
||||||
"My Business Details",
|
? EdgeInsets.symmetric(horizontal: width * 0.2)
|
||||||
style: TextStyle(
|
: EdgeInsets.symmetric(horizontal: width * 0.075),
|
||||||
fontWeight: FontWeight.bold,
|
child: Column(
|
||||||
fontSize: 25,
|
children: [
|
||||||
|
const Text(
|
||||||
|
"My Business Details",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 25,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Divider(
|
||||||
Divider(
|
color: MzanziInnovationHub.of(context)!
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor()),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MihForm(
|
|
||||||
formKey: _formKey,
|
|
||||||
formFields: [
|
|
||||||
MihTextFormField(
|
|
||||||
fillColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.secondaryColor(),
|
.secondaryColor()),
|
||||||
inputColor:
|
const SizedBox(height: 10.0),
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MihForm(
|
||||||
controller: regController,
|
formKey: _formKey,
|
||||||
multiLineInput: false,
|
formFields: [
|
||||||
requiredText: true,
|
MihTextFormField(
|
||||||
hintText: "Registration No.",
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
validator: (value) {
|
.theme
|
||||||
return MihValidationServices().isEmpty(value);
|
.secondaryColor(),
|
||||||
},
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
),
|
.theme
|
||||||
const SizedBox(height: 10.0),
|
.primaryColor(),
|
||||||
MihTextFormField(
|
controller: regController,
|
||||||
fillColor: MzanziInnovationHub.of(context)!
|
multiLineInput: false,
|
||||||
.theme
|
requiredText: true,
|
||||||
.secondaryColor(),
|
hintText: "Registration No.",
|
||||||
inputColor:
|
validator: (value) {
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
return MihValidationServices().isEmpty(value);
|
||||||
controller: nameController,
|
},
|
||||||
multiLineInput: false,
|
),
|
||||||
requiredText: true,
|
const SizedBox(height: 10.0),
|
||||||
hintText: "Business Name",
|
MihTextFormField(
|
||||||
validator: (value) {
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
return MihValidationServices().isEmpty(value);
|
.theme
|
||||||
},
|
.secondaryColor(),
|
||||||
),
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
const SizedBox(height: 15.0),
|
.theme
|
||||||
MIHDropdownField(
|
.primaryColor(),
|
||||||
controller: typeController,
|
controller: nameController,
|
||||||
hintText: "Business Type",
|
multiLineInput: false,
|
||||||
dropdownOptions: const ["Doctors Office", "Other"],
|
requiredText: true,
|
||||||
required: true,
|
hintText: "Business Name",
|
||||||
editable: true,
|
validator: (value) {
|
||||||
enableSearch: false,
|
return MihValidationServices().isEmpty(value);
|
||||||
),
|
},
|
||||||
const SizedBox(height: 10.0),
|
),
|
||||||
ValueListenableBuilder(
|
const SizedBox(height: 15.0),
|
||||||
valueListenable: busType,
|
MIHDropdownField(
|
||||||
builder:
|
controller: typeController,
|
||||||
(BuildContext context, String value, Widget? child) {
|
hintText: "Business Type",
|
||||||
return Visibility(
|
dropdownOptions: const ["Doctors Office", "Other"],
|
||||||
visible: value == "Doctors Office",
|
required: true,
|
||||||
child: MihTextFormField(
|
editable: true,
|
||||||
fillColor: MzanziInnovationHub.of(context)!
|
enableSearch: false,
|
||||||
.theme
|
),
|
||||||
.secondaryColor(),
|
const SizedBox(height: 10.0),
|
||||||
inputColor: MzanziInnovationHub.of(context)!
|
ValueListenableBuilder(
|
||||||
.theme
|
valueListenable: busType,
|
||||||
.primaryColor(),
|
builder: (BuildContext context, String value,
|
||||||
controller: practiceNoController,
|
Widget? child) {
|
||||||
multiLineInput: false,
|
return Visibility(
|
||||||
requiredText: true,
|
visible: value == "Doctors Office",
|
||||||
hintText: "Practice Number",
|
child: MihTextFormField(
|
||||||
validator: (validateValue) {
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
if (value == "Doctors Office") {
|
.theme
|
||||||
return MihValidationServices()
|
.secondaryColor(),
|
||||||
.isEmpty(validateValue);
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
}
|
.theme
|
||||||
return null;
|
.primaryColor(),
|
||||||
},
|
controller: practiceNoController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Practice Number",
|
||||||
|
validator: (validateValue) {
|
||||||
|
if (value == "Doctors Office") {
|
||||||
|
return MihValidationServices()
|
||||||
|
.isEmpty(validateValue);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
controller: vatNoController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "VAT Number",
|
||||||
|
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: contactController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Contact Number",
|
||||||
|
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: emailController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Business Email",
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().validateEmail(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
controller: locationController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "GPS Location",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
const SizedBox(width: 10.0),
|
||||||
},
|
MihButton(
|
||||||
),
|
onPressed: () {
|
||||||
const SizedBox(height: 10.0),
|
MIHLocationAPI()
|
||||||
MihTextFormField(
|
.getGPSPosition(context)
|
||||||
fillColor: MzanziInnovationHub.of(context)!
|
.then((position) {
|
||||||
.theme
|
if (position != null) {
|
||||||
.secondaryColor(),
|
setState(() {
|
||||||
inputColor:
|
locationController.text =
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
"${position.latitude}, ${position.longitude}";
|
||||||
controller: vatNoController,
|
});
|
||||||
multiLineInput: false,
|
}
|
||||||
requiredText: true,
|
});
|
||||||
hintText: "VAT Number",
|
},
|
||||||
validator: (value) {
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
return MihValidationServices().isEmpty(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MihTextFormField(
|
|
||||||
fillColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
inputColor:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
controller: contactController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
hintText: "Contact Number",
|
|
||||||
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: emailController,
|
|
||||||
multiLineInput: false,
|
|
||||||
requiredText: true,
|
|
||||||
hintText: "Business Email",
|
|
||||||
validator: (value) {
|
|
||||||
return MihValidationServices().validateEmail(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: MihTextFormField(
|
|
||||||
fillColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.secondaryColor(),
|
.secondaryColor(),
|
||||||
inputColor: MzanziInnovationHub.of(context)!
|
width: 100,
|
||||||
.theme
|
child: Text(
|
||||||
.primaryColor(),
|
"Set",
|
||||||
controller: locationController,
|
style: TextStyle(
|
||||||
multiLineInput: false,
|
color: MzanziInnovationHub.of(context)!
|
||||||
requiredText: true,
|
.theme
|
||||||
hintText: "GPS Location",
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
|
//const SizedBox(height: 15.0),
|
||||||
|
const Center(
|
||||||
|
child: Text(
|
||||||
|
"My Business User",
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 22,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10.0),
|
),
|
||||||
MihButton(
|
Divider(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor()),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: titleController,
|
||||||
|
hintText: "Title",
|
||||||
|
dropdownOptions: const ["Doctor", "Assistant"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
enableSearch: false,
|
||||||
|
),
|
||||||
|
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: "Surname",
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: accessController,
|
||||||
|
hintText: "Access",
|
||||||
|
dropdownOptions: const ["Full", "Partial"],
|
||||||
|
required: true,
|
||||||
|
editable: false,
|
||||||
|
enableSearch: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20.0),
|
||||||
|
Center(
|
||||||
|
child: MihButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
MIHLocationAPI()
|
if (_formKey.currentState!.validate()) {
|
||||||
.getGPSPosition(context)
|
submitForm();
|
||||||
.then((position) {
|
}
|
||||||
if (position != null) {
|
|
||||||
setState(() {
|
|
||||||
locationController.text =
|
|
||||||
"${position.latitude}, ${position.longitude}";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
.theme
|
.theme
|
||||||
.secondaryColor(),
|
.secondaryColor(),
|
||||||
width: 100,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Set",
|
"Add",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MzanziInnovationHub.of(context)!
|
color: MzanziInnovationHub.of(context)!
|
||||||
.theme
|
.theme
|
||||||
@@ -489,98 +589,11 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
//const SizedBox(height: 15.0),
|
|
||||||
const Center(
|
|
||||||
child: Text(
|
|
||||||
"My Business User",
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 22,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
Divider(
|
),
|
||||||
color: MzanziInnovationHub.of(context)!
|
],
|
||||||
.theme
|
),
|
||||||
.secondaryColor()),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: titleController,
|
|
||||||
hintText: "Title",
|
|
||||||
dropdownOptions: const ["Doctor", "Assistant"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
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: "Surname",
|
|
||||||
validator: (value) {
|
|
||||||
return MihValidationServices().isEmpty(value);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: accessController,
|
|
||||||
hintText: "Access",
|
|
||||||
dropdownOptions: const ["Full", "Partial"],
|
|
||||||
required: true,
|
|
||||||
editable: false,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 20.0),
|
|
||||||
Center(
|
|
||||||
child: MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
if (_formKey.currentState!.validate()) {
|
|
||||||
submitForm();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
width: 300,
|
|
||||||
child: Text(
|
|
||||||
"Add",
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.primaryColor(),
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user