Reputation: 2405
I have a simple TextField widget like this
TextField(
obscureText: widget.placeholder == "Password" ? _isHidePassword : false,
decoration: InputDecoration(
hintText: "${widget.placeholder}",
hintStyle: TextStyle(
color: Colors.grey,
),
// labelText: "${widget.placeholder}",
// labelStyle: TextStyle(color: greenMain),
),
)
and it gives the result like this picture:
is there a way to change the blue color into another? like red or green one ?
Upvotes: 1
Views: 5487
Reputation: 21
You can use the decoration on TextField
like this:
decoration: InputDecoration(
hintText: 'Type Text Here',
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.red),
),
And this will change the line to color red.
I hope i help you
Upvotes: 2
Reputation: 12575
lets try
Theme(
data: new ThemeData(
primaryColor: Colors.redAccent,
primaryColorDark: Colors.red,
),
child: TextField(
keyboardType: TextInputType.text,
decoration: InputDecoration(
labelText: "Text field*",
),
),
),
Upvotes: 1