An implicit animation widget that flips from one number to another.

Last update: Jun 10, 2022

animated_flip_counter

An implicit animation widget that flips from one number to another.

Usage

It can be useful to display information that's constantly changing.

Animated Counter

Simply pass in a value and an optional duration and curve, just like any other implicit animation widget in Flutter.

AnimatedFlipCounter(
  duration: Duration(milliseconds: 500),
  value: _value, // pass in a value like 2014
)

Decimal Display

Use fractionDigits to specify how many digits to show after the decimal point. It handles negative values as well.

AnimatedFlipCounter(
  value: _value,
  fractionDigits: 2, // decimal precision
  suffix: "%",
  textStyle: TextStyle(
      fontSize: 40,
      color: _value >= 0 ? Colors.green : Colors.red,
  ),
)

Custom Style

Use the familiar TextStyle parameter for styling, and use prefix and suffix for additional texts.

AnimatedFlipCounter(
  value: _value,
  prefix: "Level ",
  textStyle: TextStyle(
    fontSize: 80,
    fontWeight: FontWeight.bold,
    letterSpacing: -8.0,
    color: Colors.yellow,
    shadows: [
      BoxShadow(
        color: Colors.orange,
        offset: Offset(8, 8),
        blurRadius: 8,
      ),
    ],
  ),
)

GitHub

https://github.com/h65wang/flutter-animated-counter
You might also like...

A flutter package which display the library collapse according to the number of images associated with hero animation

A flutter package which display the library collapse according to the number of images associated with hero animation

👏 Gallery Collapse A flutter package which display the library collapse accordi

Jun 7, 2022

A full-fledged one-to-one chat app developed entirely in Flutter

A full-fledged one-to-one chat app developed entirely in Flutter

Enigma Enigma - A minimalist, locked-down one-to-one chat app. Usage Flutter - Get Started Since this is a Firebase dependent project, create a Fireba

Jun 16, 2022

Change Application's name, package name, icon and Splash in one shot by one Command on Android & IOS

Change Application's name, package name, icon and Splash in one shot by one Command on Android & IOS

Change Application's name, package name, icon and Splash in one shot by one Command on Android & IOS. Installing dart pub global activate before_publi

Jun 21, 2022

Bloon - One click, One party - app to find club in Paris

Bloon - One click, One party - app to find club in Paris

Bloon Bloon is mobile application for E3 project in ESIEE Paris. It list all night clubs and events in Paris and recommend you according to you person

Oct 17, 2021

Google one tap sign in - Flutter Google One Tap Sign In (Android)

Google one tap sign in - Flutter Google One Tap Sign In (Android)

Google One Tap Sign In Google One Tap Sign In (Android) A Flutter Plugin for Goo

Feb 11, 2022

Another state management solution

VxState VxState is a state management library built for Flutter apps with focus on simplicity. It is inspired by StoreKeeper & libraries like Redux, V

Jun 20, 2022

Yet another booru viewer for Android

Yet another booru viewer for Android

Yet another booru imageboards viewer for Android Download Preview Click Here Building You can build this app just like any other flutter app, for exam

Jun 17, 2022

Yet another Todo app, now using Flutter (with ScopedModel)

Yet another Todo app, now using Flutter (with ScopedModel)

