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

使用emoji_picker_flutter时提示progressIndicatorColor参数未定义

解决progressIndicatorColor参数未定义的错误

这个报错是因为emoji_picker_flutter包的新版本已经移除了progressIndicatorColor这个命名参数,API结构做了调整。

解决办法分两种:

  • 适配新版本API:
    新版本中,加载指示器的样式需要通过loadingIndicator参数传入自定义的Widget来实现,示例代码如下:
EmojiPicker(
  showRecentsTab: true,
  recentsLimit: 28,
  noRecentsText: "No Recents",
  noRecentsStyle: const TextStyle(color: Colors.grey),
  // 自定义加载指示器颜色
  loadingIndicator: CircularProgressIndicator(
    color: Color(0xFFB71C1C),
  ),
  // 其他必要配置
)
  • 回退到兼容版本:
    如果你一定要用progressIndicatorColor参数,可以在pubspec.yaml里指定一个支持该参数的旧版本,比如:
dependencies:
  emoji_picker_flutter: ^1.6.1

不过不推荐这种方式,旧版本可能存在已知问题,也无法获得后续的功能更新。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.07 06:02:37