You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Flutter中隐藏Mesibo的用户列表图标?

问题描述

我正在使用 mesibo_flutter_sdk 2.2.0 开发聊天功能,需要隐藏用户列表图标,但在 MesiboUIOptions 中找不到对应的设置选项。以下是我的SDK初始化代码:

void initMesibo(String token) async {
  // Future<String> asyncAppId = _mesibo.getAppIdForAccessToken();
  // asyncAppId.then((String appid) { mAppId = appid; });

  _mesibo.setAccessToken(token);
  _mesibo.setListener(this);
  _mesibo.start();
  
  _mesiboUi.getUiDefaults().then((MesiboUIOptions options) {
    options.enableBackButton = true;
    options.appName = "Chats";
    options.userOnlineIndicationTitle="Online";
    options.toolbarColor = 0xFF73ad00;
    options.statusBarColor = 0xFF73ad00;
    _mesiboUi.setUiDefaults(options);
  });

  MesiboUIButtons buttons = MesiboUIButtons();
  buttons.message = false;
  buttons.audioCall = true;
  buttons.videoCall = true;
  buttons.groupAudioCall = true;
  buttons.groupVideoCall = true;
  buttons.endToEndEncryptionInfo = false; // e2ee should be enabled
  _mesiboUi.setupBasicCustomization(buttons, null);
}
解决方案

针对 mesibo_flutter_sdk 2.2.0,你可以通过以下两种方式隐藏用户列表图标:

方式1:使用配置项直接禁用

尝试通过 MesiboUIConfiguration 添加用户列表按钮的控制逻辑,将这段代码添加到你的初始化流程中:

// 在设置完MesiboUIOptions后添加
MesiboUIConfiguration config = MesiboUIConfiguration();
config.showUserListButton = false; // 隐藏用户列表图标
_mesiboUi.setConfiguration(config);

方式2:自定义Toolbar(兼容旧版本)

如果2.2.0版本中没有showUserListButton属性,可通过禁用默认Toolbar并自定义AppBar来实现:

  1. 禁用默认Toolbar:
_mesiboUi.getUiDefaults().then((MesiboUIOptions options) {
  // ... 保留原有配置
  options.enableDefaultToolbar = false; // 关闭默认Toolbar
  _mesiboUi.setUiDefaults(options);
});
  1. 在你的页面Scaffold中自定义AppBar,只保留需要的控件(比如返回按钮),不添加用户列表入口。

如果允许升级SDK,建议更新到较新版本,部分UI控制选项在后续版本中做了更细致的拆分,更容易找到对应开关。

内容的提问来源于stack exchange,提问作者Asif Khan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 03:03:34