From 2af7eca16aa6c5e3fcd6b392ec3c969bf6401bff Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Tue, 31 Mar 2026 05:32:22 +0530 Subject: [PATCH] feat: update agent match calculation, enable tag expansion in search, increase socket reconnect attempts, and disable profile title editing --- .../screens/agent_search_screen.dart | 50 +++++++++++-------- .../messaging/data/socket_service.dart | 2 +- .../widgets/profile_settings_tab.dart | 2 +- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/lib/features/agents/presentation/screens/agent_search_screen.dart b/lib/features/agents/presentation/screens/agent_search_screen.dart index 6a1eba1..bb3417f 100644 --- a/lib/features/agents/presentation/screens/agent_search_screen.dart +++ b/lib/features/agents/presentation/screens/agent_search_screen.dart @@ -400,14 +400,15 @@ class _AgentCard extends StatefulWidget { class _AgentCardState extends State<_AgentCard> { bool _bioExpanded = false; + bool _tagsExpanded = false; @override Widget build(BuildContext context) { final agent = widget.agent; final specializations = agent.specializations; final bio = agent.description; - final matchPercent = agent.averageRating != null - ? '${(agent.averageRating! * 20).round()}%' + final matchPercent = agent.matchPercentage != null + ? '${agent.matchPercentage}%' : null; return Container( @@ -679,27 +680,34 @@ class _AgentCardState extends State<_AgentCard> { spacing: 6, runSpacing: 6, children: [ - ...specializations - .take(6) + ...(_tagsExpanded + ? specializations + : specializations.take(6)) .map((tag) => _buildTag(tag)), if (specializations.length > 6) - Container( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 5), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), - color: AppColors.accentOrange - .withValues(alpha: 0.1), - border: Border.all( - color: AppColors.accentOrange, width: 0.7), - ), - child: Text( - '+${specializations.length - 6} more', - style: const TextStyle( - fontFamily: 'SourceSerif4', - fontSize: 13, - fontWeight: FontWeight.w600, - color: AppColors.accentOrange, + GestureDetector( + onTap: () => + setState(() => _tagsExpanded = !_tagsExpanded), + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: AppColors.accentOrange + .withValues(alpha: 0.1), + border: Border.all( + color: AppColors.accentOrange, width: 0.7), + ), + child: Text( + _tagsExpanded + ? 'Show Less' + : '+${specializations.length - 6} more', + style: const TextStyle( + fontFamily: 'SourceSerif4', + fontSize: 13, + fontWeight: FontWeight.w600, + color: AppColors.accentOrange, + ), ), ), ), diff --git a/lib/features/messaging/data/socket_service.dart b/lib/features/messaging/data/socket_service.dart index 49047ce..a51c2ff 100644 --- a/lib/features/messaging/data/socket_service.dart +++ b/lib/features/messaging/data/socket_service.dart @@ -21,7 +21,7 @@ class SocketService { bool _isConnected = false; bool _intentionalDisconnect = false; int _reconnectAttempts = 0; - static const _maxReconnectAttempts = 3; + static const _maxReconnectAttempts = 5; String? _currentToken; // Stream controllers for events diff --git a/lib/features/profile/presentation/widgets/profile_settings_tab.dart b/lib/features/profile/presentation/widgets/profile_settings_tab.dart index 0bd0800..6da3362 100644 --- a/lib/features/profile/presentation/widgets/profile_settings_tab.dart +++ b/lib/features/profile/presentation/widgets/profile_settings_tab.dart @@ -266,7 +266,7 @@ class _ProfileSettingsTabState extends ConsumerState { ProfileFormField( label: isAgent ? 'Career / Agent Type' : 'Professional Title', controller: _titleController, - enabled: !isAgent, + enabled: false, ), const SizedBox(height: 24), ProfileFormField(