パッケージ、リポジトリ、アプリカテゴリを検索

sprung のカバー
パッケージ詳細v3.0.1

sprung

Flutterアニメーション用のスプリングカーブ。3つの減衰曲線を備えた実際の物理方程式に基づく。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
4.8万
いいね数
288
Pub ポイント
160

パッケージをインストール

flutter pub add sprung

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Sprung は、滑らかで現実的なアニメーションに適した物理ベースのスプリングカーブを提供するFlutterパッケージです。現実世界の物理学からインスピレーションを得ており、自然な動きをシミュレートするための3つの減衰カーブを実装しています。ボタン、スライダー、トランジションなどのインタラクティブUI要素に最適で、リアルな応答性によりユーザー体験を向上させます。このパッケージはFlutterプロジェクトにスムーズに統合でき、モバイル、Web、デスクトップを含むすべての主要プラットフォームをサポートしています。複雑な手動計算なしにアニメーションダイナミクスを正確に制御したい開発者向けに設計されています。

用途

  • インタラクティブなボタンフィードバック
  • スムーズなスライドパネル
  • アニメーション付きUIトランジション
  • レスポンシブフォーム要素
  • 動的ウィジェットスケーリング
  • 自然なスクロール動作

主な機能

  • 物理ベースのスプリングカーブ
  • 3つのダンピングカーブオプション
  • 現実的なモーションシミュレーション
  • クロスプラットフォーム対応
  • TweenAnimationBuilder との簡単な統合
  • 最小限の構成が必要

適している対象

  • リアルさを求めるUIデザイナー
  • インタラクティブなアプリを開発する開発者
  • 自然なバウンスを必要とするアニメーション
  • 複数のプラットフォームをターゲットにするプロジェクト
  • パフォーマンスと滑らかさを重視するチーム

注意事項

  • 特定の用途に合わせて調整が必要になる場合があります
  • 繊細で応答性のあるアニメーションに最適
  • 非常に複雑またはカスタムの物理学には適していない
  • スプリングスタイルの補間に制限
  • 重いアニメーションチェーンにおけるパフォーマンスへの影響

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

ランキング