Browse Source

Merge pull request 'fix: setState' (#43) from fix/dispose into develop

Reviewed-on: https://git.nwhco.ir/amirreza.chegini/hade_hoda_flutter/pulls/43
pull/44/head
amirreza.chegini 1 week ago
parent
commit
4e570a19a1
  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