如何删除TextFormField扑朔迷离下的错误空间?

发布于 2025-02-13 21:52:24 字数 295 浏览 2 评论 0原文

我在容器中创建了TextFormField,并试图从TextFormField隐藏错误行,但它不起作用。有什么方法可以删除它吗?

我的textformfield

代码

I created TextFormField inside a Container and tried to hide an error line from TextFormField, but it's not working. Is there any way to delete it?

My TextFormField

Code

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

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

发布评论

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

评论(1

旧人哭 2025-02-20 21:52:25

这就是您需要的:
errorborder的边框颜色&可以更改focusedErrorborder。

            TextField(
                keyboardType: TextInputType.emailAddress,
                textAlign: TextAlign.center,
                onChanged: (value) {
                  //Do something with the user input.
                },
                decoration: InputDecoration(
                  errorBorder:  OutlineInputBorder(
                    borderSide:  BorderSide(color: Colors.white, width: 0.0),
                  ),
                  focusedErrorBorder:  OutlineInputBorder(
                    borderSide:  BorderSide(color: Colors.blue, width: 0.0),
                  )),),

This is what you need:
the border color for errorBorder & focusedErrorBorder could be changed.

            TextField(
                keyboardType: TextInputType.emailAddress,
                textAlign: TextAlign.center,
                onChanged: (value) {
                  //Do something with the user input.
                },
                decoration: InputDecoration(
                  errorBorder:  OutlineInputBorder(
                    borderSide:  BorderSide(color: Colors.white, width: 0.0),
                  ),
                  focusedErrorBorder:  OutlineInputBorder(
                    borderSide:  BorderSide(color: Colors.blue, width: 0.0),
                  )),),
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文