From 5d4c36626b743415f75e15f9fc6b172a58c58683 Mon Sep 17 00:00:00 2001 From: Yasien Mac Mini Date: Thu, 10 Jul 2025 11:17:23 +0200 Subject: [PATCH] add defualt text --- .../mih_personal_profile_preview.dart | 62 ++++++++++--------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/Frontend/lib/mih_components/mih_package_components/mih_personal_profile_preview.dart b/Frontend/lib/mih_components/mih_package_components/mih_personal_profile_preview.dart index cdc8850a..8e7ee029 100644 --- a/Frontend/lib/mih_components/mih_package_components/mih_personal_profile_preview.dart +++ b/Frontend/lib/mih_components/mih_package_components/mih_personal_profile_preview.dart @@ -36,53 +36,57 @@ class _MihPersonalProfilePreviewState extends State { return Row( children: [ FutureBuilder( - future: futureImageUrl, - builder: (context, asyncSnapshot) { - if (asyncSnapshot.connectionState == ConnectionState.done && - asyncSnapshot.hasData) { - 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(), - ); - } + future: futureImageUrl, + builder: (context, asyncSnapshot) { + if (asyncSnapshot.connectionState == ConnectionState.done && + asyncSnapshot.hasData) { + 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.mihRing, + MihIcons.iDontKnow, size: profilePictureWidth, color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), ); } - }), + } else { + return Icon( + MihIcons.mihRing, + size: profilePictureWidth, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ); + } + }, + ), const SizedBox(width: 15), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget.user.username, + widget.user.username.isNotEmpty + ? widget.user.username + : "Username", style: TextStyle( fontWeight: FontWeight.bold, fontSize: 18, ), ), Text( - "${widget.user.fname} ${widget.user.lname}", + widget.user.fname.isNotEmpty + ? "${widget.user.fname} ${widget.user.lname}" + : "Name Surname", style: TextStyle( fontWeight: FontWeight.bold, fontSize: 15,