群组信息
要在Flutter IMKit的UI界面上展示群组的头像、群名称等信息,需要应用层(App)主动向IMKit SDK提供群组信息。
在Flutter IMKit中,同样使用CustomInfoProvider函数类型来提供群组信息。本文将介绍如何为IMKit提供群组信息,以便在UI界面上展示。
群组信息数据结构
在Flutter IMKit中,群组信息与用户信息使用同一个数据结构RCKChatProfileInfo,通过isGroup字段区分:
Dart
class RCKChatProfileInfo {
final String id; // 群组ID
final String name; // 群组名称
final String avatar; // 群组头像URL
final bool isGroup; // 设置为true表示这是群组信息
final String extraInfo; // 额外信息,如群公告等
// 构造函数
RCKChatProfileInfo({
required this.id,
required this.name,
required this.avatar,
this.isGroup = true, // 群组信息设置为true
this.extraInfo = '',
});
}