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

Failed assertion: line 732 pos 7: '_ticker != null': AnimationController.stop() called after AnimationController.dispose() #16

Open
obrunsmann opened this issue Mar 22, 2020 · 7 comments

Comments

@obrunsmann
Copy link

Hey!

I am using this package within the following BLoC implementation:

Center(
  child: state is LogCreateSubmitting
      ? Loading()
      : RaisedButton(
          child: Text('Submit'),
          onPressed: () {
            context.bloc<LogCreateBloc>().add(CreateFormSubmitted(
                  _startDate,
                  _endDate,
                  _summaryController.text,
                  _noteController.text,
                ));
          },
        ),
),

As soon as the state changes await from LogCreateSubmitting and the Loading gets unmounted the exception throws.

I wrapped your Library withing a small statelss widget so that I do not have to repeat my loading type all over the application:

import 'package:flutter/material.dart';
import 'package:loading/indicator/ball_pulse_indicator.dart';
import 'package:loading/loading.dart' as LoadingSdk;

class Loading extends StatelessWidget {
  const Loading({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return LoadingSdk.Loading(
      color: Theme.of(context).primaryColor,
      indicator: BallPulseIndicator(),
    );
  }
}

Log:

[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: 'package:flutter/src/animation/animation_controller.dart': Failed assertion: line 732 pos 7: '_ticker != null': AnimationController.stop() called after AnimationController.dispose()
AnimationController methods should not be used after calling dispose.
#0      _AssertionError._doThrowNew  (dart:core-patch/errors_patch.dart:42:39)
#1      _AssertionError._throwNew  (dart:core-patch/errors_patch.dart:38:5)
#2      AnimationController.stop 
package:flutter/…/animation/animation_controller.dart:732
#3      AnimationController.repeat 
package:flutter/…/animation/animation_controller.dart:628
#4      BallPulseIndicator.startAnim  (package:loading/indicator/ball_pulse_indicator.dart:48:16)
#5      BallPulseIndicator.startAnims.<anonymous closure>  (package:loading/indicator/ball_pulse_indicator.dart:55:9)
#6      new Future.delayed.<anonymous closure>  (dart:async/future.dart:316:39)
#7      _rootRun  (dart:async/zone.dart:1122:38)
#8      _CustomZon<…>
@410063005
Copy link

410063005 commented Mar 30, 2020

I've encountered the same question。 This is my workaround: create a fixed verson Indicator

https://gist.github.com/410063005/937a9a464a58f5bcc1c0d9b4ad1f1b31

Hope it helps

@410063005
Copy link

It was fixed in this commit 8f5a63f

But maybe we need a new release

@smasinde
Copy link

If anyone wants to use the fix while you wait for the official release, put it like this in your pubspec:

 loading:
    git:
      url: git://github.com/leonzone/loading.git
      path: loading
      ref: 8f5a63f

@Dreamersoul
Copy link

hello,
when will be released officially?
thank you

@silkyland
Copy link

Release this please.....

@zenkog
Copy link

zenkog commented Oct 1, 2020

Got the same issue, when will this be released ?

@m0veax
Copy link

m0veax commented Feb 1, 2021

Can we support you to release that commit?

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

7 participants