简体   繁体   English

无法更改 TextFormField 边框宽度

[英]Not able to change TextFormField Border Width

I am trying to change width of the border of TextFromField , but it's not working.我正在尝试更改TextFromField边框的宽度,但它不起作用。

Here is my code below.下面是我的代码。

TextFormField(
   decoration: InputDecoration(
                border: OutlineInputBorder(
                borderSide: new BorderSide(color: Colors.white,width:2)),
                fillColor: Colors.white,
                labelText: 'Enter your username or email address'
                ),
),

You should use the enableBorder .您应该使用enableBorder Try something like this尝试这样的事情

TextFormField(
          decoration: InputDecoration(
              enabledBorder: OutlineInputBorder(
                  borderSide: new BorderSide(color: Colors.red, width: 10)),
              fillColor: Colors.white,
              labelText: 'Enter your username'),
        )

Reference here:参考这里:

InputDecorarion Class Documentation InputDecorarion Class 文档

BorderSide Class Documentation BorderSide Class 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM