当TextFormField不活动时,无法更改默认边框颜色。当TextFormField不活动时,将显示深灰边框颜色。那么,如何更改呢?
Theme(
data: new ThemeData(
primaryColor: Colors.red,
primaryColorDark: Colors.black,
),
child: TextFormField(
decoration: new InputDecoration(
labelText: "Enter Email",
fillColor: Colors.white,
border: new OutlineInputBorder(
borderRadius: new BorderRadius.circular(25.0),
borderSide: new BorderSide(),
),
//fillColor: Colors.green
),
validator: (val) {
if (val.length == 0) {
return "Email cannot be empty";
} else {
return null;
}
},
keyboardType: TextInputType.emailAddress,
style: new TextStyle(
fontFamily: "Poppins",
),
),
),
2条答案
按热度按时间fhg3lkii1#
使用
InputDecoration
的enabledBorder
,不要忘记您还可以使用focusedBorder
,如下所示:这里你有更多的信息:https://api.flutter.dev/flutter/material/InputDecoration/enabledBorder.html
js5cn81o2#