counter_animation 0.0.2 copy "counter_animation: ^0.0.2" to clipboard
counter_animation: ^0.0.2 copied to clipboard

A very simple (50 lines of code, see Git rep) flutter package for animating a counter that decrements or increments an integer.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @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> {

  @override
  Widget build(BuildContext context) {

    TextStyle textStyle = new TextStyle(fontSize: 58);

    return Scaffold(
      appBar: AppBar(
        title: Text('Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            CounterAnimation(
                begin: 0,
                end: 50,
                duration: 5,
                curve: Curves.easeOut,
                textStyle: textStyle
            ),
          ],
        ),
      ),
    );
  }
}
5
likes
30
pub points
12%
popularity

Publisher

unverified uploader

A very simple (50 lines of code, see Git rep) flutter package for animating a counter that decrements or increments an integer.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on counter_animation