A package for flip panel with built-in animation

Overview

Flip Panel

pub package

A package for flip panel with built-in animation

How to use

import 'package:flip_panel/flip_panel.dart';

Create a flip panel from iterable source:

final digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];

FlipPanel.builder(
    itemBuilder: (context, index) => Container(
       color: Colors.black,
       padding: const EdgeInsets.symmetric(horizontal: 6.0),
       child: Text(
         '${digits[index]}',
         style: TextStyle(
             fontWeight: FontWeight.bold,
             fontSize: 50.0,
             color: Colors.white),
       ),
     ),
    itemsCount: digits.length,
    period: const Duration(milliseconds: 1000),
    loop: 1,
)

Create a flip panel from stream source:

FlipPanel<int>.stream(
      itemStream: Stream.periodic(Duration(milliseconds: 1000), (count) => count % 10),
      itemBuilder: (context, value) => Container(
        color: Colors.black,
        padding: const EdgeInsets.symmetric(horizontal: 6.0),
        child: Text(
          '$value',
          style: TextStyle(
            fontWeight: FontWeight.bold,
            fontSize: 50.0,
            color: Colors.white
          ),
        ),
      ),
      initValue: 0,
  );
Comments
  • reverseCountdown doesn't stop at zero

    reverseCountdown doesn't stop at zero

    FlipClock.reverseCountdown doesn't stop at zero mark, and also don't run alert function when countdown is done

    DateTime now = DateTime.now();
    DateTime debugTime = DateTime(
            now.year, now.month, now.day, now.hour, now.minute, now.second + 10);
    
    FlipClock.reverseCountdown(
                duration: _duration,
                digitColor: Colors.white,
                backgroundColor: Colors.black,
                digitSize: 35.0,
                
                flipDirection: FlipDirection.down,
                borderRadius: const BorderRadius.all(Radius.circular(3.0)),
                onDone: alert(),
              ),
    
    alert() {
        print('Done');
      }
    

    How to fix this?

    opened by Cypher-XI 3
  • FlipClock.simple positioned at bottom of parent container always

    FlipClock.simple positioned at bottom of parent container always

    I would like to modify the height of the parent container to remove the padding around the Simple FlipClock, but if I resize the parent container it does not reposition the clock panel. Is there a way to do this?

    The following code produces the image attached in the issue: screenshot 2019-01-22 at 10 19 41

    Container(
          height: 220,
            color: Colors.yellow,
            child: Center(
              child: FlipClock.simple(
                startTime: DateTime.now(),
                digitColor: Colors.white,
                backgroundColor: Colors.red,
                digitSize: 48.0,
                borderRadius: const BorderRadius.all(Radius.circular(3.0)),
              ),
            ),
          ),
    
    opened by danielhakimi 3
  • FlipPanel.stream not updating properly when using a ticker provider mixin

    FlipPanel.stream not updating properly when using a ticker provider mixin

    It's possible that I'm just completely failing to use streams correctly, but I think this might actually be a bug.

    Expected behavior: FlipPanel increments up by 1 every 2 seconds. Ticker drives animation controller, using a status listener to update an integer and adding it to the stream (calling setState appropriately) every time the duration ends (also restarts AnimationController), every 2 seconds. Flip panel receives each new number as it is added to the StreamController, and updates accordingly

    Actual behavior: All of the above happens (the counter updates correctly and everything) except the FlipPanel flips... and shows the same number over and over. However if the FAB (also hooked up to update the counter) is pressed, the Flip panel suddenly jumps to the correct number before continuing to show that new number over and over until the button is pressed enough.

    I have a larger app having this issue, but I have reduced it down to a basic flutter app with a single FlipPanel to demonstrate the bug and hopefully this code will help others replicate it. Here is a gist of the main dart file: https://gist.github.com/cnsumner/fc96857beb33429629821fb7a3ff3fd0

    Just create a new flutter app and paste that code into the dart file (and add flip_panel: ^0.0.9 to your pubspec of course).

    Any help would be appreciated, I'm going crazy trying to fix this.

    opened by cnsumner 2
  • Please fix the padding issue in ReverseCountDown

    Please fix the padding issue in ReverseCountDown

    Hi Hung,

    Thanks for making this great package....Saved a lot of time for me.

    Please fix the reverseCountdown function. Padding in this function is by deafult set to 180.

    Please change the padding at line no 282

    padding: const EdgeInsets.only(top: 180.0)
    

    To

    padding: const EdgeInsets.only(top: 3.0)
    // Change 180 to anything you want.
    
    opened by kadarsh11 1
  • FlipClock.countdown not updating

    FlipClock.countdown not updating

    I am using FlipClock in my current Flutter project. I'm displaying a Countdown with

    FlipClock.countdown(
             duration: remainingTime,
             digitColor: loopWhite,
             backgroundColor: loopDarkBlue,
             digitSize: 25.0,
    );
    

    This is working well, but when i change the state of remainingTime the FlipClock does not update to the new Duration. Can you point me in some direction?

    Kind Regards

    opened by chwzr 1
  • Pause/Resume functionality!

    Pause/Resume functionality!

    Hello,

    I am very new to Flutter and found this great flip panel, first of all thanks for the hard work it seems to work excellent. However, I think an important functionality to start with a method, pause & resume seems to be missing, at least to me :)

    question 
    opened by gokhanbaydar 1
  • Fix minor dart analysis problem (take 2)

    Fix minor dart analysis problem (take 2)

    I realized my previous PR accidentally introduced another analysis error (FlipClock.countdown() constructor and also a field called "countdown" so I changed it to "countdownMode"). Apologies! This PR fixes that. I also fixed a few other minor analysis warnings while I was there and then ran dartfmt.

    opened by efortuna 1
  • Fix small analysis error

    Fix small analysis error

    I realized my previous PR accidentally introduced another analysis error (FlipClock.countdown() constructor and also a field called "countdown" so I changed it to "countdownMode"). Apologies! This PR fixes that. I also fixed a few other minor analysis warnings while I was there and then ran dartfmt.

    opened by efortuna 0
  • I would love to have a day counter

    I would love to have a day counter

    Such as - start with date x. From that date:

    "Today i have 00 years, 10 months, 05 days, 03 hours" with the counter above the title (like the reverse countdown) - no ":"

    Can i do that with this plugin, or can you help include that? Thank you!

    opened by jackieoh1 0
  • More realistic look and smoother animations

    More realistic look and smoother animations

    1. Added gradient colors for panel to create more realistic look of surfaces (white background).
    2. Added additional shadows for panels during the animation (inner shadow for upper panel, and external shadow for lower).
    3. Changed animation curves to: Curves.easeIn for 1st part of animaion, Curves.bounceIn for the 2nd.

    With all these changes FlipClock.simple currently looks like this: example

    Work to be done:

    1. Haven't tested with another types except FlipClock.simple. Maybe some additional edits may be required.
    2. Dynamic setting for backgroundColor is broken, since this value is getting replaced by the gradient I've added.
    opened by emvaized 5
