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

Added controller. hint() to trigger UI hint #33

Closed
wants to merge 2 commits into from
Closed

Added controller. hint() to trigger UI hint #33

wants to merge 2 commits into from

Conversation

ciriousjoker
Copy link
Collaborator

Fixes #32

  • Version bumped to 0.5.0

Usage

FlipCardController _controller = FlipCardController();
 
 _controller.hint(
   // optional
   duration: Duration(milliseconds: 400),
   // optional
   total: Duration(milliseconds: 900),
 );
 
 FlipCard(
   direction: FlipDirection.HORIZONTAL,
   controller: _controller,
   onFlip: () {
     //
   },
   back: Center(
     child: Container(
       child: ProjectFrontWidget(
         project: widget.project,
       ),
     ),
   ),
   front: Container(
     color: Colors.red,
     child: Center(
       child: ProjectBackWidget(
         project: widget.project,
       ),
     ),
   ),
 );

The duration will only run if not flipped yet and not already animating.
Animation runs for duration and reverses afterwards. The total duration will be used for this animation only and resets afterwards.

@ciriousjoker
Copy link
Collaborator Author

Actually, don't merge this just yet, I'll clean up the syntax and expose the controller as well to allow more control from outside.

@ciriousjoker
Copy link
Collaborator Author

Even if GlobalKeys are possible, Controllers are preferred. The controller that's introduced by this PR also provides the ability to access widget state if required.

This can be merged if you want, it's stable now.

@ciriousjoker
Copy link
Collaborator Author

@fedeoo Could you please merge this?

@ciriousjoker
Copy link
Collaborator Author

0.5.1 solves a use case where the card is aligned to the top (which can't be changed from outside this package)

@fedeoo
Copy link
Collaborator

fedeoo commented Apr 1, 2021

Merged in this PR. #39
I'm closing this one. Thanks for your work.
I hope @BrunoJurkovic or you can help to maintain this repo as I am not working with flutter now.

@fedeoo fedeoo closed this Apr 1, 2021
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

Successfully merging this pull request may close these issues.

[Feature request] Programmatically trigger a hint that the card can be flipped
2 participants