content: import 'package:flutter/material.dart';
  
  void main() => runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    // This widget is the root of your application.
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    @override
    _MyHomePageState createState() => _MyHomePageState();
  }
  
  class _MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateMixin {
    AnimationController _controller;
    Animation<double> _animation;
  
    @override
    void initState() {
      super.initState();
      _controller = AnimationController(
        duration: const Duration(milliseconds: 1500),
        vsync: this,
        animationBehavior: AnimationBehavior.preserve,
      )..forward();
  
      _animation = CurvedAnimation(
        parent: _controller,
        curve: const Interval(0.0, 0.9, curve: Curves.fastOutSlowIn),
        reverseCurve: Curves.fastOutSlowIn,
      )..addStatusListener((AnimationStatus status) {
          if (status == AnimationStatus.dismissed) {
            _controller.forward();
          } else if (status == AnimationStatus.completed) {
            _controller.repeat();
          }
        });
    }
  
    @override
    void dispose() {
      _controller.stop();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(title: const Text('Indicator')),
        body: Center(
          child: AnimatedBuilder(
            animation: _animation,
            builder: (context, child) {
              return Column(
                children: <Widget>[
                  CircularProgressIndicator(value: _animation.value),
                  Text(
                    '${(_animation.value * 100.0).toStringAsFixed(1)}%',
                    textAlign: TextAlign.right,
                  )
                ],
              );
            },
          ),
        ),
      );
    }
  }
  