Questions tagged [flutter-layout]

Layouts in Flutter - Google’s UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase, refer to the classes called widgets used to build UIs, both for layout and UI elements. Layouts may be in the form of single-child or multi-child layout widgets. Use this tag for all types of layout widgets used in Flutter.

Layouts in Flutter- Google’s UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase, refer to the classes called widgets used to build UIs, both for layout and UI elements.

Layouts may be in the form of single-child or multi-child layout widgets. Use this tag for all types of layout widgets used in Flutter.

13064 questions
743
votes
29 answers

How can I remove the debug banner in Flutter?

I'm using flutter screenshot and I expected the screenshot to not have a banner, but it has. Note that I get a not supported for emulator message for profile and release mode.
Tree
  • 29,135
  • 24
  • 78
  • 98
419
votes
19 answers

How to do Rounded Corners Image in Flutter

I am using Flutter to make a list of information about movies. Now I want the cover image on the left to be a rounded corners picture. I did the following, but it didn’t work. Thanks! getItem(var subject) { var row = Container( margin:…
Liu Silong
  • 4,902
  • 3
  • 19
  • 28
387
votes
17 answers

How to add a ListView to a Column in Flutter?

I'm trying to construct a simple login page for my Flutter app. I've successfully built the TextFields and log in/Sign in buttons. I want to add a horizontal ListView. When I run the code my elements disappear, if I do it without the ListView,…
Charles Jr
  • 8,333
  • 15
  • 53
  • 74
342
votes
17 answers

Sizing elements to percentage of screen width/height

Is there a simple (non-LayoutBuilder) way to size an element relative to screen size (width/height)? For example: how do I set the width of a CardView to be 65% of the screen width. It can't be done inside the build method (obviously) so it would…
Luke
  • 6,388
  • 3
  • 26
  • 35
325
votes
27 answers

Vertical viewport was given unbounded height

This is my code: @override Widget build(BuildContext context) { return new Material( color: Colors.deepPurpleAccent, child: new Column( mainAxisAlignment: MainAxisAlignment.center, children:[new…
pallav bohara
  • 6,199
  • 6
  • 24
  • 45
323
votes
16 answers

Yellow lines under Text Widgets in Flutter?

The main app screen doesn't have this issue, all the texts show up as they should. However, in the new screen, all the text widget have some weird yellow line / double-line underneath. Any ideas on why this is happening?
dasfima
  • 4,841
  • 3
  • 21
  • 24
312
votes
16 answers

How to show/hide widgets programmatically in Flutter

In Android, every single View subclass has a setVisibility() method that allows you modify the visibility of a View object There are 3 options of setting the visibility: Visible: Renders the View visible inside the layout Invisible: Hides the View,…
user3217522
  • 5,786
  • 7
  • 26
  • 34
308
votes
11 answers

TextField inside of Row causes layout exception: Unable to calculate size

I’m getting a rendering exception that I don’t understand how to fix. I’m attempting to create a column that has 3 rows. Row [Image] Row [TextField ] Row [Buttons] Here is my code to build the container: Container…
Matthew Smith
  • 4,387
  • 3
  • 15
  • 14
296
votes
6 answers

How to deal with unwanted widget build?

For various reasons, sometimes the build method of my widgets is called again. I know that it happens because a parent updated. But this causes undesired effects. A typical situation where it causes problems is when using FutureBuilder this…
Rémi Rousselet
  • 256,336
  • 79
  • 519
  • 432
293
votes
15 answers

How can I add shadow to the widget in flutter?

How can I add shadow to the widget like in the picture below? This is my current widget code.
Mohammed Mustafa
  • 2,999
  • 2
  • 9
  • 12
261
votes
27 answers

Space between Column's children in Flutter

I have a Column widget with two TextField widgets as children and I want to have some space between both of them. I already tried mainAxisAlignment: MainAxisAlignment.spaceAround, but the result was not what I wanted.
Sachin Soma
  • 3,432
  • 2
  • 10
  • 18
247
votes
17 answers

Flutter: RenderBox was not laid out

I'm trying to create a ListView but when I import the list_form.dart class i get this error. Maybe I made some mistakes with the layout because if I try to run it inside the main file I don't get this error. This is the error: I/flutter (12956):…
Alessandro Bertozzi
  • 2,521
  • 2
  • 9
  • 9
244
votes
10 answers

Flutter: Expanded vs Flexible

I've used both Expanded and Flexible widgets and they both seem to work the same. What is the difference between Expanded and Flexible?
user6274128
244
votes
35 answers

How to set the width and height of a button in Flutter?

I have seen that I can't set the width of a ElevatedButton in Flutter. If I have well understood, I should put the ElevatedButton into a SizedBox. I will then be able to set the width or height of the box. Is it correct? Is there another way to do…
OlivierGrenoble
  • 3,803
  • 2
  • 18
  • 25
234
votes
27 answers

How to Move bottomsheet along with keyboard which has textfield(autofocused is true)?

I'm trying to make a bottomsheet that has a text field and autofocus is set to true so that the keyboard pops up. But, bottomsheet is overlapped by the keyboard. Is there a way to move bottomsheet above the keyboard? Padding( padding: …
Manjunath Rao
  • 3,790
  • 3
  • 12
  • 18
1
2 3
99 100