I want to set a different color for the error line created by the validator in TextFormField but I don't know how...
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),
),
),
),