Skip to content
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

Feature request: control flip state from widget parameters #40

Open
canastro opened this issue Apr 18, 2021 · 3 comments
Open

Feature request: control flip state from widget parameters #40

canastro opened this issue Apr 18, 2021 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@canastro
Copy link

I'm trying to use this library but In my case I needed the flip_card to be "uncontrolled" (I'm sorry for the react.js terminology)
ie. this widget would dispatch onTap events and would react to isFront from parameters provided from the parent Widget.

Is it possible to do this with the current version of the lib? Is there any plans to support something like this?

@BrunoJurkovic
Copy link
Owner

Could you please elaborate, I am not really familiar with react terminology, if you want to flip the card without touching it there is a controller built in to change it manually. Hope this solves it for you

@BrunoJurkovic BrunoJurkovic added the question Further information is requested label Oct 9, 2021
@joprice
Copy link

joprice commented Jan 3, 2022

I'm looking for something similar to what @canastro is after: Being able to provide a parameter like "isFront: true" that determines the face that is showing. You'd then use onTap callback to set the value of isFront. It would allow declaratively controlling which side is showing and avoids issues where toggling state can result in the ui being out of sync with the intended ui state.

@joprice
Copy link

joprice commented Jan 4, 2022

Providing a controller, then calling flipCardController.controller!.forward() and backward in a didUpdateWidget should work. Here's a post about that pattern: https://clarkeswiedler.github.io/flutter-declarative-animation/.

@ciriousjoker ciriousjoker added the enhancement New feature or request label Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants