From ab8b722e5e7a719898ecd412deb0a681566c358c Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Thu, 10 Jul 2025 10:16:52 +0200 Subject: [PATCH] Align business preview to personal preview --- .../mih_business_profile_preview.dart | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/Frontend/lib/mih_components/mih_package_components/mih_business_profile_preview.dart b/Frontend/lib/mih_components/mih_package_components/mih_business_profile_preview.dart index 5c7359d0..8cba8112 100644 --- a/Frontend/lib/mih_components/mih_package_components/mih_business_profile_preview.dart +++ b/Frontend/lib/mih_components/mih_package_components/mih_business_profile_preview.dart @@ -49,21 +49,30 @@ class _MihBusinessProfilePreviewState extends State { builder: (context, asyncSnapshot) { if (asyncSnapshot.connectionState == ConnectionState.done && asyncSnapshot.hasData) { - return MihCircleAvatar( - imageFile: NetworkImage(asyncSnapshot.requireData), - width: profilePictureWidth, - editable: false, - fileNameController: TextEditingController(), - userSelectedfile: file, - frameColor: - MzanziInnovationHub.of(context)!.theme.secondaryColor(), - backgroundColor: - MzanziInnovationHub.of(context)!.theme.primaryColor(), - onChange: () {}, - ); + if (asyncSnapshot.requireData != "") { + return MihCircleAvatar( + imageFile: NetworkImage(asyncSnapshot.requireData), + width: profilePictureWidth, + editable: false, + fileNameController: TextEditingController(), + userSelectedfile: file, + frameColor: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + backgroundColor: + MzanziInnovationHub.of(context)!.theme.primaryColor(), + onChange: () {}, + ); + } else { + return Icon( + MihIcons.iDontKnow, + size: profilePictureWidth, + color: + MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ); + } } else { return Icon( - MihIcons.iDontKnow, + MihIcons.mihRing, size: profilePictureWidth, ); } @@ -79,13 +88,20 @@ class _MihBusinessProfilePreviewState extends State { fontSize: 18, ), ), + Text( + widget.business.type, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), Text( widget.myLocation != null || widget.myLocation!.isEmpty ? calculateDistance() : "0.00 km", style: TextStyle( fontWeight: FontWeight.bold, - fontSize: 12, + fontSize: 10, ), ), ],