[英]Flutter change textfield underline Color
對於那些可能需要實現類似目標的人,請更改Theme
小部件中的hintColor
。
new Theme(
data: new ThemeData(
//this changes the colour
hintColor: Colors.grey,
inputDecorationTheme: new InputDecorationTheme(
labelStyle: new TextStyle(color: Colors.blue))));
我們可以使用InputDecoration
試試這個方法
new TextFormField(
controller: passTextController,
decoration: new InputDecoration(
labelText: "Enter password",
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.grey),
// when the TextFormField in unfocused
) ,
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.blue),
// when the TextFormField in focused
) ,
border: UnderlineInputBorder(
)
),
keyboardType: TextInputType.text,
obscureText: true,
),
輸出
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.