Home > Software design >  Underline Input Border
Underline Input Border

Time:10-12

I want to change the field UnderlineInputBorder: I want the underline color to be white, but it is black and only turns white when I click on it. What should I do?

Form(
                child: Column(
                  children: [
                    TextFormField(autofocus: true,
                    decoration: InputDecoration(
                          labelText: "E-mail",
                          labelStyle: TextStyle(color: Colors.white),
                          prefixIcon: Icon(
                            Icons.mail_outline,
                            color: Colors.white
                            ),
                            border: UnderlineInputBorder(
                              borderSide: BorderSide(
                                color: Colors.white,
                              ),
                            ),
                            focusedBorder: UnderlineInputBorder(
                              borderSide: BorderSide(
                                color: Colors.white,
                              ),
                            ),
                          ),

              )
            ],
          )
        )

the field

when i click on it

CodePudding user response:

You can try setting up the enabledBorder property of the InputDecoration().

enabledBorder: UnderlineInputBorder(
   borderSide: BorderSide(
      color: Colors.white,
   ),
),

CodePudding user response:

Form(
          child: Column(
            children: [
              TextFormField(
                autofocus: true,
                decoration: InputDecoration(
                  labelText: "E-mail",
                  labelStyle: TextStyle(color: Colors.white),
                  prefixIcon: Icon(Icons.mail_outline, color: Colors.white),
                  border: UnderlineInputBorder(
                    borderSide: BorderSide(
                      color: Colors.white,
                    ),
                  ),
                  enabledBorder: UnderlineInputBorder(
                    borderSide: BorderSide(
                      color: Colors.white,
                    ),
                  ),
                  focusedBorder: UnderlineInputBorder(
                    borderSide: BorderSide(
                      color: Colors.white,
                    ),
                  ),
                ),
              )
            ],
          ),
        ),
  • Related