fix: устранить фриз при переключении вкладок в ChatListScreen

This commit is contained in:
klockky
2026-05-13 08:26:46 -07:00
parent 2c88fc7b01
commit 5f40288614
7 changed files with 133 additions and 69 deletions
@@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:material_symbols_icons/symbols.dart';
import '../../../core/storage/app_database.dart';
@@ -84,10 +85,11 @@ class _ContactsTabState extends State<ContactsTab> {
),
child: ClipOval(
child: contact.baseUrl != null && contact.baseUrl!.isNotEmpty
? Image.network(
contact.baseUrl!,
? CachedNetworkImage(
imageUrl: contact.baseUrl!,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) =>
fadeInDuration: const Duration(milliseconds: 120),
errorWidget: (context, url, error) =>
_buildPlaceholderAvatar(cs, nameToDisplay),
)
: _buildPlaceholderAvatar(cs, nameToDisplay),