Add new mih text form field to Set Up Business
This commit is contained in:
@@ -6,13 +6,15 @@ import 'package:mzansi_innovation_hub/mih_apis/mih_business_details_apis.dart';
|
|||||||
import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart';
|
import 'package:mzansi_innovation_hub/mih_apis/mih_file_api.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_apis/mih_location_api.dart';
|
import 'package:mzansi_innovation_hub/mih_apis/mih_location_api.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_apis/mih_my_business_user_apis.dart';
|
import 'package:mzansi_innovation_hub/mih_apis/mih_my_business_user_apis.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_action.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_body.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_header.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_layout_builder.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_button.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_success_message.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
import 'package:mzansi_innovation_hub/mih_env/env.dart';
|
||||||
@@ -60,6 +62,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
PlatformFile? selectedSignature;
|
PlatformFile? selectedSignature;
|
||||||
|
|
||||||
final ValueNotifier<String> busType = ValueNotifier("");
|
final ValueNotifier<String> busType = ValueNotifier("");
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
late String env;
|
late String env;
|
||||||
|
|
||||||
// Future<void> uploadSelectedFile(
|
// Future<void> uploadSelectedFile(
|
||||||
@@ -217,17 +220,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isFieldsFilled() {
|
bool isFieldsFilled() {
|
||||||
if (nameController.text.isEmpty ||
|
if (typeController.text.isEmpty ||
|
||||||
typeController.text.isEmpty ||
|
|
||||||
regController.text.isEmpty ||
|
|
||||||
// logonameController.text.isEmpty ||
|
|
||||||
fnameController.text.isEmpty ||
|
|
||||||
lnameController.text.isEmpty ||
|
|
||||||
titleController.text.isEmpty ||
|
titleController.text.isEmpty ||
|
||||||
// signtureController.text.isEmpty ||
|
accessController.text.isEmpty) {
|
||||||
accessController.text.isEmpty ||
|
|
||||||
contactController.text.isEmpty ||
|
|
||||||
emailController.text.isEmpty) {
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
@@ -235,9 +230,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void submitForm() {
|
void submitForm() {
|
||||||
if (!isEmailValid()) {
|
if (isFieldsFilled()) {
|
||||||
emailError();
|
|
||||||
} else if (isFieldsFilled()) {
|
|
||||||
print("Inside submit method");
|
print("Inside submit method");
|
||||||
createBusinessProfileAPICall();
|
createBusinessProfileAPICall();
|
||||||
} else {
|
} else {
|
||||||
@@ -306,7 +299,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
|
|
||||||
MIHBody getBody() {
|
MIHBody getBody() {
|
||||||
return MIHBody(
|
return MIHBody(
|
||||||
borderOn: true,
|
borderOn: false,
|
||||||
bodyItems: [
|
bodyItems: [
|
||||||
KeyboardListener(
|
KeyboardListener(
|
||||||
focusNode: _focusNode,
|
focusNode: _focusNode,
|
||||||
@@ -314,13 +307,14 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
onKeyEvent: (event) async {
|
onKeyEvent: (event) async {
|
||||||
if (event is KeyDownEvent &&
|
if (event is KeyDownEvent &&
|
||||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||||
submitForm();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
submitForm();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
//const SizedBox(height: 15),
|
|
||||||
const Text(
|
const Text(
|
||||||
"My Business Details",
|
"My Business Details",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -333,223 +327,314 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
|||||||
.theme
|
.theme
|
||||||
.secondaryColor()),
|
.secondaryColor()),
|
||||||
const SizedBox(height: 10.0),
|
const SizedBox(height: 10.0),
|
||||||
// MihCircleAvatar(
|
MihForm(
|
||||||
// imageFile: logoPreview,
|
formKey: _formKey,
|
||||||
// width: 150,
|
formFields: [
|
||||||
// editable: true,
|
MihTextFormField(
|
||||||
// fileNameController: logonameController,
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
// userSelectedfile: selectedLogo,
|
|
||||||
// frameColor:
|
|
||||||
// MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
// backgroundColor:
|
|
||||||
// MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
// onChange: (selectedfile) {
|
|
||||||
// setState(() {
|
|
||||||
// selectedLogo = selectedfile;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 10.0),
|
|
||||||
// Visibility(
|
|
||||||
// visible: true,
|
|
||||||
// child: MIHTextField(
|
|
||||||
// controller: logonameController,
|
|
||||||
// hintText: "Selected Logo File Name",
|
|
||||||
// editable: false,
|
|
||||||
// required: true,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: regController,
|
|
||||||
hintText: "Registration No.",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: nameController,
|
|
||||||
hintText: "Business Name",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: typeController,
|
|
||||||
hintText: "Business Type",
|
|
||||||
dropdownOptions: const ["Doctors Office", "Other"],
|
|
||||||
required: true,
|
|
||||||
editable: true,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
ValueListenableBuilder(
|
|
||||||
valueListenable: busType,
|
|
||||||
builder: (BuildContext context, String value, Widget? child) {
|
|
||||||
return Visibility(
|
|
||||||
visible: value == "Doctors Office",
|
|
||||||
child: MIHTextField(
|
|
||||||
controller: practiceNoController,
|
|
||||||
hintText: "Practice Number",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: vatNoController,
|
|
||||||
hintText: "VAT Number",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: contactController,
|
|
||||||
hintText: "Contact Number",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: emailController,
|
|
||||||
hintText: "Email",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
// MIHFileField(
|
|
||||||
// controller: logonameController,
|
|
||||||
// hintText: "Logo",
|
|
||||||
// editable: false,
|
|
||||||
// required: true,
|
|
||||||
// onPressed: () async {
|
|
||||||
// FilePickerResult? result =
|
|
||||||
// await FilePicker.platform.pickFiles(
|
|
||||||
// type: FileType.custom,
|
|
||||||
// allowedExtensions: ['jpg', 'png', 'pdf'],
|
|
||||||
// );
|
|
||||||
// if (result == null) return;
|
|
||||||
// final selectedFile = result.files.first;
|
|
||||||
// setState(() {
|
|
||||||
// selectedLogo = selectedFile;
|
|
||||||
// });
|
|
||||||
// setState(() {
|
|
||||||
// logonameController.text = selectedFile.name;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: MIHTextField(
|
|
||||||
controller: locationController,
|
|
||||||
hintText: "Location",
|
|
||||||
editable: false,
|
|
||||||
required: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10.0),
|
|
||||||
MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
MIHLocationAPI()
|
|
||||||
.getGPSPosition(context)
|
|
||||||
.then((position) {
|
|
||||||
if (position != null) {
|
|
||||||
setState(() {
|
|
||||||
locationController.text =
|
|
||||||
"${position.latitude}, ${position.longitude}";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
buttonColor: MzanziInnovationHub.of(context)!
|
|
||||||
.theme
|
.theme
|
||||||
.secondaryColor(),
|
.secondaryColor(),
|
||||||
width: 100,
|
inputColor:
|
||||||
child: Text(
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
"Set",
|
controller: regController,
|
||||||
style: TextStyle(
|
multiLineInput: false,
|
||||||
color: MzanziInnovationHub.of(context)!
|
requiredText: true,
|
||||||
|
hintText: "Registration No.",
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: regController,
|
||||||
|
// hintText: "Registration No.",
|
||||||
|
// editable: true,
|
||||||
|
// required: true,
|
||||||
|
// ),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: nameController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Business Name",
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: nameController,
|
||||||
|
// hintText: "Business Name",
|
||||||
|
// editable: true,
|
||||||
|
// required: true,
|
||||||
|
// ),
|
||||||
|
const SizedBox(height: 15.0),
|
||||||
|
MIHDropdownField(
|
||||||
|
controller: typeController,
|
||||||
|
hintText: "Business Type",
|
||||||
|
dropdownOptions: const ["Doctors Office", "Other"],
|
||||||
|
required: true,
|
||||||
|
editable: true,
|
||||||
|
enableSearch: false,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10.0),
|
||||||
|
ValueListenableBuilder(
|
||||||
|
valueListenable: busType,
|
||||||
|
builder:
|
||||||
|
(BuildContext context, String value, Widget? child) {
|
||||||
|
return Visibility(
|
||||||
|
visible: value == "Doctors Office",
|
||||||
|
child: MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
controller: practiceNoController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Practice Number",
|
||||||
|
validator: (validateValue) {
|
||||||
|
if (value == "Doctors Office") {
|
||||||
|
return MihValidationServices()
|
||||||
|
.isEmpty(validateValue);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: practiceNoController,
|
||||||
|
// hintText: "Practice Number",
|
||||||
|
// editable: true,
|
||||||
|
// required: true,
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
},
|
||||||
|
),
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: vatNoController,
|
||||||
|
// hintText: "VAT Number",
|
||||||
|
// editable: true,
|
||||||
|
// required: true,
|
||||||
|
// ),
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: contactController,
|
||||||
|
// hintText: "Contact Number",
|
||||||
|
// editable: true,
|
||||||
|
// required: true,
|
||||||
|
// ),
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: emailController,
|
||||||
|
// hintText: "Email",
|
||||||
|
// editable: true,
|
||||||
|
// required: true,
|
||||||
|
// ),
|
||||||
|
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",
|
||||||
|
),
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: locationController,
|
||||||
|
// hintText: "Location",
|
||||||
|
// editable: false,
|
||||||
|
// required: false,
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10.0),
|
||||||
|
MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
MIHLocationAPI()
|
||||||
|
.getGPSPosition(context)
|
||||||
|
.then((position) {
|
||||||
|
if (position != null) {
|
||||||
|
setState(() {
|
||||||
|
locationController.text =
|
||||||
|
"${position.latitude}, ${position.longitude}";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
.theme
|
.theme
|
||||||
.primaryColor(),
|
.secondaryColor(),
|
||||||
fontSize: 20,
|
width: 100,
|
||||||
|
child: Text(
|
||||||
|
"Set",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.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,
|
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);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: fnameController,
|
||||||
|
// hintText: "Name",
|
||||||
|
// editable: false,
|
||||||
|
// required: true,
|
||||||
|
// ),
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// MIHTextField(
|
||||||
|
// controller: lnameController,
|
||||||
|
// hintText: "Surname",
|
||||||
|
// editable: false,
|
||||||
|
// required: true,
|
||||||
|
// ),
|
||||||
|
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,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
Divider(
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)?.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
//const SizedBox(height: 15.0),
|
|
||||||
const 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),
|
|
||||||
MIHTextField(
|
|
||||||
controller: fnameController,
|
|
||||||
hintText: "Name",
|
|
||||||
editable: false,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10.0),
|
|
||||||
MIHTextField(
|
|
||||||
controller: lnameController,
|
|
||||||
hintText: "Surname",
|
|
||||||
editable: false,
|
|
||||||
required: true,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 15.0),
|
|
||||||
MIHDropdownField(
|
|
||||||
controller: accessController,
|
|
||||||
hintText: "Access",
|
|
||||||
dropdownOptions: const ["Full", "Partial"],
|
|
||||||
required: true,
|
|
||||||
editable: false,
|
|
||||||
enableSearch: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 30.0),
|
|
||||||
MihButton(
|
|
||||||
onPressed: () {
|
|
||||||
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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user