Is there a way to dynamically size a widget according to whatever the size is left on the screen in Flutter? - flutter

Lets just say I have 2 widgets on the screen, one a dynamic container that the size depends on the things that are inside that container, and the second widget would be a scrollable ListView. Ideally, I am trying to have both widget on a non scrollable screen, only having the list view to be scrollable. I have tried using a GlobalKey attached to the dynamic container, and then defining the size of the container that's holding the ListView widget with that, but it did not work. This is done on Flutter Mobile development

There are multiple ways to do this. Here is how I would do it-
To limit the height of ListView, wrap the ListView with a Container widget and set the height of the Container to the required height. To make the container cover entire space, wrap with in an Expanded widget. So this is how your widget tree would look like-
//Expanded { //Container { //ListView }}

Related

Margin Widget Flutter

I've always wondered why Flutter doesn't have a Margin Widget but do have a Padding Widget?
Note: I know that I can access both properties using a Container Widget.
:v Aren't they are the same? "A margin is the space around an element's border, while padding is the space between an element's border and the element's content". If you Padding widget or Margin widget (if Flutter have), they also create a space from child to Padding/Margin widget - obviously same purpose. When you use Container, you can create a border and now you would see the difference.

what is the equivalent to Filexible in slivers flutter?

SliverFillRemaining is the same as Expanded render box.. i need an equivalent to Flexible inside Slivers.
How Could I do so, so that i can make the widget fit it's content but could have infinity height inside a column?

Flutter scrollable list inside overlay

My question is similar to this How to make my page scrollable when i show overlay element, that have too many items in flutter? but it has no answers so I'll try to ask as well:
I have an Overlay showing a list of questions using ListView. The list of questions is long and I need to enable scrolling inside the Overlay.
Now it's static and part of it disappears at the bottom of the mobile device.
Why is not just scrollable (since the list inside the Overlay is inside a ListView) and is there a way to make it scrollable?
Thanks in advance for any help!
UPDATE (SOLVED) :
The problem was that the ListView widget is inside a Positioned widget and the top, left, bottom and width values (in my case) need to be set in order for the content to be scrollable.
The problem was that the ListView widget is inside a Positioned widget and the top, left,bottom and width values (in my case) need to be set in order for the content to be scrollable.

Implementing Container above Draggable Bottomsheet in Flutter

How do I add that small container above the draggable bottomsheet in Flutter?
You can Use Sliding up Panel Package .... Or If you want to use BottomSheet then will return One main Widget Which Would be Container ,let say you have set it's height to MediaQuery..>height then the Child of this Container Would a Column() widget Which would contains 2 widget one is Container for Image or simply give it width of 20.0 and height of 8.0 etc and the Other widget would be Another Container for the rest of the Page

How to position widgets inside column in flutter?

I have two widgets to be placed inside column. The first widget is a TabbarView widget, whose content could be long. The second widget is a TabBar. I want the tabbar to stay always at the bottom of the column and allot the remaining space to TabbarView widget.
Suggest a solution other than using Flex.
This is a quick work around, you can try wrapping your TabbarView in a container and giving it a height using Mediaquery.of(context).size.height * .94
then for the remaining space add your TabBar