【问题标题】:is there any possible way to trig the tooltip without any tap function in flutter?是否有任何可能的方法来触发工具提示而无需任何点击功能?
【发布时间】:2021-08-19 13:02:29
【问题描述】:

我想在没有任何 onPress 或 onLongpress 方法的情况下,在我的文本字段验证条件变为 false 时立即显示工具提示消息。可能吗?如果是,那我该怎么做?

【问题讨论】:

    标签: android flutter dart flutter-layout flutter-web


    【解决方案1】:

    在 TextField 中使用 onChanged 属性使每次修改都发生验证

    当它无效时显示工具提示

    【讨论】:

    • 我做到了,似乎对我不起作用。我想要一条消息,当您点击它而不点击它时工具提示会显示。
    • make ValueListenableBuilder child 将包含 textfield 和 onChange 测试如果 textfield 有效如果不是 showTooltipNotifier.value = true 和 builder 如果 showTooltip == true Tooltip(message ="...",child:child ) 否则返回孩子
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多