Li-00 / flutter_curve

Easy customize animation curve.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flutter_curve

Flutter Curve library is inspired by Dynamic.js

This library lets you easy to customize your own curve animation.

Use them like you use Curve, because flutter_curve is a subclass of Curve.

Like this:

late final animation = CurvedAnimation(
  parent: _controller,
  curve: CubicCurve.easeIn(frition: 30),
);
final scrollController = ScrollController();

scrollController.animateTo(0, duration: const Duration(milliseconds: 500),
curve: CubicCurve.easeIn(frition: 30));

Example

Usage

1. add dependencies into you project pubspec.yaml file

dependencies:
  flutter_curve: ^0.0.1

Run flutter packages get in the root directory of your app.

2. import flutter_curve lib

import 'package:flutter_curve/flutter_curve.dart';

3. use flutter_curve

late final _controller = AnimationController(
  vsync: this,
  duration: widget.duration,
);

late final animation = CurvedAnimation(
  parent: _controller,
  curve: CubicCurve.easeIn(frition: 30),
);

Support Curve

  • SpringCurve
  • CubicCurve.easeIn
  • CubicCurve.easeOut
  • CubicCurve.easeInOut
  • BounceCurve
  • GravityCurve
  • ForceWithGravityCurve

About

Easy customize animation curve.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Dart 41.9%Language:C++ 28.5%Language:CMake 23.2%Language:HTML 2.3%Language:Swift 2.1%Language:C 1.8%Language:Kotlin 0.2%Language:Objective-C 0.0%