扑。是否可以更改textformfield errortext填充?
我将 TextFormField
与 OutlineInputBorder
一起使用。我需要里面的文本在右侧和左侧有填充。为此,我正在使用:
contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
一切正常。不过,我也使用验证器
。如果在字段中输入了错误的值,则会显示错误。
但我需要填充不适用于错误。你能告诉我这是否可以实现吗?例如,看图片:
是否可以仅更改我的错误文本的填充?
请帮我。
I'm using TextFormField
with OutlineInputBorder
. I need the text inside to have padding on the right and left. For this I'm using:
contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
Everything works well. However, I also use a validator
. And if an incorrect value is entered in the field, an error is displayed.
But I need the padding to not apply to the error. Can you tell me if this can be achieved? For an example, look at the picture:
Is it possible to change padding only for my error text ?
Please, help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
目前没有可能的解决方案。如果我们检查 TextFormField ,
contentPadding 还控制错误文本,
但我们可以实现
这是我的代码
注意
输出将为
there is no possible solution at this time . if we inspect the TextFormField ,
the contentPadding also control the error text to
but we can achieve that
this is my code
note that
out put will be
如此简单!
As simple as this!
在前缀字段上尝试填充
以获取更多检查详细信息,请检查此链接
Try Padding on Prefix field
for more check details please check this link