timeline_tile icon indicating copy to clipboard operation
timeline_tile copied to clipboard

Minimum Height

Open Faiyyaz opened this issue 4 years ago • 7 comments

Hi,

Thanks for such a great library but i am facing one issue.

The issue is there is some minimum height given to the right child. I want the right child to be build of the exact size as per the content and not the minimum size so please can you help me with this issue?

Faiyyaz avatar Aug 26 '20 12:08 Faiyyaz

I've wraped the Timeline Tile with a Container and set constraints to the desired maxHeight, worked here, if there's a proper way, please tell us

talski avatar Sep 03 '20 04:09 talski

Hey there. Thanks for the issue.

Well, like @talski pointed out, you can play with the size using a BoxConstraints on the children. Involving them inside a Container or a ConstrainedBox widget, it is totally normal.

Let me know if this help, or provide some example code to illustrate the problem. 👍

JHBitencourt avatar Sep 16 '20 16:09 JHBitencourt

Actually in my case it is a card with a column containing multiple text widgets. So I won' be able to know the height to set a constraint

Faiyyaz avatar Sep 16 '20 17:09 Faiyyaz

I'm afraid that I will only be able to help with some code that I can execute and see what is going on.

JHBitencourt avatar Sep 18 '20 17:09 JHBitencourt

Sorry for the late reply @JHBitencourt I will provide you an example code shortly

Faiyyaz avatar Oct 03 '20 06:10 Faiyyaz

Here is the code repo link for the attached screenshot

https://github.com/Faiyyaz/timeline_tile_bug.git

The bug is in the card with blue background color. As you can see it gives me some extra padding in the card where the data is not much. And i can't ascertain constraints because this data will be dynamic.

Screenshot_2020-10-03-11-56-42-35_476d1d321e32b6ac1a964a8cb6b40c6f

Faiyyaz avatar Oct 03 '20 06:10 Faiyyaz

Thanks for the example.

If you check here the football, weather and success timeline work with dynamic child height.

But I forked and updated your project (upgraded timeline_tile version to 1.0.0), final result:

image

The problem is, you are using TimelineAlign.manual that requires both a startChild (left) and rightChild (right). When you don't provide a child, it uses a defaultChild with a fixed height of 100.

So, you can either use TimelineAlign.start with a rightChild, or simply stay with TimelineAlign.manual and pass an empty Container() to startChild. I did this last one to your repo.

Let me know if this helped.

JHBitencourt avatar Oct 03 '20 13:10 JHBitencourt