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,260 points
1,480 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,
  );

To know more, join our Flutter Certification Course today.

answered Jul 28, 2020 by MD
• 95,460 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,460 points
2,136 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,460 points
3,860 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,460 points
5,693 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
9,310 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,260 points
1,177 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
1,492 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,460 points
1,800 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
2,243 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,460 points
898 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP