更新getx snackbar的持续时间后,用户点击 /点击它?

发布于 2025-02-10 01:28:34 字数 71 浏览 2 评论 0原文

一旦用户单击它,可以更新初始的GETX Snackbar的持续时间吗? 例如,在用户点击Snackbar之后,我想使其可见X秒。

Can the initial GetX snackbar's duration be updated once a user clicks it?
E.g. After the user clicks on snackbar I would like to make it visible for additional x seconds.

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

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

发布评论

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

评论(1

无畏 2025-02-17 01:28:34

调用Snackbar方法时,应指示持续时间。这样的事情:

Get.snackbar(
        "Title",
        "Message",
        icon: const Icon(Icons.warning, color: Colors.white),
        snackPosition: SnackPosition.TOP,
        backgroundColor: Colors.red[200],
        maxWidth: 300,
        duration: const Duration(seconds: 5),
        );

You should indicate the duration when you call the snackbar method. Something like this:

Get.snackbar(
        "Title",
        "Message",
        icon: const Icon(Icons.warning, color: Colors.white),
        snackPosition: SnackPosition.TOP,
        backgroundColor: Colors.red[200],
        maxWidth: 300,
        duration: const Duration(seconds: 5),
        );
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文