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

[Request] Hope to expose AnimationController #51

Closed
peng8350 opened this issue Jun 25, 2019 · 3 comments · Fixed by #54
Closed

[Request] Hope to expose AnimationController #51

peng8350 opened this issue Jun 25, 2019 · 3 comments · Fixed by #54
Labels
enhancement New feature or request help wanted Extra attention is needed quickfix request Additional Kit Requests

Comments

@peng8350
Copy link

I have a requirement to control the playback and pause of animation, so I hope to provide a parameter to pass AnimationController, so that I can control when the animation is played and when it is paused.

@jogboms jogboms added the request Additional Kit Requests label Jun 27, 2019
@jogboms
Copy link
Owner

jogboms commented Jun 27, 2019

Can you please explain a little bit more? How exactly does the current implementation limit what you want to do and what can of change would help out.

@peng8350
Copy link
Author

peng8350 commented Jun 28, 2019

gif9
As shown above, I want to achieve this effect: when the indicator enters the refresh state, it begins to call AnimationController. repeat () for animation loop effect. By looking at the source code, I found that the AnimationController for each indicator was encapsulated in its state and private.

My solution is only copy one of your indicator,and update like this.

final AnimationController animationController;
SpinKitFadingCircle({
    Key key,
    this.color,
    this.size = 50.0,
    this.itemBuilder,
    this.animationController,
    this.duration = const Duration(milliseconds: 1200),
  })

@override
  void initState() {
    super.initState();

    _controller = widget.animationController ?? AnimationController(vsync: this, duration: widget.duration);
   // _controller.repeat();
  }

@jogboms
Copy link
Owner

jogboms commented Jun 29, 2019

Okay. This could work and won't introduce any breaking changes. If you don't mind, can you create a PR for this? I am a bit swamped with personal work at the moment.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed quickfix request Additional Kit Requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants