From 69a8cd00055f4f3d6ec3ab3514fe6411848730b7 Mon Sep 17 00:00:00 2001 From: yaso Date: Thu, 7 Nov 2024 09:55:58 +0200 Subject: [PATCH] Show selected option in business profile --- .../manage_business_profile.dart | 84 ++++++++++++++++--- 1 file changed, 73 insertions(+), 11 deletions(-) diff --git a/Frontend/patient_manager/lib/mih_packages/manage_business/manage_business_profile.dart b/Frontend/patient_manager/lib/mih_packages/manage_business/manage_business_profile.dart index 00645fa2..eb6837e3 100644 --- a/Frontend/patient_manager/lib/mih_packages/manage_business/manage_business_profile.dart +++ b/Frontend/patient_manager/lib/mih_packages/manage_business/manage_business_profile.dart @@ -273,6 +273,9 @@ class _ManageBusinessProfileState extends State { } Widget showSelection(int selectionIndex) { + // if (selectionIndex == 0) { + // return BusinessDetails(arguments: widget.arguments); + // } else if (selectionIndex == 0) { return BusinessDetails(arguments: widget.arguments); } else if (selectionIndex == 1) { @@ -304,19 +307,49 @@ class _ManageBusinessProfileState extends State { return MIHHeader( headerAlignment: MainAxisAlignment.end, headerItems: [ - IconButton( - onPressed: () { - setState(() { - selectionIndex = 0; - }); - }, - icon: const Icon( - Icons.business, - size: 35, + // IconButton( + // onPressed: () { + // setState(() { + // selectionIndex = 0; + // }); + // }, + // icon: const Icon( + // Icons.info_outline, + // size: 35, + // ), + // ), + //============ Business Details ================ + Visibility( + visible: selectionIndex != 0, + child: IconButton( + onPressed: () { + setState(() { + selectionIndex = 0; + }); + }, + icon: const Icon( + Icons.business, + size: 35, + ), ), ), Visibility( - visible: isFullAccess, + visible: selectionIndex == 0, + child: IconButton.filled( + onPressed: () { + setState(() { + selectionIndex = 0; + }); + }, + icon: const Icon( + Icons.business, + size: 35, + ), + ), + ), + //============ Team Manager ================ + Visibility( + visible: isFullAccess && selectionIndex != 1, child: IconButton( onPressed: () { setState(() { @@ -330,7 +363,22 @@ class _ManageBusinessProfileState extends State { ), ), Visibility( - visible: isFullAccess, + visible: isFullAccess && selectionIndex == 1, + child: IconButton.filled( + onPressed: () { + setState(() { + selectionIndex = 1; + }); + }, + icon: const Icon( + Icons.people_outline, + size: 35, + ), + ), + ), + //============ Add Team member ================ + Visibility( + visible: isFullAccess && selectionIndex != 2, child: IconButton( onPressed: () { setState(() { @@ -343,6 +391,20 @@ class _ManageBusinessProfileState extends State { ), ), ), + Visibility( + visible: isFullAccess && selectionIndex == 2, + child: IconButton.filled( + onPressed: () { + setState(() { + selectionIndex = 2; + }); + }, + icon: const Icon( + Icons.add, + size: 35, + ), + ), + ), ], ); }