GitHub 代码仓flutterkit/tweener

tweener

Tweener 是一个简单轻量的 Flutter 动画工具

tweener 项目封面
星标
31
复刻
4
最近推送(UTC)
2024年4月9日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

Tweener

Tweener is a simple and lightweight flutter animation tool. Anyone can easily learn to use it.

Features

  • Does one thing and one thing only: tween properties
  • Very simple to use, but it can achieve a lot of effects
  • Easing functions are reusable outside of Tween

Installation

Install the Tweener https://pub.dev/packages/tweener:

You should ensure that you add the following dependency in your Flutter project.
dependencies:
  tweener: ^2.2.2
install packages from the command line:
flutter packages get

Useage

import class
import 'package:tweener/tweener.dart';
use Tweener
Tweener({"x": 0, "y": 0, "alpha": 0, "custom_prop_abc": 123})
    .to({"x": 100, "y": 500, "alpha": 1, "custom_prop_abc": 321}, 2000)
    .easing(Tweener.ease.elastic.easeOut)
    .onUpdate((obj) {
        setState(() {
            _x = obj["x"];
            _y = obj["y"];
            _alpha = obj["alpha"];
            _abc = obj["custom_prop_abc"];
        });
    })
    .onComplete((obj){
        /// 
    })
    .start();
var tween1 = new Tweener(sprite)
	.to({x: 700, y: 200, rotation: 359}, 2000)
	.delay(1000)
	.easing(Ease.back.easeOut)
	.onUpdate(update);

var tween2 = new Tweener(sprite)
	.to({x: 10, y: 20, rotation: 30}, 2000)
	.onUpdate(update);

tween1.chain(tween2);
tween1.start();

About AnimateCon

To operate widget animations more conveniently, you can utilize the AnimateCon library. This library provides extremely facile implementation methods for animations such as position, scale, and alpha, enabling you to easily create various vivid and interesting animation effects.

Thanks

Tweener refers to the implementation code of tween.js. They are really great. I want to pay tribute to the original author!

FlutterKit GitHub avatar
GitHub 作者

FlutterKit ↗

FlutterKit

语言Dart

分类

此仓库发布的插件

使用的依赖

依赖清单 2 项

  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