Mzansi Personal Profile

This commit is contained in:
2025-03-17 10:12:44 +02:00
parent 98d3e00c53
commit 36652e42cf

View File

@@ -245,117 +245,123 @@ class _MihPersonalProfileState extends State<MihPersonalProfile> {
}
Widget getBody() {
return Column(
children: [
//displayProPic(),
MIHProfilePicture(
profilePictureFile: widget.arguments.propicFile,
proPicController: proPicController,
proPic: proPic,
width: 155,
radius: 70,
drawerMode: false,
editable: true,
onChange: (newProPic) {
setState(() {
proPic = newProPic;
});
},
),
const SizedBox(height: 25.0),
Visibility(
visible: false,
child: MIHFileField(
controller: proPicController,
hintText: "Profile Picture",
editable: false,
required: false,
onPressed: () async {
FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.custom,
allowedExtensions: ['jpg', 'png'],
);
if (result == null) return;
final selectedFile = result.files.first;
setState(() {
proPic = selectedFile;
propicPreview = MemoryImage(proPic!.bytes!);
});
setState(() {
proPicController.text = selectedFile.name;
});
},
),
),
// const SizedBox(height: 10.0),
// MIHTextField(
// controller: proPicController,
// hintText: "Pro Pic",
// editable: true,
// required: true,
// ),
const SizedBox(height: 10.0),
MIHTextField(
controller: usernameController,
hintText: "Username",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: fnameController,
hintText: "First Name",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: lnameController,
hintText: "Last Name",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
return SafeArea(
child: SingleChildScrollView(
child: Column(
children: [
const Text(
"Activate Business Account",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
),
),
const SizedBox(
width: 10,
),
Switch(
value: businessUser,
onChanged: (bool value) {
//displayProPic(),
MIHProfilePicture(
profilePictureFile: widget.arguments.propicFile,
proPicController: proPicController,
proPic: proPic,
width: 155,
radius: 70,
drawerMode: false,
editable: true,
onChange: (newProPic) {
setState(() {
businessUser = value;
proPic = newProPic;
});
},
),
const SizedBox(height: 25.0),
Visibility(
visible: false,
child: MIHFileField(
controller: proPicController,
hintText: "Profile Picture",
editable: false,
required: false,
onPressed: () async {
FilePickerResult? result =
await FilePicker.platform.pickFiles(
type: FileType.custom,
allowedExtensions: ['jpg', 'png'],
);
if (result == null) return;
final selectedFile = result.files.first;
setState(() {
proPic = selectedFile;
propicPreview = MemoryImage(proPic!.bytes!);
});
setState(() {
proPicController.text = selectedFile.name;
});
},
),
),
// const SizedBox(height: 10.0),
// MIHTextField(
// controller: proPicController,
// hintText: "Pro Pic",
// editable: true,
// required: true,
// ),
const SizedBox(height: 10.0),
MIHTextField(
controller: usernameController,
hintText: "Username",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: fnameController,
hintText: "First Name",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
MIHTextField(
controller: lnameController,
hintText: "Last Name",
editable: true,
required: true,
),
const SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
"Activate Business Account",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
),
),
const SizedBox(
width: 10,
),
Switch(
value: businessUser,
onChanged: (bool value) {
setState(() {
businessUser = value;
});
},
),
],
),
const SizedBox(height: 30.0),
SizedBox(
width: 500.0,
height: 50.0,
child: MIHButton(
buttonText: "Update",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
onTap: () {
submitForm();
},
),
),
],
),
const SizedBox(height: 30.0),
SizedBox(
width: 500.0,
height: 50.0,
child: MIHButton(
buttonText: "Update",
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
textColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
onTap: () {
submitForm();
},
),
),
],
),
);
}
}