如果您需要实现类似的功能,请在您的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,
),
输出