How to create a container widget in Flutter

0 votes

Hi Guys,

I am new in Flutter Framework. I want to create a container Widget in the body part. How can I do that?

Jul 28, 2020 in Others by akhtar
• 38,180 points
301 views

1 answer to this question.

0 votes

Hi@akhtar,

Container means a parent widget that contains a child widget and manages it, such as width, height, background, and so on. You can create a container widget in your app using the below code.

Container(
  alignment: Alignment.center,
  width: 200,
  height: 200,
  color: Colors.red,
);

It will give you the below output.

answered Jul 28, 2020 by MD
• 95,240 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,240 points
959 views
0 votes
1 answer

Create a container widget that consumes total space in Flutter.

Hi@akhtar, Instead of giving width and height value, ...READ MORE

answered Jul 28, 2020 in Others by MD
• 95,240 points
230 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,240 points
1,262 views
0 votes
1 answer

How to create a FlatButton in Flutter?

Hi@akhtar, A flat button is a text label ...READ MORE

answered Aug 12, 2020 in Others by MD
• 95,240 points
113 views
0 votes
1 answer

What is pubspec.yaml file in Flutter?

Hi@akhtar, It is the project's configuration file that ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,240 points
991 views
0 votes
1 answer

Error: No pubspec.yaml file found.

Hi@akhtar, You need to run this command from ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,240 points
3,602 views
0 votes
1 answer

How to launch an emulators from Flutter?

Hi@akhtar, Before launching emulators you should check if ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,240 points
2,098 views
0 votes
1 answer

How to create a Project in Flutter?

Hi@akhtar, Flutter has an inbuilt command to create ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,240 points
181 views
0 votes
1 answer

How to create a Volume Icon in Flutter App?

Hi@akhtar, You can use Icon Widget to create ...READ MORE

answered Jul 24, 2020 in Others by MD
• 95,240 points
443 views