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,220 points
1,438 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),
                                ],
                              ),
answered Sep 10, 2020 by akhtar
• 38,180 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,220 points
858 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,220 points
266 views
0 votes
1 answer

How to set margin for a Container in Flutter?

Hi@akhtar, Margin property is used to set empty ...READ MORE

answered Jul 29, 2020 in Others by MD
• 95,220 points
1,086 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,220 points
4,135 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,220 points
290 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,220 points
453 views
0 votes
1 answer

How to check the connected device name in Flutter?

Hi@akhtar, Flutter has its command own command to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,220 points
1,000 views
0 votes
1 answer

How to run two commands in one line in Windows CMD?

Hi@MD, You can use the Logical And operator ...READ MORE

answered Oct 5, 2020 in Others by akhtar
• 38,180 points
1,657 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,180 points
184 views