Create a container widget that consumes total space in Flutter

0 votes

Hi Guys,

I am new in Flutter Framework. I want to create a container widget that consumes 100 % of the body in my App. But I am not able to do so.

How can I do that?

Jul 28, 2020 in Others by akhtar
• 38,170 points
159 views

1 answer to this question.

0 votes

Hi@akhtar,

Instead of giving width and height value, you can set the value as double.infinity. It will cover the whole body part of your app.

 var mybody = Container(
    alignment: Alignment.center,
    width: double.infinity,
    height: double.infinity,
    color: Colors.red,
  );
answered Jul 28, 2020 by MD
• 95,040 points

Related Questions In Others

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,040 points
285 views
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,040 points
513 views
0 votes
1 answer

Error cannot provide both a color and a decoration in Flutter container.

Hi@akhtar, The color and decoration arguments cannot both be supplied, since it ...READ MORE

answered Jul 29, 2020 in Others by MD
• 95,040 points
564 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,040 points
668 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,170 points
136 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,040 points
216 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,040 points
352 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,040 points
171 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,040 points
122 views