Flutter Calculate Height of RichText Widget - flutter

I have a Column that holds an array of Container Widgets. The Height of one of these Container Widgets is dependent on the Heigth of the Rich Text Widget it holds, for better understanding here is a screenshot:
I want the History Container to be the same height as all the other ones, is there an elegant solution to do this?

You can give a fixed height to a container ! and set text to fit in one line Text('Name',maxLines: 1,), so it will take same height in all row.
or
Alternatively you can add a empty Text widget as subtitle(grey one) in History row.
like -> Text(" ", style:TextStyle()) Give it same style as other subtitle. as result Text widget will take it space like other but wont be visible to UI.

By wrapping every widget on your Column with an Expanded widget, they will all share the same height.

Related

How to animate a Flexible widget

I have a Column with many children of different height that appear and disappear when different state changes - therefore, the whole column's height changes. And so I have wrapped the Column in a Flexible widget like this: Flexible(child: Column(children: [...])) . Is there a way to animate the height changes of the Column?
I know I can remove Flexible, wrap the Column in an AnimatedContainer and animate it's height, but there are too many children in the Column and this looks very tedious. I was just wondering if there is a better way to do this?

Widget that takes up a fixed maximum of space, but shrinks to make room for other widgets inside Row

My Flutter UI has a Row widget with and arbitrary number Widgets in it. I would like to move all of those widgets over to the right by a fixed amount. But the caveat is, if the other widgets grow in width such that the available horizontal space is consumed, the spacing widget will relinquish its space.
The Spacer widget does not work for me, as it does not allow you to specify a fix maximum. It only allows a flex value, which is a function of the width of the other content in the row. I want this spacer to take up a fixed amount of space regardless of the width of the other content of the row (unless all the room is used up).
Try using sizedBox or FractionallySizedBox as explained in this answer
https://stackoverflow.com/a/63430801/8213343

when using the wrap widget, How to can you replace the spacing or runspacing with a widget?

I am trying to put a dot between the labels, but only only between each item in each "row". There will be 8 dots total. each line shouldn't start or end with a dot. Any thoughts on how to do this?
Edit:
I want to give a list of widgets as a parameter. I do not know the height or width of the widgets that will be passed in. Creating this with a row is tricky, because I have to have some kind of logic that determines if there will be enough space for the widget before going to the next row.

In Flutter, what is the difference between Padding and the SizedBox widget?

Since both are used to add spacing to our screen how do we decide when to use either of them .
SizedBox creates space between widget to widget only just height and width.
Padding is how much an element is away from itself — how much distance an element wants to keep with the elements inside it. They create distance top, bottom, left, and right.
Please checout my answer from here

Listview with column and 2 buttons - set width to the largest one?

I have a ListView with a Column, and inside that Column 2 buttons.
The ListView is stretched to the entire page (it contains more elements)
I want all the buttons inside the Column to stretch to the button with the largest width.
I found a solution on usnig InstrictWidth, but when used inside a Listview I'm getting the error
LayoutBuilder does not support returning intrinsic dimensions.
How can I still achieve what I'm looking for?
Wrap each button with an Expanded widget and then wrap each one of these Expanded widgets with a Row widget