feat:增加消息功能

This commit is contained in:
2026-06-18 14:20:37 +08:00
parent b816cdbc1c
commit bb1160ad18
7 changed files with 76 additions and 53 deletions

View File

@@ -8,12 +8,14 @@ import 'package:sweet_chat_app/utils/SpUtil.dart';
import 'chat_page.dart';
class ContactInfo extends ISuspensionBean {
final int id;
final String name;
final String avatar;
String? tagIndex;
String? namePinyin;
ContactInfo({
required this.id,
required this.name,
required this.avatar,
this.tagIndex,
@@ -58,6 +60,7 @@ class _ContactsPageState extends State<ContactsPage> {
final tag = pinyin.substring(0, 1).toUpperCase();
return ContactInfo(
id: user.id,
name: user.nickname,
avatar: user.avatarUrl,
tagIndex: RegExp(r'^[A-Z]$').hasMatch(tag) ? tag : '#',
@@ -163,6 +166,7 @@ class _ContactsPageState extends State<ContactsPage> {
MaterialPageRoute(
builder:
(_) => ChatPage(
contractId: contact.id,
contactName: contact.name,
avatarUrl: contact.avatar,
),