This assertion follows me around using different codes for some reason now, searching about it and found that the flutter team hasn't solved it yet for a while now, is there anything we can do?
v`I/flutter ( 5598): Another exception was thrown:
'package:flutter/src/animation/animations.dart': Failed assertion: line
376 pos 15: 'parent != null': is not true.
I/chatty ( 5598): uid=10085(com.example.gam3ity_aa) 1.ui identical 21
lines
I/flutter ( 5598): Another exception was thrown:
'package:flutter/src/animation/animations.dart': Failed assertion: line
376 pos 15: 'parent != null': is not true.
I/flutter ( 5598): Another exception was thrown:
'package:flutter/src/animation/animations.dart': Failed assertion: line
376 pos 15: 'parent != null': is not true.
I/chatty ( 5598): uid=10085(com.example.gam3ity_aa) 1.ui identical 10
lines
I/flutter ( 5598): Another exception was thrown:
'package:flutter/src/animation/animations.dart': Failed assertion: line
376 pos 15: 'parent != null': is not true.
I/flutter ( 5598): Another exception was thrown:
'package:flutter/src/animation/animations.dart': Failed assertion: line
376 pos 15: 'parent != null': is not true.
I/chatty ( 5598): uid=10085(com.example.gam3ity_aa) 1.ui identical 8
lines
I/flutter ( 5598): Another exception was thrown:
'package:flutter/src/animation/animations.dart': Failed assertion: line
376
pos 15: 'parent != null': is not true.
`
This was happening for me when accidentally creating a Tween object with (parent: null)
@override
void initState() {
_animation = Tween(begin: 0.0, end: 1.0).animate(CurvedAnimation(
parent: null, // <---------------- This line should be an AnimationController
curve: widget.curve,
reverseCurve: widget.reverseCurve ?? widget.curve,
));
super.initState();
}
It should have been like this:
AnimationController _animationController;
Animation _animation;
@override
void initState() {
_animationController = AnimationController(
duration: Duration(milliseconds: 500),
reverseDuration: Duration(milliseconds: 1000),
vsync: this,
value: 1.0
);
_animation = Tween(begin: 0.0, end: 1.0).animate(CurvedAnimation(
parent: _animationController,
curve: widget.curve,
reverseCurve: widget.reverseCurve ?? widget.curve,
));
super.initState();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With