Animate search icon only if the view is still mounted
This commit is contained in:
parent
2e482f6815
commit
7783fabdb9
1 changed files with 3 additions and 3 deletions
|
@ -156,9 +156,9 @@ class _AnimatedSearchIconWidgetState extends State<AnimatedSearchIconWidget>
|
|||
AnimationController(duration: const Duration(seconds: 1), vsync: this);
|
||||
_animation = Tween<double>(begin: 100, end: 200).animate(_controller)
|
||||
..addListener(() {
|
||||
setState(() {
|
||||
// The state that has changed here is the animation object’s value.
|
||||
});
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
})
|
||||
..addStatusListener((status) {
|
||||
if (status == AnimationStatus.completed) {
|
||||
|
|
Loading…
Add table
Reference in a new issue