sprung 1.1.0+11

  • Readme
  • Changelog
  • Example
  • Installing
  • 88

sprung #

Sprung is an easy-to-consume Curve that uses real physics equations to drive your animations.

Easy to consume #

  curve: Sprung(),
  /// ...

Sprung() also supports three damping curves, Damped.under, Damped.critically, and Damped.over.

  curve: Sprung(
    damped: Damped.under
  /// ...

Note: Sprung is critically damped by default.

Based on Physics #

Using Newton's Second Law of Motion, Hooke's Law, and velocity based damping, we implement the following equation in three finite cases.

m times x dot dot equals negative k times parenthesis x minus 1 close parenthesis minus c times x dot

Believable motion #

demo of under, critically, and over damped Flutter curves

Reliable accuracy #

Sprung exceeds Flutter specifications for curves by guaranteeing an error less than 1e-6. This amounts to a 0.0019px jitter at the beginning or end of a 1920px move.

Prior Art #


1.1.0+11 #

  • Add test cases and streamline tests for Next.

1.1.0+10 #

  • Added preview API to next.dart.

1.0.0+9 #

  • Decrease test epsilon (error) to 1e-6.

1.0.0+8 #

  • Improved inline docs.

1.0.0+7 #

  • Added inline documentation.

1.0.0+6 #

  • Typo.

1.0.0+5 #

  • One more time with feeling!

1.0.0+4 #

  • Are you happy with my image links yet, pub?

1.0.0+3 #

  • Fix image links in README.md

1.0.0+2 #

  • Adjusted project layout to meet pub requirements. Added CHANGELOG.md and dedicated example folder.

1.0.0+1 #

  • Initial release. Tested and stable.


sprung_demo #

A demo project allowing the user to interact with Sprung widgets.

demo of under, critically, and over damped Flutter curves

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  sprung: ^1.1.0+11

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:sprung/sprung.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Maintenance suggestions

Package is getting outdated. (-9.86 points)

The package was last published 57 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
cupertino_icons ^0.1.2 0.1.3
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies