颤音中的小键只显示一次
如果文本字段中给出的输入不正确(例如字段仅接受整数而不是字符或字符串),我想发出错误警告。我已经用过了 get.snackbar
给出错误警告。但是打开应用程序后仅显示一次。如何解决此问题{预先感谢}
I want to give an error warning if the input given in the text field is not correct (like the field only accepts integer and not characters or strings). I have usedGet.snackbar
for giving the error warning . but it show only once after opening the application. How to solve this issue {Thanks in advance}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先为您的Snackbar创建标题作为字符串
,然后您可以创建一个函数,该函数每次调用时都可以显示Snackbar
,最后每次您要显示和错误时,只需将标题设置为错误代码,然后将其传递到这样的函数中
这将为您节省很多时间
first create a title for you snackbar as a string
then you can create a function which can show snackBar every time you call it
and finally every time you want to show and error just set the title to your error code and pass in the function like this
this will save you so much time cause you dont have to build snackbar every time you want to show snackbar
我尝试了Snackbar小部件作为功能。它起作用了!!!
I tried the SnackBar widget as a function. it worked!!!