如何在flutter中为圆形头像添加标签

发布于 2025-01-10 19:13:34 字数 36 浏览 1 评论 0原文

我创建了一个圆形头像,并想显示它的标签,以明确头像是什么。

I have created a circle avatar and want to show the label for it as to make it clear for what the avatar is.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

会傲 2025-01-17 19:13:34

我建议使用 circular_profile_avatar 包,你不能添加 label标题CircleAvatar。通过这个包,您可以在您的类似Stack上添加Text

如果您不喜欢软件包,可以关注此链接,我希望它有所帮助。

I suggest to use circular_profile_avatar package, you cant add label or title to CircleAvatar. by this package you can add Text over your like Stack.

if you didnt like package you can follow this link, i hope it helps.

岁月蹉跎了容颜 2025-01-17 19:13:34

您可以使用 Stack 小部件示例用法:

Stack(
alignment: Alignment.center
  children: <Widget>[
    CircleAvatar(
        backgroundColor: Colors.white,
        child: ClipRect(
          child: Image.network(
            'url-to-image',
            fit: BoxFit.cover,
          ),
        ),
      )
     Center(
     child: Text(
     'label',
     textAlign: TextAlign.center))
  ],

You can use Stack widget sample usage:

Stack(
alignment: Alignment.center
  children: <Widget>[
    CircleAvatar(
        backgroundColor: Colors.white,
        child: ClipRect(
          child: Image.network(
            'url-to-image',
            fit: BoxFit.cover,
          ),
        ),
      )
     Center(
     child: Text(
     'label',
     textAlign: TextAlign.center))
  ],

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文