Owner
HungHD
Full-stack mobile developer (Android, iOS, Flutter).
HungHD
Flutter 3D Flip Animation Widget

flutter_flip_view This is a flutter Widget base on pure Dart code that provides 3D flip card visuals. Usage add package in your pubspec.yaml dependenc

WosLovesLife 57 Dec 30, 2022
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

Flutter开源社区 123 Sep 3, 2022
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

Flutter开源社区 123 Sep 3, 2022
Nubank card animation - Nubank card animation built with flutter

Nubank card animation Project | Technologies | How to run | How to contribute ??

Lucas da Silva Barbosa 8 Nov 6, 2022
A Flutter library that makes animation easer. It allows for separation of animation setup from the User Interface.

animator This library is an animation library for Flutter that: makes animation as simple as the simplest widget in Flutter with the help of Animator

MELLATI Fatah 225 Dec 22, 2022
A simple animated circular menu for Flutter, Adjustable radius, colors, alignment, animation curve and animation duration.

A simple animated circular menu for Flutter, Adjustable radius, colors, alignment, animation curve and animation duration. pub package Getting Started

Hasan Mohammed 91 Dec 20, 2022
Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's heart when you like something and animation effects to increase like count.

like_button Language: English | 中文简体 Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's h

FlutterCandies 357 Dec 27, 2022
BKash-Ballance-Animation - BKash Ballance Animation For Flutter

BKash-Ballance-Animation before clone the GitHub repository please give a star o

Blackshadow Software Ltd 11 Sep 1, 2022
Fisherman-Fishing-Animation - Fisherman Fishing Animation With Flutter

Fisherman Fishing Animation before clone the GitHub repository please give a sta

Blackshadow Software Ltd 9 Oct 27, 2022
Fade animation - Add fade animation to your app easily

fade_animation Add fade animation to your app easily using simple_animations pac

Mazouzi Aymene 3 Oct 6, 2022
Flutter liquid swipe - Liquid Swipe Animation Built With Flutter

Flutter Liquid Swipe liquid Swipe animation is amazing and its Created for iOS P

Jahongir Anvarov 6 Dec 1, 2022
Animation package for Flutter, inspired by Animate.css

animator Enables you to create stunning flutter animations, faster, efficient and with less code. Null safety: For null safety please use flutter_anim

Sjoerd van Den Berg 136 Dec 6, 2022
A light weight package for flutter apps, that easily shows a splash screen with a nice fade animation.

Animated Splash Screen Using the package Get the library environment: sdk: ">=2.1.0 <3.0.0" Add dependency in pubspec.yaml dependencies: animated_

Mohammad Fayaz 112 Oct 6, 2022
Flutter package for Skeleton Text Animation

skeleton_text A package provides an easy way to add skeleton text loading animation in Flutter project Dependency dependencies: skeleton_text: How

101Loop 35 Aug 15, 2022
A Flutter package to custom splash screen like change logo icon, logo animation, and splash screen background color.

Custom Splash Screen A Flutter package to custom splash screen: change logo icon, logo animation, and splash screen background color. (Custom from ani

tranhuycong 78 Sep 6, 2022
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

null 6 Sep 12, 2022
Bubbleslider - A flutter package support a slider customize UI with bubble animation

bubble_slider This package support a slider customize UI with bubble animation.

MindInventory 11 Jul 26, 2022
A powerful Flutter package for building complex animation step by step.

A powerful Flutter package for building complex animation step by step.

血心 12 Jun 25, 2021
A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).

drawing_animation From static SVG assets See more examples in the showcasing app. Dynamically created from Path objects which are animated over time m

null 442 Dec 27, 2022