fix: setState #43

Merged
amirreza.chegini merged 1 commits from fix/dispose into develop 1 week ago
  1. 2
      lib/core/widgets/animations/globe_animation.dart

2
lib/core/widgets/animations/globe_animation.dart

@ -41,6 +41,7 @@ class _GlobeAnimationState extends State<GlobeAnimation>
_controller.repeat(reverse: true); _controller.repeat(reverse: true);
_timer = Timer.periodic(Duration(seconds: 1), (timer) { _timer = Timer.periodic(Duration(seconds: 1), (timer) {
if (_gradient == null) { if (_gradient == null) {
if (!mounted) return;
setState(() { setState(() {
_gradient = RadialGradient( _gradient = RadialGradient(
colors: [ colors: [
@ -61,6 +62,7 @@ class _GlobeAnimationState extends State<GlobeAnimation>
_timer?.cancel(); _timer?.cancel();
_timer = null; _timer = null;
_controller.stop(); _controller.stop();
if (!mounted) return;
setState(() { setState(() {
_gradient = RadialGradient( _gradient = RadialGradient(
colors: [ colors: [

Loading…
Cancel
Save