Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to change the border color of this text field to white in flutter

how to change the border colour of this text field to white. here’s my code for text field. default it display as a black border. I want to fill the text box with white colour and white padding.

Widget TextBox() => Container(
  child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
    Container(
        height: 60,
        width: 300,
        child: TextField(
          decoration: InputDecoration(
              border: OutlineInputBorder(borderRadius:BorderRadius.circular(15),  ),
              hintText: 'Enter Name',
              fillColor: Colors.white,filled: true
            // Border

          ),
        )),
  ]),
);

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Try this,

Widget TextBox() => Container(
  child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
    Container(
        height: 60,
        width: 300,
        child: TextField(
          decoration: InputDecoration(
           enabledBorder: OutlineInputBorder(
                  borderSide: BorderSide(color: Colors.white), // change color you want...
                ),
              border: OutlineInputBorder(borderRadius:BorderRadius.circular(15)),
              hintText: 'Enter Name',
              fillColor: Colors.white,filled: true
            // Border

          ),
        )),
  ]),
);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading