How to position widgets inside column in flutter? - 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

Related

Flutter grid with different size

how to create grid. My issue is that I want to display widget in my grid view and each one of these widgets has its own content and can have different width, I am facing trouble with achieving that…
GridView, Wrap, ListView, Rows + Columns, Stack.
You can use Wrap widget. Also check flutter_staggered_grid_view package.

Flutter expand/collapse container without overflow error

Does anybody have a clue how to achieve expand/collapse animation for a given Container widget?
I tried to use ExpandablePanel but it is not what I really want, because I want to render a Column within a Container, and if the Container is collapsed I want to show only 150px from it, otherwise it should have the height of the content.
Clicking on the arrow the Container should toggle it's state.
Below are some images which represents the goal:
Collapsed
Expanded
The overflow error is thrown because when the column is collapsed there is no room to contain all the children inside the column.
What do we do when we have a column with children's height larger than the screen height? We use scrolling!
So you can wrap your column with SingleChildScrollView widget to make the column scrollable, so when it collapses it doesn't complain about the children's height, instead, the scrolling functionality handles them because you can scroll in a column even if it has very small width.

Is there a way to dynamically size a widget according to whatever the size is left on the screen in 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 }}

How to place StickyGroupListView inside SingleChildScrollView on Flutter?

I have a widget tree like this: <b/r>
SingleChildScrollView
Column
Container
StickyGroupedListView
The problem is that data inside StickyGroupedListView is not display on screen, only blank white screen. If I remove SingleChildScrollView, the list is display perfectly.
How to make it work with SingleChildScrollView ?

How to let resize and also give margin for whole screen in Flutter?

I want to give a margin around the whole screen in Flutter. So I put my content inside a Column and put the Column inside a Container. So I gave a padding to the whole screen. But when a TextField is selected and the keyboard appears the bottom overflow. I can't give resizeToAvoidBottomPadding: false, because then the keyboard covers the TextField.
I can't use SingleChildScrollView or a ListView because then the placing of the children won't keep space between.
It seems the only option is to remove the Container and set a padding to each child of the Column.
Is there a better option for this ?