feat: Enhance socket reconnection and chat screen lifecycle management, and refine agent detail and home screen UI.
This commit is contained in:
@@ -656,7 +656,11 @@ class _AgentDetailScreenState extends ConsumerState<AgentDetailScreen> {
|
||||
const SizedBox(height: 8),
|
||||
// Location (wrapping) + Member Since (separate line)
|
||||
Builder(builder: (_) {
|
||||
final parts = state.locationParts;
|
||||
var parts = state.locationParts;
|
||||
// Fallback: use agent model location if fieldValues-based parts are empty
|
||||
if (parts.isEmpty && agent.location.isNotEmpty) {
|
||||
parts = agent.location.split(', ').map((s) => s.trim()).where((s) => s.isNotEmpty).toList();
|
||||
}
|
||||
const maxVisible = 4;
|
||||
final visibleParts = parts.take(maxVisible).join(', ');
|
||||
final remaining = parts.length - maxVisible;
|
||||
@@ -1520,8 +1524,9 @@ class _SpecializationCardWidgetState extends State<_SpecializationCardWidget> {
|
||||
|
||||
return Container(
|
||||
width: 298,
|
||||
constraints: const BoxConstraints(minHeight: 236),
|
||||
height: _expanded ? null : 236,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
@@ -1531,6 +1536,7 @@ class _SpecializationCardWidgetState extends State<_SpecializationCardWidget> {
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: _expanded ? MainAxisSize.min : MainAxisSize.max,
|
||||
children: [
|
||||
Icon(_icon, size: 32, color: AppColors.accentOrange),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
@@ -1083,20 +1083,22 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> {
|
||||
final displayName = AgentDetailState.titleCase(card.name);
|
||||
final sectionKey = 'spec_${card.slug}';
|
||||
final isExpanded = _expandedTagSections.contains(sectionKey);
|
||||
final displayValues = isExpanded ? card.values : card.values.take(5).toList();
|
||||
final hasMore = card.values.length > 5;
|
||||
final displayValues = isExpanded ? card.values : card.values.take(3).toList();
|
||||
final hasMore = card.values.length > 3;
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 66, vertical: 8),
|
||||
width: 298,
|
||||
constraints: const BoxConstraints(minHeight: 236),
|
||||
height: isExpanded ? null : 236,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 20),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
border: Border.all(color: AppColors.primaryDark, width: 0.7),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: isExpanded ? MainAxisSize.min : MainAxisSize.max,
|
||||
children: [
|
||||
const Icon(Icons.category_outlined,
|
||||
size: 28, color: AppColors.accentOrange),
|
||||
|
||||
Reference in New Issue
Block a user