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

Getting Error: This ticker was canceled #4

Open
rohitsangwan01 opened this issue Jul 15, 2022 · 7 comments
Open

Getting Error: This ticker was canceled #4

rohitsangwan01 opened this issue Jul 15, 2022 · 7 comments

Comments

@rohitsangwan01
Copy link

Hey ,am using Rotation Animation , and this Widget is in if/Else condition
so on changing condition , widget is changing ,
for example , this RotationAnimatedWidget will be replaced with a container
so on Changing , getting this error Every time
[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: This ticker was canceled: Ticker(created by _RotateState#86658)

@KimAloy
Copy link

KimAloy commented Jul 27, 2022

Hi, I'm also getting the error when I use the HeartBeat on the second page and press the back button.
E/flutter ( 3021): [ERROR:flutter/shell/common/shell.cc(93)] Dart Unhandled Exception: This ticker was canceled: Ticker(created by _HeartBeatState#56128)

@imujtaba8488
Copy link
Owner

@rohitsangwan01 @KimAloy sorry for getting back to you later on this ... let me fix this and get back to your ASAP

@KimAloy
Copy link

KimAloy commented Aug 12, 2022

@imujtaba8488 @rohitsangwan01 The error seems to be thrown by _controller.repeat().orCancel;

I replaced it with code below and it doesn't throw any errors

@override
  void didUpdateWidget(ABeats oldWidget) {
    _controller.reset();
    // _controller.repeat().orCancel;          <---- replaced this with code below
    _controller.forward();
    _controller.repeat();
    super.didUpdateWidget(oldWidget);
  }

and this

  // Since a heartbeat, so repeats infinitely.
    // _controller.repeat().orCancel;      <---- replaced this with code below
    _controller.forward();
    _controller.repeat();

@tegarkurniawan
Copy link

same error

@KimAloy
Copy link

KimAloy commented Sep 11, 2022

same error

Click to open the method you want to use (Ctrl+Click in android studio).

Replace every _controller.repeat().orCancel; with these two lines of code:
_controller.forward(); _controller.repeat();

@imujtaba8488
Copy link
Owner

@KimAloy please file a PR so that others' may also benefit

@fraca98
Copy link

fraca98 commented Sep 14, 2022

same error

Click to open the method you want to use (Ctrl+Click in android studio).

Replace every _controller.repeat().orCancel; with these two lines of code: _controller.forward(); _controller.repeat();

I implemented that, but i still get the same error on the HeartBeat animation sometimes (that's why i closed my pull request)

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

5 participants