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

Flutter: How can I customize the Border of a Container (or other Widgets)?

I have a special requirement on my Container border.
It should only have a border on the left, right and bottom but not on the top.

Container(
            decoration: BoxDecoration(
              color: Color.fromRGBO(146, 94, 58, 1.0),
              border: Border.all(
                color: Color.fromRGBO(85, 63, 48, 1.0),
                width: 2,
              ),
              borderRadius: BorderRadius.only(
                bottomLeft: Radius.circular(2),
                bottomRight: Radius.circular(2),
              ),
            ),
          )

I can only find .all and .symmetric but nothing like .only which I have seen for the BorderRadius Widget. Why is it missing for Border and how can I make this still work?

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

>Solution :

look this question

and you can read this article

Container(
 decoration: BoxDecoration(
            border: Border(
              bottom: BorderSide(width: 1.5, color: Colors.grey[300]),
            ),
          ),
)
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