Skip to content

GFCarousel active page indicator is not being updated without "onPageChanged" #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yasalkhatib opened this issue May 2, 2020 · 5 comments

Comments

@yasalkhatib
Copy link

yasalkhatib commented May 2, 2020

I noticed that the active page indicator is not being updated without explicitly call setState on onPageChanged callback.

Currently, if I need to update the active page indicator, I have to use GFCarousel inside a stateful widget and set onPageChanged,

onPageChanged: (index){
        setState(() {});
},
@ngoctranfire
Copy link

Hey @yasalkhatib, I solved this by wrapping it in my own StatefulWidget and calling setState(). This is a limitation they have. Something that I am trying to figures out now is how to actually start the indicators at the right "startingPageIndex" if I set an initialPage = 5, and I have 6 items, I want the dots to show active indicator at the end. However, it isn't doing this for me.

@yasalkhatib
Copy link
Author

That's correct you, need to wrap it in a stateful widget and then call setState({}) on onPageChanged callback. However, I believe, this is a bug and for sure is not the intended behavior.

@yasalkhatib
Copy link
Author

yasalkhatib commented May 7, 2020

Regarding your question about "startingPageIndex". I faced the same problem. After reading the code, I found that the current implementation of GFCarousel doesn't take into consideration the initalPageIndex and always sets the dot index to 0.

Could you please open a separate issue and I will comment on it with a possible solution.

@ngoctranfire
Copy link

@yasalkhatib, sure. I created an issue here: #144

@deepikahr
Copy link
Contributor

@yasalkhatib Hey, It will be fixed in upcoming version. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants