• Stars
    star
    140
  • Rank 261,473 (Top 6 %)
  • Language
    Dart
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Drive realistic animations in Flutter with real physics

sprung

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

Easy to consume

Sprung has three opinionated curves, Sprung.underDamped, Sprung.criticallyDamped, and Sprung.overDamped. This is the best way to get started.

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

When you want more fine control, use the default constructor which is critically damped, with overridable damping value.

AnimatedContainer(
  /// Critically damped by default with a value of `20`
  curve: Sprung(),
  /// ...
),
AnimatedContainer(
  /// Easily adjust damping value.
  curve: Sprung(19),
  /// ...
),

To build a fully custom spring simulation, use Sprung.custom. This allows you to define the spring's damping and stiffness, as well as the mass' mass and initial velocity.

AnimatedContainer(
  /// Build a custom spring
  curve: Sprung.custom(
    damping: 20,
    stiffness: 180,
    mass: 1.0,
    velocity: 0.0,
  ),
  /// ...
),

Based on Physics

Using Flutter's physics engine which leverages Newton's Second Law of Motion, Hooke's Law, and velocity based damping, we implement the following equation to create realistic spring animations.

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.

More Repositories

1

salomon_bottom_bar

Yet another bottom navigation bar, but with a few key promises.
Dart
241
star
2

flutter-developers

A showcase app for Flutter Developers
Dart
128
star
3

flutter_hotspot

Dart
105
star
4

flutter_liquid_swipe

Dart
72
star
5

flutter_compass_view

Dart
52
star
6

flutter_swiftui

A research package intended to implement SwiftUI style transformations on Flutter Widgets using extensions
Dart
40
star
7

apollo-server-firebase

An example showing how to use Apollo Server with Firebase Cloud Functions
JavaScript
39
star
8

flutter_ribs

A Dart/Flutter port of uber/ribs, should be ready for tinkering
Dart
31
star
9

mastodon_dart

Unofficial 🐘 client written in 🎯
Dart
28
star
10

flutter_fb_arch

https://www.youtube.com/watch?v=ZbFOqL1fHNo
Dart
26
star
11

nps_flutter

Using surveys to create the best Flutter stack
26
star
12

binance_dart

A Dart wrapper for the Binance API.
Dart
19
star
13

book_reader

A Flutter implementation of the fabulous book_reader UI design by Noam Liss
Dart
14
star
14

aqueduct_cloud_run

Dart
11
star
15

pocketbase_flutter_app

Dart
11
star
16

mastodon_flutter

Mastodon framework for Flutter
Dart
10
star
17

weather_app

Weather App written on livestream
Dart
9
star
18

flutter_analytics_context

Dart
8
star
19

secret_null_safe_santa

Inspired by this Twitter thread:
Dart
8
star
20

vscode_fast_build_runner

TypeScript
7
star
21

obs_keylogger

A keylogger that pipes events to OBS
Python
7
star
22

wordle_calculator

Dart
6
star
23

edsm

ELO ranking Flutter state management packages
Dart
6
star
24

durl

A curl-like client for the Discord API
Dart
5
star
25

flutter_loading_notification

Inspired by this Twitter post
Dart
4
star
26

trs

trs
Dart
4
star
27

plt

A multiplayer platformer written in Dart
Dart
4
star
28

framework-benchmarks

PHP
4
star
29

nvim

My Neovim config
Vim Script
3
star
30

gde_frog

Dart
3
star
31

flutter_redux_arch

Dart
2
star
32

pid

Control a woodstove using Dart and MQTT
Dart
2
star
33

signals_test

Dart
2
star
34

ts-redux-dart

A TypeScript translation of the famously svelte `redux-dart`
TypeScript
2
star
35

multirex

Dart
2
star
36

htmx_app

Dart
2
star
37

pighetti.design

My personal website. Thanks to Jen Simmons for inspiration.
TypeScript
1
star
38

jest-debug-typescript

TypeScript
1
star
39

youtube

A collection of repositories from my YouTube channel
Dart
1
star
40

node-docker

A simple and robust starting point for Node 10 containers
JavaScript
1
star
41

Squash-and-Yeet

Safari Extension that adds a Squash and Yeet button to GitHub
Swift
1
star
42

rust_faas_challenge

Rust
1
star
43

fastapi

Python
1
star
44

twitch-chat

JavaScript
1
star
45

hn_server_dart

Hacker News backend, mobile app (eventually), PWA (eventually)
Dart
1
star
46

Flutter-Community-Challenges

A Flutter application to manage community driven Flutter development challenges
Dart
1
star
47

helix_dart_example

An example showing poor Treesitter performance in a Dart project
Dart
1
star
48

flutter_ibbq

Dart
1
star
49

lukepighetti.github.io

HTML
1
star
50

mountain

Dart
1
star
51

spike_melos_task

Dart
1
star
52

spatialite_flutter

Dart
1
star
53

hypefour

Dart
1
star
54

macro_spike

Dart
1
star