From 4f12901cb6cb346733888b9dea30e56ffec6de23 Mon Sep 17 00:00:00 2001 From: Fahed Khan <127182880+12fahed@users.noreply.github.com> Date: Fri, 26 Jul 2024 00:11:50 +0530 Subject: [PATCH] null or "na" logic fixed in faculty profile --- .../widgets/faculty_details_section.dart | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/lib/screens/department_screen/widgets/faculty_details_section.dart b/lib/screens/department_screen/widgets/faculty_details_section.dart index 099a21c..f357af5 100644 --- a/lib/screens/department_screen/widgets/faculty_details_section.dart +++ b/lib/screens/department_screen/widgets/faculty_details_section.dart @@ -256,28 +256,31 @@ class ExpandedFacultyCard extends StatelessWidget { spacing: 5, runSpacing: 5, children: [ - IconWithChipText( - assetPath: 'assets/images/icons/qualifications.png', - text: qualification, - ), - IconWithChipText( - assetPath: 'assets/images/icons/experience.png', - text: experience, - ), - Row( - children: [ - const Icon( - Icons.star, - size: 22, - color: Color(0xff1FAFA4), - ), - SizedBox(width: 5), - ChipStyledText( - text: specialization, - width: size.width*.7, - ), - ], - ), + if (qualification.isNotEmpty && qualification.toLowerCase() != 'na') + IconWithChipText( + assetPath: 'assets/images/icons/qualifications.png', + text: qualification, + ), + if (experience.isNotEmpty && experience.toLowerCase() != 'na') + IconWithChipText( + assetPath: 'assets/images/icons/experience.png', + text: experience, + ), + if (specialization.isNotEmpty && specialization.toLowerCase() != 'na') + Row( + children: [ + const Icon( + Icons.star, + size: 22, + color: Color(0xff1FAFA4), + ), + SizedBox(width: 5), + ChipStyledText( + text: specialization, + width: size.width * .7, + ), + ], + ), ], ), ),