Change TextField’s Underline in Flutter

You can also change its color by following ways.

  1. Wrap your TextField in Theme and provide accentColor

    Theme(
      data: Theme.of(context).copyWith(accentColor: Colors.red),
      child: TextField(),
    )
    
  2. Using inputDecoration property.

    TextField(
      decoration: InputDecoration(
        focusedBorder: UnderlineInputBorder(
          borderSide: BorderSide(color: Colors.red),
        ),
      ),
    )
    

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)