Skip to content

Animation loop controller #16

@aneeskA

Description

@aneeskA

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions