From aba178f2e5b6a08e50e8e85b339a5fa85f340b9d Mon Sep 17 00:00:00 2001 From: yaso Date: Wed, 30 Oct 2024 12:53:17 +0200 Subject: [PATCH] add drawer mode to paramenter --- .../lib/mih_components/mih_profile_picture.dart | 11 +++++++++-- .../lib/mih_packages/mih_home/mih_home.dart | 1 + .../mzansi_profile/profile_user_update.dart | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Frontend/patient_manager/lib/mih_components/mih_profile_picture.dart b/Frontend/patient_manager/lib/mih_components/mih_profile_picture.dart index d0171909..2a5916a7 100644 --- a/Frontend/patient_manager/lib/mih_components/mih_profile_picture.dart +++ b/Frontend/patient_manager/lib/mih_components/mih_profile_picture.dart @@ -10,6 +10,7 @@ class MIHProfilePicture extends StatefulWidget { PlatformFile? proPic; final double width; final double radius; + final bool drawerMode; final bool editable; final onChange; MIHProfilePicture({ @@ -19,6 +20,7 @@ class MIHProfilePicture extends StatefulWidget { required this.proPic, required this.width, required this.radius, + required this.drawerMode, required this.editable, required this.onChange, }); @@ -32,8 +34,13 @@ class _MIHProfilePictureState extends State { //late PlatformFile proPic; Widget displayEditableProPic() { - ImageProvider logoFrame = - MzanziInnovationHub.of(context)!.theme.altLogoFrame(); + ImageProvider logoFrame; + if (!widget.drawerMode) { + logoFrame = MzanziInnovationHub.of(context)!.theme.altLogoFrame(); + } else { + logoFrame = MzanziInnovationHub.of(context)!.theme.logoFrame(); + } + if (widget.profilePictureFile != null) { return Stack( alignment: Alignment.center, diff --git a/Frontend/patient_manager/lib/mih_packages/mih_home/mih_home.dart b/Frontend/patient_manager/lib/mih_packages/mih_home/mih_home.dart index c4f5a25b..f10006a1 100644 --- a/Frontend/patient_manager/lib/mih_packages/mih_home/mih_home.dart +++ b/Frontend/patient_manager/lib/mih_packages/mih_home/mih_home.dart @@ -568,6 +568,7 @@ class _MIHHomeState extends State { proPic: null, width: 45, radius: 21, + drawerMode: false, editable: false, onChange: (newProPic) {}, ), diff --git a/Frontend/patient_manager/lib/mih_packages/mzansi_profile/profile_user_update.dart b/Frontend/patient_manager/lib/mih_packages/mzansi_profile/profile_user_update.dart index 8737136f..42599902 100644 --- a/Frontend/patient_manager/lib/mih_packages/mzansi_profile/profile_user_update.dart +++ b/Frontend/patient_manager/lib/mih_packages/mzansi_profile/profile_user_update.dart @@ -274,6 +274,7 @@ class _ProfileUserUpdateState extends State { proPic: proPic, width: 155, radius: 70, + drawerMode: false, editable: true, onChange: (newProPic) { setState(() {