JHBitencourt / timeline_tile

A package to help build customisable timelines in Flutter.
https://pub.dev/packages/timeline_tile
MIT License
743 stars 146 forks source link

How to Increase the Progress bar or Timeline? #27

Closed prateekmedia closed 3 years ago

prateekmedia commented 3 years ago

I know it might be a silly question but I cannot find any reference on how to increase that bar, I can make it lets say Delivery app Timeline but how to increase the status of it without making the user refresh or restart the app. Do I have to rebuild that widget everytime? Or is their an selected Index Parameter by which I can update it easily as soon as data is received...

My situation is that I have a carousel and below that is the timeline and I want as soon as carousel item change it should change the timeline status whether decrease or increase.

Thanks in advance.

prateekmedia commented 3 years ago

Ok got it, we have to increase the value of indicator we used with setState like I used currentMonth so I have to set its value whenever Carousel is changed using set state, My code is below

onChanged: setState(){
                         currentMonth = currentPage + 1;
                     }

something like that.

JHBitencourt commented 3 years ago

Hey @prateekmedia, thanks for the issue.

That's correct, I'm glad you figure it out. The way you will update/change the timeline UI is up to you, and works like any other widget.

Just change your data and update the screen with any state management, e.g. the simple setState method.

prateekmedia commented 3 years ago

@JHBitencourt it would be nice to also document this in readme so that new users may be able to understand this function of the timeline as I can't see any references on readme or any other examples.