diff --git a/lib/widget/animated_visibility.dart b/lib/widget/animated_visibility.dart index 2aab2152..4bd5a251 100644 --- a/lib/widget/animated_visibility.dart +++ b/lib/widget/animated_visibility.dart @@ -27,6 +27,12 @@ class AnimatedVisibility extends StatefulWidget { } class _AnimatedVisibilityState extends State { + @override + initState() { + super.initState(); + _isActive = widget.opacity > 0; + } + @override build(BuildContext context) { if (!_isActive && widget.opacity > 0) { @@ -54,5 +60,5 @@ class _AnimatedVisibilityState extends State { widget.onEnd?.call(); } - bool _isActive = true; + late bool _isActive; }