update business user edit workflow

This commit is contained in:
2026-02-18 10:56:34 +02:00
parent f137ea41ac
commit 3f0fc08a5c
2 changed files with 245 additions and 208 deletions

View File

@@ -5,7 +5,6 @@ import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_env.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_circle_avatar.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_image_display.dart';
import 'package:mzansi_innovation_hub/mih_package_components/mih_package_window.dart';
@@ -133,27 +132,29 @@ class _MihUpdateMyBusinessUserDetailsState
MzansiInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.2)
: EdgeInsets.symmetric(horizontal: width * 0.075),
child: Column(
child: Stack(
children: [
Column(
children: [
MihForm(
formKey: _formKey,
formFields: [
Center(
child: MihCircleAvatar(
imageFile: mzansiProfileProvider.userProfilePicture,
width: 150,
editable: false,
fileNameController: fileNameController,
userSelectedfile: userPicFile,
frameColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
backgroundColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
onChange: (_) {},
),
),
// Center(
// child: MihCircleAvatar(
// imageFile: mzansiProfileProvider.userProfilePicture,
// width: 150,
// editable: false,
// fileNameController: fileNameController,
// userSelectedfile: userPicFile,
// frameColor: MihColors.getSecondaryColor(
// MzansiInnovationHub.of(context)!.theme.mode ==
// "Dark"),
// backgroundColor: MihColors.getPrimaryColor(
// MzansiInnovationHub.of(context)!.theme.mode ==
// "Dark"),
// onChange: (_) {},
// ),
// ),
Visibility(
visible: false,
child: MihTextFormField(
@@ -302,7 +303,9 @@ class _MihUpdateMyBusinessUserDetailsState
"Update",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
MzansiInnovationHub.of(context)!
.theme
.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
@@ -315,6 +318,35 @@ class _MihUpdateMyBusinessUserDetailsState
),
],
),
Positioned(
top: 0,
right: 0,
child: MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
submitForm(mzansiProfileProvider);
} else {
MihAlertServices().inputErrorAlert(context);
}
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 100,
height: 25,
child: Text(
"Update",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 15,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
);
},

View File

@@ -184,7 +184,9 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
child: Column(
children: [
Center(
child: MihCircleAvatar(
child: Stack(
children: [
MihCircleAvatar(
imageFile: mzansiProfileProvider.userProfilePicture,
width: 150,
editable: false,
@@ -198,6 +200,31 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
"Dark"),
onChange: (_) {},
),
Positioned(
bottom: 5,
right: 5,
child: MihButton(
onPressed: () {
editBizUserProfileWindow(
mzansiProfileProvider, width);
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
width: 35,
height: 35,
child: Icon(
Icons.edit,
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!
.theme
.mode ==
"Dark"),
),
),
),
],
),
),
const SizedBox(height: 20),
buildEmployeeInfoCard(mzansiProfileProvider),
@@ -246,28 +273,6 @@ class _MihMyBusinessUserState extends State<MihMyBusinessUser> {
),
),
const SizedBox(height: 20),
Center(
child: MihButton(
onPressed: () {
editBizUserProfileWindow(
mzansiProfileProvider, width);
},
buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
width: 300,
child: Text(
"Edit Profile",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),