Reputation: 13
I want to set a different color for the error line created by the validator in TextFormField but I don't know how...
Upvotes: 0
Views: 612
Reputation: 2799
Change the color and the width to your likings providing errorBorder
and focusedErrorBorder
inside InputDecoration
as decoration for TextFormField
:
TextFormField(
decoration: InputDecoration(
focusedErrorBorder:UnderlineInputBorder(
borderSide: const BorderSide(color: Colors.blue, width: 2.0))
errorBorder: UnderlineInputBorder(
borderSide: const BorderSide(color: Colors.blue, width: 2.0),
),
),
),
Upvotes: 3