Vaibhav_Feature-#541 #52

Merged
umesh.desai merged 39 commits from Vaibhav_Feature-#541 into main 2025-07-11 07:39:26 +00:00
Showing only changes of commit 56b493c909 - Show all commits

View File

@ -311,56 +311,63 @@ class DirectoryMainScreen extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10), horizontal: 12.0, vertical: 10),
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// Top Row: Avatar, Info, Icons // Leading Icon
Row( Avatar(
crossAxisAlignment: CrossAxisAlignment.start, firstName: firstName,
children: [ lastName: lastName,
// Avatar size: 45,
Avatar( ),
firstName: firstName, MySpacing.width(12),
lastName: lastName,
size: 35),
MySpacing.width(12),
// Middle: Contact Info (wrap with Flexible instead of Expanded) // Middle Content
Flexible( Expanded(
fit: FlexFit.tight, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
children: [
MyText.titleSmall(
contact.name,
fontWeight: 600,
overflow: TextOverflow.ellipsis,
),
MyText.bodySmall(
contact.organization,
color: Colors.grey[700],
overflow: TextOverflow.ellipsis,
),
MySpacing.height(6),
// Launcher Row
Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
MyText.titleSmall(contact.name,
fontWeight: 600,
overflow: TextOverflow.ellipsis),
MyText.bodySmall(contact.organization,
color: Colors.grey[700],
overflow: TextOverflow.ellipsis),
MySpacing.height(6),
// Emails
...contact.contactEmails.map((e) => ...contact.contactEmails.map((e) =>
Padding( GestureDetector(
padding: const EdgeInsets.only( onTap: () =>
bottom: 4), LauncherUtils.launchEmail(
child: GestureDetector( e.emailAddress),
onTap: () => onLongPress: () =>
LauncherUtils.launchEmail( LauncherUtils.copyToClipboard(
e.emailAddress), e.emailAddress,
onLongPress: () => typeLabel: 'Email'),
LauncherUtils.copyToClipboard( child: Padding(
e.emailAddress, padding: const EdgeInsets.only(
typeLabel: 'Email'), bottom: 4),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min,
children: [ children: [
const Icon( const Icon(
Icons.email_outlined, Icons.email_outlined,
size: 16, size: 16,
color: Colors.indigo), color: Colors.indigo),
MySpacing.width(4), MySpacing.width(4),
Flexible( ConstrainedBox(
constraints:
const BoxConstraints(
maxWidth: 180),
child: MyText.labelSmall( child: MyText.labelSmall(
e.emailAddress, e.emailAddress,
overflow: overflow:
@ -374,29 +381,30 @@ class DirectoryMainScreen extends StatelessWidget {
), ),
), ),
)), )),
// Phones
...contact.contactPhones.map((p) => ...contact.contactPhones.map((p) =>
Padding( GestureDetector(
padding: const EdgeInsets.only( onTap: () =>
bottom: 4), LauncherUtils.launchPhone(
child: GestureDetector( p.phoneNumber),
onTap: () => onLongPress: () =>
LauncherUtils.launchPhone( LauncherUtils.copyToClipboard(
p.phoneNumber), p.phoneNumber,
onLongPress: () => typeLabel: 'Phone number'),
LauncherUtils.copyToClipboard( child: Padding(
p.phoneNumber, padding: const EdgeInsets.only(
typeLabel: bottom: 4),
'Phone number'),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min,
children: [ children: [
const Icon( const Icon(
Icons.phone_outlined, Icons.phone_outlined,
size: 16, size: 16,
color: Colors.indigo), color: Colors.indigo),
MySpacing.width(4), MySpacing.width(4),
Flexible( ConstrainedBox(
constraints:
const BoxConstraints(
maxWidth: 160),
child: MyText.labelSmall( child: MyText.labelSmall(
p.phoneNumber, p.phoneNumber,
overflow: overflow:
@ -412,62 +420,38 @@ class DirectoryMainScreen extends StatelessWidget {
)), )),
], ],
), ),
),
// Right: Arrow + WhatsApp if (tags.isNotEmpty) ...[
MySpacing.width( MySpacing.height(4),
8), // spacing between content and right column MyText.labelSmall(
Column( tags.join(', '),
crossAxisAlignment: CrossAxisAlignment.end, color: Colors.grey[500],
children: [ maxLines: 1,
const Icon(Icons.arrow_forward_ios, overflow: TextOverflow.ellipsis,
color: Colors.grey, size: 16), ),
MySpacing.height(12),
if (phone != '-')
GestureDetector(
onTap: () =>
LauncherUtils.launchWhatsApp(phone),
child: const FaIcon(
FontAwesomeIcons.whatsapp,
color: Colors.green,
size: 20),
),
], ],
), ],
),
),
// WhatsApp launcher icon
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Icon(Icons.arrow_forward_ios,
color: Colors.grey, size: 16),
MySpacing.height(12),
if (phone != '-')
GestureDetector(
onTap: () =>
LauncherUtils.launchWhatsApp(phone),
child: const FaIcon(
FontAwesomeIcons.whatsapp,
color: Colors.green,
size: 20,
),
),
], ],
), ),
// Bottom Row: Tags as chips aligned to right
if (tags.isNotEmpty) ...[
MySpacing.height(5),
Align(
alignment: Alignment.centerRight,
child: Wrap(
spacing: 8,
runSpacing: 6,
alignment: WrapAlignment.end,
children: tags
.map(
(tag) => Container(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: Colors.indigo.shade50,
borderRadius:
BorderRadius.circular(8),
),
child: MyText.labelSmall(
tag,
fontWeight: 600,
color: Colors.indigo,
overflow: TextOverflow.ellipsis,
),
),
)
.toList(),
),
),
],
], ],
), ),
), ),