title: Flutter: how do I disable and enable play/pause flare animations?
body: <p>Currently, both play and pause animations are showing up. The problem is when I press play, the pause button becomes visible but it is overlapping the play animation button. Also, pressing the button plays the audio on top of that is already playing.</p>
  
  <p>Update May 11: Still looking for a solution. Currently, I'm having troubling making the flare pause animation button visible after I click the play animation button</p>
  
  <pre><code>import 'package:audioplayers/audio_cache.dart';
  import 'package:audioplayers/audioplayers.dart';
  import 'package:flutter/material.dart';
  import 'package:flare_flutter/flare_actor.dart';
  
  class Omm extends StatefulWidget {
    @override
    _OmmState createState() =&gt; _OmmState();
  }
  
  class _OmmState extends State&lt;Omm&gt;
      with SingleTickerProviderStateMixin {
    bool _isPlaying = true;
    static bool isVisible = false;
  
    @override
    void initState() {
      super.initState();
      _audioCache = AudioCache(
          prefix: "audio/",
          fixedPlayer: AudioPlayer()..setReleaseMode(ReleaseMode.STOP));
    }
  
    var flay = Visibility(
      visible: !isVisible,
      child: FlareActor('assets/playbut3.flr',
          alignment: Alignment.center,
          fit: BoxFit.contain,
          color: Color(0xFF2a9d8f),
          animation: "playbutton"),
    );
  
    var fause = Visibility(
      visible: isVisible,
      child: FlareActor(
        'assets/pausebutton.flr',
        alignment: Alignment.center,
        fit: BoxFit.contain,
        color: Color(0xFF2a9d8f),
        animation: "pausebutton",
      ),
    );
  
    AudioCache _audioCache;
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        // appBar: AppBar(title: Text("Animation")),
        body: Stack(
          alignment: Alignment.center,
          children: &lt;Widget&gt;[
            Align(
              alignment: Alignment(0, 0.5),
              child: RaisedButton(
                child: !_isPlaying ? fause : flay,
                onPressed: () {
                  if (_isPlaying)
                    setState(() =&gt; isVisible = true);
                  else
                    setState(() =&gt; isVisible = false);
                  setState(() =&gt; _isPlaying = !_isPlaying);
                  _audioCache.play('1min.mp3');
                },
              ),
            ),
          ],
        ),
      );
    }
  }
  </code></pre>