progress_animation_builder 1.0.0+2 copy "progress_animation_builder: ^1.0.0+2" to clipboard
progress_animation_builder: ^1.0.0+2 copied to clipboard

ProgressAnimationBuilder passes Animation<double> according to value(0.0-1.0).

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:progress_animation_builder/progress_animation_builder.dart';

void main() => runApp(const App());

class App extends StatelessWidget {
  const App({Key key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const _Home(),
    );
  }
}

class _Home extends StatefulWidget {
  const _Home({Key key}) : super(key: key);

  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<_Home> {
  var _isInitial = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Column(
        children: [
          ProgressAnimationBuilder(
            value: _isInitial ? 0 : 1,
            duration: Duration(milliseconds: 1000),
            curve: Curves.slowMiddle,
            builder: (context, animation) {
              return Column(
                children: <Widget>[
                  AnimatedIcon(
                    size: MediaQuery.of(context).size.width * 3 / 4,
                    icon: AnimatedIcons.play_pause,
                    progress: animation,
                  ),
                  AnimatedBuilder(
                    animation: animation,
                    builder: (context, child) {
                      return Slider(
                        value: animation.value.clamp(0, 1).toDouble(),
                        onChanged: null,
                      );
                    },
                  ),
                ],
              );
            },
          ),
        ],
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () => setState(() => _isInitial = !_isInitial),
        child: Icon(Icons.refresh),
      ),
    );
  }
}
2
likes
40
points
2
downloads

Publisher

verified publishermono0926.com

Weekly Downloads

ProgressAnimationBuilder passes Animation<double> according to value(0.0-1.0).

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on progress_animation_builder