Coder Social home page Coder Social logo

animate_transisi's Introduction

animate_do

Null-Safety checked!

An animation package inspired in Animate.css, built using only Flutter animations, no extra packages.

Getting Started

This package is simple to use. Every single animation contains default values that look beautiful, but you can change properties to accomplish your needs.

Properties in almost every animated widget:

Property Type Description
key Key (optional) Widget key
child Widget Child Widget to animate
duration Duration Animation duration
delay Duration Delay before the animation
from double Initial or final destination, if you want a slide or fade more striking
animate boolean Change this property from false to true to starts the animation (useful if you use setState, Bloc, Provider, Redux or any other state management system)
infinite boolean Attention seekers can be run infinitely with this property
spins double The number of spins that you want (some animations have this, ex: Spin, Roulette, PerfectSpin )
manualTrigger boolean if you're going to trigger the animation manually (required the controller property)
controller Function Function that exposes the controller (for more control of the animation

Available Animations

FadeIn Animations

  • FadeIn
  • FadeInDown
  • FadeInDownBig
  • FadeInUp
  • FadeInUpBig
  • FadeInLeft
  • FadeInLeftBig
  • FadeInRight
  • FadeInRightBig

FadeOut Animations

  • FadeOut
  • FadeOutDown
  • FadeOutDownBig
  • FadeOutUp
  • FadeOutUpBig
  • FadeOutLeft
  • FadeOutLeftBig
  • FadeOutRight
  • FadeOutRightBig

BounceIn Animations

  • BounceInDown
  • BounceInUp
  • BounceInLeft
  • BounceInRight

ElasticIn Animations

  • ElasticIn
  • ElasticInDown
  • ElasticInUp
  • ElasticInLeft
  • ElasticInRight

SlideIns Animations

  • SlideInDown
  • SlideInUp
  • SlideInLeft
  • SlideInRight

FlipIn Animations

  • FlipInX
  • FlipInY

Zooms

  • ZoomIn
  • ZoomOut

SpecialIn Animations

  • JelloIn

Attention Seeker

All of the following animations could be infinite with a property called infinite (type Bool)

  • Bounce
  • Flash
  • Pulse
  • Swing
  • Spin
  • SpinPerfect
  • Dance
  • Roulette

Example

home: Scaffold(
    body: Center(

        child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: <Widget>[

            FadeInLeft(child: Square() ),
            FadeInUp(child: Square() ),
            FadeInDown(child: Square() ),
            FadeInRight(child: Square() ),
            
        ],
        ),

    ),
),

Note: Square, is just a Square blue container

class Square extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 50,
      height: 50,
      decoration: BoxDecoration(
        color: Colors.blueAccent,
      ),
    );
  }
}

Animate_do demo animation

Manual Trigger

Since version 1.2.0, there is a way to get the AnimationController easily, so you can restart it, change the duration, do the animation again.

Example

  class FadeOutDownBig extends StatelessWidget/StatefulWidget {
  
  AnimationController animateController;
  ...
  ...
  ...

  child: FadeInUp(
    
    // (optional) if true, will not fire the animation on load
    manualTrigger: true, 

    //(optional, but mandatory if you use manualTrigger:true) This callback exposes the AnimationController used for the selected animation. Then you can call animationController.forward() to trigger the animation wherever you like manually.
    controller: ( controller ) => animateController = controller,

    child: YourWidget(),

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

animate_transisi's People

Contributors

klerith avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.