title: How to have a custom animation as a Flutter progress / loading indicator?
body: <p>I am trying to replace the default CircularProgressIndicator with my own animation. I created a spinning widget based on the example here <a href="https://stackoverflow.com/questions/53745546/how-to-rotate-an-image-using-flutter-animationcontroller-and-transform">How to rotate an image using Flutter AnimationController and Transform?</a> , but when replacing CircularProgressIndicator with "MyIconSpinner", for some reason it is not appearing. Any tips please?
  Here are the contents of MyIconSpinner</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter_icons/flutter_icons.dart';
  
  class MyIconSpinner extends StatefulWidget {
    MyIconSpinner({Key key, this.title}) : super(key: key);
  
    final String title;
  
    @override
    _MyIconSpinnerState createState() =&gt; _MyIconSpinnerState();
  }
  
  class _MyIconSpinnerState extends State&lt;MyIconSpinner&gt;
      with TickerProviderStateMixin {
    AnimationController _controller;
  
    @override
    void initState() {
      _controller = AnimationController(
        duration: const Duration(milliseconds: 5000),
        vsync: this,
      );
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
      _controller.forward();
  
      return Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: &lt;Widget&gt;[
              RotationTransition(
                turns: Tween(begin: 0.0, end: 1.0).animate(_controller),
                child: Icon(
                  Icons.star,
                  size: 40,
                ),
              ),
            ],
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>I am placing it in a widget like this</p>
  
  <pre><code>return Scaffold(
      appBar: AppBar(
        title: Text("Appbar"),
        backgroundColor: Colors.black,
        automaticallyImplyLeading: false,
      ),
      body: Center(
          child: Column(children: &lt;Widget&gt;[
          StreamBuilder(
              stream: doSomething(withSomeData),
              builder: (BuildContext context,
                  AsyncSnapshot&lt;List&lt;DocumentSnapshot&gt;&gt; asyncSnapshot) {
               if (!asyncSnapshot.hasData) return MyIconSpinner();
  </code></pre>