How to add a border in a Container in Flutter

0 votes

Hi Guys,

I have created a Container widget in Flutter. I want to add the border if this container. How can I do that?

Sep 10, 2020 in Others by MD
• 95,460 points
3,882 views

1 answer to this question.

0 votes

Hi@MD,

By default, you can't see any border to your Container. But you can use BoxShadow inside decoration. This helps you to add the border in the container level. You can see the below example.

decoration: BoxDecoration(
                                borderRadius: BorderRadius.circular(20),
                                color: Colors.lightGreen,
                                boxShadow: [
                                  BoxShadow(color: Colors.red, spreadRadius: 3),
                                ],
                              ),

To know more, join our Flutter Course today.

answered Sep 10, 2020 by akhtar
• 38,260 points

Related Questions In Others

0 votes
1 answer

How to add a border to a widget in Flutter?

Hi@akhtar, You need to add the TextField as a child to a Container that has ...READ MORE

answered Jul 24, 2020 in Others by MD
• 95,460 points
4,641 views
0 votes
1 answer

How to create a container widget in Flutter?

Hi@akhtar, Container means a parent widget that contains ...READ MORE

answered Jul 28, 2020 in Others by MD
• 95,460 points
3,342 views
0 votes
2 answers

How to set margin for a Container in Flutter?

Container( margin: const EdgeInsets.fromLTRB(20, 10, 20, ...READ MORE

answered Apr 17, 2023 in Others by anonymous
10,658 views
0 votes
1 answer

How to add a send button inside TextField in Flutter?

Hi@akhtar, You can use decoration inside your TextField. ...READ MORE

answered Sep 10, 2020 in Others by MD
• 95,460 points
26,792 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
2,322 views