动画 | flutter package

立即下载 ️⬇️

简单动画是Flutter的一个软件包,它通过简化创建动画的方式来提高动画效率。

Simple Animations

Awesome Flutter Build status Pub

Simple Animations is a package for Flutter to boost your animation productivity by simplifying the way to create animations.

Project goal

Flutter拥有强大而灵活的动画功能基础。

但是,即使是小动画也会感觉爆炸你的代码库。 **动画是Flutter最需要的方面之一 很难掌握。

简单动画的目标是解决这个问题

  • 简化创建自定义动画的方式,
  • 轻松地将开发人员放入动画主题中,
  • 提供大量文档示例
  • Getting started

There are multiple ways to get started:

Examples

Typewriter Box

This custom animation seems simple but it’s rather complex:

hello-flutter-example

It’s combining a staggered animation sequence with an enduring animation:

  • At the beginning it animates the height of a box. After that it increases the width.
  • While increasing the width a typewriter-like animated underscore appears and persists.
  • Shortly before the width reaches it’s final size, it starts to type-write a text.

With traditional Flutter animation classes this will end in a huge StatefulWidget with multiple AnimationController, Tweens and all that initState and onDispose overhead.

With simple_animation you can do it stateless just by using some fancy ControlledAnimation widgets.

The whole animation just takes about 60 lines of code while maintaining readability. (You can find the source code here. I only counted the lines that are responsible for the animation.)

Pub Example Tab

This is the example from the example page (pub.dartlang.org):

pub-example-tab

Example App

You find these and other examples in Example App.

fancy-background

fade-in

Github主页 👉felixblaschke/simple_animations

0%