13

I'm trying to remove the border outline from this TextField in flutter, but can't seem to figure the semantic way to do it.

                        decoration: InputDecoration(
                        labelStyle: const TextStyle(color: Colors.black),
                        contentPadding: const EdgeInsets.only(left: 25),
                        border: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(40.0),
                        ),

Any help is greatly appreciated. Completely blanking on this.

*edit need to keep BorderRadius.cicrular active

**edit edit looking to remove the black line around this TextInput

enter image description here

4 Answers 4

16

You can remove border outline TextField

Here some example may help you:

 TextFormField(
        decoration: new InputDecoration(
            border: InputBorder.none,
            focusedBorder: InputBorder.none,
            enabledBorder: InputBorder.none,
            errorBorder: InputBorder.none,
            disabledBorder: InputBorder.none,),


TextField(
    decoration: new InputDecoration(
        border: InputBorder.none,
        focusedBorder: InputBorder.none,
        enabledBorder: InputBorder.none,
        errorBorder: InputBorder.none,
        disabledBorder: InputBorder.none,
        hintText: "Hint here"),)
Sign up to request clarification or add additional context in comments.

Comments

13

Had to modify border to this:

border: OutlineInputBorder(
  borderRadius: BorderRadius.circular(10),
  borderSide: BorderSide.none,
),

To maintain BorderRadius.circular and also dump the outline.

1 Comment

borderSide: BorderSide.none does the job but it's shorter and more readable
5

In your textfield, do the following:

 TextField(
      decoration: InputDecoration(
        border: OutlineInputBorder(
            borderSide: BorderSide.none,
            borderRadius: BorderRadius.circular(17)
         ),
      ),
    );
  }

this will keep your textfield circular, and will remove the borders

1 Comment

Remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, can you edit your answer to include an explanation of what you're doing and why you believe it is the best approach?
4

Just change border : InputBorder.none

5 Comments

woops should add, need to keep the BorderRadius.circular active
can you show the design, please? i am just confused about your question
no probs. just uploaded an image to the original post to help explain what i'm trying to get rid of.
inside OutlineInputBorder, try add this borderSide: BorderSide(color: Colors.transparent)
No luck with this. BorderSide doesn't appear to style any part of the border.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.