feat: Enhance messaging read receipts and auto-read, fix auth 401 error suppression during logout, and refine agent profile expertise
This commit is contained in:
@@ -1299,6 +1299,13 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> {
|
||||
Widget _buildTestimonialsSection(AgentDetailState state) {
|
||||
if (state.testimonials.isEmpty) return const SizedBox.shrink();
|
||||
|
||||
// Calculate average rating dynamically
|
||||
final totalRating = state.testimonials.fold<double>(
|
||||
0, (sum, t) => sum + ((t['rating'] as num?)?.toDouble() ?? 5.0),
|
||||
);
|
||||
final avgRating = (totalRating / state.testimonials.length).toStringAsFixed(1);
|
||||
final count = state.testimonials.length;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Column(
|
||||
@@ -1318,9 +1325,9 @@ class _AgentHomeContentState extends ConsumerState<_AgentHomeContent> {
|
||||
height: 1,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Text(
|
||||
'Clients rate our real estate services 4.9 out of 5 on average, based on recent client reviews.',
|
||||
style: TextStyle(
|
||||
Text(
|
||||
'Clients rate our real estate services $avgRating out of 5 on average, based on $count recent client review${count != 1 ? 's' : ''}.',
|
||||
style: const TextStyle(
|
||||
fontFamily: 'SourceSerif4',
|
||||
fontSize: 14,
|
||||
color: AppColors.primaryDark,
|
||||
|
||||
Reference in New Issue
Block a user