Skip to content

Animation loop controller #16

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

Open
aneeskA opened this issue Feb 17, 2023 · 0 comments
Open

Animation loop controller #16

aneeskA opened this issue Feb 17, 2023 · 0 comments

Comments

@aneeskA
Copy link

aneeskA commented Feb 17, 2023

Excellent plugin. Is it possible to add a loop to the controller also? My use case is this: I have a download operation in progress when a button is clicked using Icons.refresh_outlined icon button. It needs to spin till the action is complete.

I created an animation controller

_controller = AnimationController(
      vsync: this, // the SingleTickerProviderStateMixin
      duration: Duration(seconds: 1),
    );

and the button as

AnimatedIconButton(
    animationController: _controller,
    icons: [
      AnimatedIconItem(
        icon: Icon(
          Icons.refresh_outlined,
          color: Colors.white,
        ),
        onPressed: () async {
          // _controller.forward();
          _controller.loop(count: 10);
          print("start");
          await InstallQuestions().Do();
          await Future.delayed(Duration(seconds: 3));
          print("end");
          _controller.stop();
        },
      ),
    ],
  ),

The plugin seems to ignore loop. Is that correct?

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

1 participant