im_animations icon indicating copy to clipboard operation
im_animations copied to clipboard

Getting Error: This ticker was canceled

Open rohitsangwan01 opened this issue 2 years ago • 7 comments

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)

rohitsangwan01 avatar Jul 15 '22 08:07 rohitsangwan01

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)

KimAloy avatar Jul 27 '22 12:07 KimAloy

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

imujtaba8488 avatar Aug 12 '22 18:08 imujtaba8488

@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();

KimAloy avatar Aug 12 '22 19:08 KimAloy

same error

tegarkurniawan avatar Sep 11 '22 05:09 tegarkurniawan

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();

KimAloy avatar Sep 11 '22 07:09 KimAloy

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

imujtaba8488 avatar Sep 11 '22 13:09 imujtaba8488

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)

fraca98 avatar Sep 14 '22 14:09 fraca98