Flutter Todo Yet another Todo app, now using Flutter. Getting Started This Todo app is implemented using Flutter (with Scoped Model for state manageme

Jun 12, 2022

Yet another localization approach in Flutter

Yet another localization approach in Flutter

Flutter Global Summit Vol.2 schedule Source code of the mobile application that displays the schedule of the Flutter Global Summit Vol.2 conference th

Mar 24, 2022

Approximate how your app looks and performs on another device.

Approximate how your app looks and performs on another device.

Approximate how your app looks and performs on another device. Main features Preview any device from any device Change the device orientation Dynamic

Jun 29, 2022

Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern.

Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern.

Karee Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern. + = About Karee Karee is a frame

May 4, 2022

Receive sharing photos, videos, text, URLs, or any other file types from another app.

Receive sharing photos, videos, text, URLs, or any other file types from another app.

Receive Sharing Files To Flutter App Through Other Apps Receive sharing photos, videos, text, URLs, or any other file types from another app. Visit :

May 9, 2022

open another app in flutter.

external_app_try A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Dec 27, 2021

A Flutter based to do list app (yes, another to do list... but... this time based on a beautiful design)

A Flutter based to do list app (yes, another to do list... but... this time based on a beautiful design)

✔️ Flutter to do App "To Do List" A Flutter app based on the design of the To Do App, created by Rudi Hartono, see more on: Uplabs. Getting Started 🚀

Jun 23, 2022

Another Awesome Online Radio Player

Another Awesome Online Radio Player

kRadio Player Another Awesome Online Radio Player. Getting Started Follow the guide on how to install Flutter. Clone the repository and open with your

Jun 22, 2022

Just another tape player has been written in Flutter for iOS and Android

Just another tape player has been written in Flutter for iOS and Android

Just another tape player has been written in Flutter for iOS and Android. The application is able to find tapes and theirs images using https://zxInfo.dk public API and upload them to ZX-Spectrum compatible computers by the audio output of the smartphone. Now it supports TAP and TZX tape images only.

Jun 15, 2022

Zone is yet another Hacker News client, built with Flutter, Slidy, and Hacker News API.

Zone is yet another Hacker News client, built with Flutter, Slidy, and Hacker News API.

Zone for Hacker News Zone is yet another Hacker News client, built with Flutter, Slidy, and Hacker News API. Setup Clone this repo to your machine Req

Feb 27, 2022

Type - Yet another typing test made in Flutter

Type - Yet another typing test made in Flutter

another typing test Yet another typing test made in Flutter, because why not. Tr

May 30, 2022
Comments
  • 1. prepending zero

    I am trying to use this widget for a simple 2-digit countdown and also for a clock. I need 2-digits shown at any time (ie 11, 10, 09, 08, 07...). I can prepend '0' for values that are <10 but I will lose the animation for that zero that's added. Any way to have this feature?

    My current workaround:

    AnimatedFlipCounter(
      value: time.toDouble(),
      prefix: time<10 ? '0' : '',
    ),
    
    Reviewed by ench0 at 2021-10-15 10:39
  • 2. Single text widgets having more width than single text widget

    I wonder if there is a solution for this?

        return Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text("123,123,123", style: TextStyle(fontSize: 24)),
            Row(
              children: [
                Text("1", style: TextStyle(fontSize: 24)),
                Text("2", style: TextStyle(fontSize: 24)),
                Text("3", style: TextStyle(fontSize: 24)),
                Text(",", style: TextStyle(fontSize: 24)),
                Text("1", style: TextStyle(fontSize: 24)),
                Text("2", style: TextStyle(fontSize: 24)),
                Text("3", style: TextStyle(fontSize: 24)),
                Text(",", style: TextStyle(fontSize: 24)),
                Text("1", style: TextStyle(fontSize: 24)),
                Text("2", style: TextStyle(fontSize: 24)),
                Text("3", style: TextStyle(fontSize: 24)),
              ],
            ),
          ],
        );
    

    IMG_268FDF42EC11-1

    Reviewed by SimonHausdorf at 2022-05-20 10:08
  • 3. Tween animation when adding digits

    I was wondering if it would be easy to add a tween animation if the width is expanding (a digit is added). There is already a tween animation for the "-". To implement it like in the video below, we would need to know the width of the number and the width after adding a digit if I am not wrong.

    Any suggestion?

    https://user-images.githubusercontent.com/1446685/169464500-83e6ffe1-bd25-48b4-a7a7-9121c1322b18.mp4

    Reviewed by SimonHausdorf at 2022-05-20 06:16
  • 4. text value spacing issue

    AnimatedFlipCounter( curve: Curves.slowMiddle, value: price, fractionDigits: 2, // decimal precision textStyle: const TextStyle( letterSpacing: -4.0, wordSpacing: 0.0, color: simpleTextColor, fontWeight: FontWeight.w700, fontSize: 32.0, ), ),

    Reviewed by husnain067 at 2022-02-23 11:34

Related

Widget Workshops

Widget Workshops by SuperDeclarative! Hello! This is the source code repository for Widget Workshops created by SuperDeclarative! Check out the SuperD

Feb 1, 2022
An implicit animation widget for rotation
An implicit animation widget for rotation

AnimatedRotation An implicitly animated version of RotationTransition which automatically transitions the rotation over time when the provided angle c

Jun 4, 2021
Flutter Number Picker is a custom widget designed for choosing an integer or decimal number by using add and minus buttons
Flutter Number Picker is a custom widget designed for choosing an integer or decimal number by using add and minus buttons

Flutter Number Picker is a custom widget designed for choosing an integer or decimal number by using add and minus buttons. Getting Started Head to /p

Aug 3, 2021
Another example of transitioning over a single tap or one click
Another example of transitioning over a single tap or one click

magic_8_ball_flutter A new Flutter project. It is another example of transitioning over a single tap or one click. Getting Started This project is a s

Mar 21, 2022
Dart package that converts number to words (English language)A Flutter/Dart package that converts number to words (English language)

flutter_number_to_words_english A Flutter/Dart package that converts number to words (English language) Flutter (Null Safety) Flutter (Channel stable,

May 19, 2022
Login Animation Ruchika GuptaLogin Animation [953⭐] - Smooth animation from login to home by Ruchika Gupta.
Login Animation Ruchika GuptaLogin Animation [953⭐] - Smooth animation from login to home by Ruchika Gupta.

Flutter Login Home Animation A new open-source Flutter project that enables the developer to quickly get started with the Flutter animation and applic

Jun 18, 2022
Flutter: Animation Series || Episode 1 || Basic Animation || Episode 1 || Basic Animation

animationseries A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Jun 5, 2022
Flutter animation tutorials, such common animation, flare animation.
Flutter animation tutorials, such common animation, flare animation.

❤️ Star ❤️ the repo to support the project or ?? Follow Me.Thanks! Facebook Page Facebook Group QQ Group Developer Flutter Open Flutter Open 963828159

Jun 17, 2022
Flutter animation tutorials, such common animation, flare animation.
Flutter animation tutorials, such common animation, flare animation.

❤️ Star ❤️ the repo to support the project or ?? Follow Me.Thanks! Facebook Page Facebook Group QQ Group Developer Flutter Open Flutter Open 963828159

May 2, 2022
This app developed for making fun with sms. You can send huge sms to other's number by one click. It is behaving like a bomb

SMS Bomber This app developed for making fun with sms. You can send huge sms to other's number by one click. It is behaving like a bomb Getting Starte

Dec 21, 2021