loading_indicator
loading_indicator copied to clipboard
"AnimationController.stop() called after AnimationController.dispose()\nAnimationController methods should not be used after calling dispose."
get: ^4.3.4 loading_indicator: ^3.0.2
Exception has occurred.
"Error: Assertion failed: file:///C:/flutter/packages/flutter/lib/src/animation/animation_controller.dart:772:7
_ticker != null
"AnimationController.stop() called after AnimationController.dispose()\nAnimationController methods should not be used after calling dispose."
at Object.throw_ [as throw] (http://localhost:49699/dart_sdk.js:5063:11)
at Object.assertFailed (http://localhost:49699/dart_sdk.js:4988:15)
at animation_controller.AnimationController.new.stop (http://localhost:49699/packages/flutter/src/animation/animation_controller.dart.lib.js:453:42)
at animation_controller.AnimationController.new.repeat (http://localhost:49699/packages/flutter/src/animation/animation_controller.dart.lib.js:395:12)
at http://localhost:49699/packages/loading_indicator/src/indicators/triangle_skew_spin.dart.lib.js:7687:51
at _RootZone.runUnary (http://localhost:49699/dart_sdk.js:40062:59)
at _FutureListener.then.handleValue (http://localhost:49699/dart_sdk.js:34983:29)
at handleValueCallback (http://localhost:49699/dart_sdk.js:35551:49)
at Function._propagateToListeners (http://localhost:49699/dart_sdk.js:35589:17)
at _Future.new.[_complete] (http://localhost:49699/dart_sdk.js:35429:25)
at http://localhost:49699/dart_sdk.js:34534:30
at internalCallback (http://localhost:49699/dart_sdk.js:26215:11)"
code to reproduce
@override
Widget build(BuildContext context) {
return Container(
height: height,
child: Obx(() => body()),
);
}
Widget body() {
if (!firstLoaded.value && firstLoadingScreen) {
return loadingPanel();
} else {
return content();
}
}
Widget loadingPanel() {
return Center(
child: SizedBox(
height: 10,
width: 46,
child: LoadingIndicator(
indicatorType: Indicator.ballBeat,
colors: [
Colors.black.withOpacity(.2),
Colors.black,
Colors.black.withOpacity(.8)
],
strokeWidth: 2,
),
),
);
}
Widget content() {
return NotificationListener<ScrollNotification>(
onNotification: (scrollNotification) {
if (scrollNotification.metrics.pixels >=
scrollNotification.metrics.maxScrollExtent) {
load();
}
return true;
},
....
@astheras it seems the code is not the root cause of error.
at http://localhost:49699/packages/loading_indicator/src/indicators/triangle_skew_spin.dart.lib.js:7687:51
but the code is indicatorType: Indicator.ballBeat,
It happens to me all the time as well, any solution?
can u provide minimum reproduce code?