Кэширование ID пользователей из чатов (на 24 часа)

This commit is contained in:
needle10
2025-11-22 21:38:48 +03:00
parent bf995d8358
commit 321720cd0a
15 changed files with 669 additions and 238 deletions

View File

@@ -1,9 +1,6 @@
import 'package:flutter/material.dart';
import 'package:gwid/services/avatar_cache_service.dart';
class UserProfilePanel extends StatefulWidget {
final int userId;
final String? name;
@@ -37,16 +34,16 @@ class UserProfilePanel extends StatefulWidget {
class _UserProfilePanelState extends State<UserProfilePanel> {
final ScrollController _nameScrollController = ScrollController();
String get _displayName {
if (widget.firstName != null || widget.lastName != null) {
final firstName = widget.firstName ?? '';
final lastName = widget.lastName ?? '';
final fullName = '$firstName $lastName'.trim();
return fullName.isNotEmpty ? fullName : (widget.name ?? 'Неизвестный');
return fullName.isNotEmpty
? fullName
: (widget.name ?? 'ID ${widget.userId}');
}
return widget.name ?? 'Неизвестный';
return widget.name ?? 'ID ${widget.userId}';
}
@override
@@ -108,122 +105,6 @@ class _UserProfilePanelState extends State<UserProfilePanel> {
super.dispose();
}
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;