패키지, 저장소 및 앱 카테고리 검색

sprung 표지
패키지 상세v3.0.1

sprung

Flutter 애니메이션을 위한 스프링 곡선. 세 가지 감쇠 곡선을 갖춘 실제 물리 방정식 기반.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
4.8만
좋아요
288
Pub 점수
160

패키지 설치

flutter pub add sprung

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Sprung은 부드럽고 현실적인 애니메이션을 위한 물리 기반 스프링 커브를 제공하는 Flutter 패키지입니다. 실제 세계의 물리학에서 영감을 받아 자연스러운 움직임을 시뮬레이션하기 위해 세 가지 감쇠 곡선을 구현했습니다. 버튼, 슬라이더 및 전환과 같은 인터랙티브 UI 요소에 이상적이며, 생생한 반응성으로 사용자 경험을 향상시킵니다. 이 패키지는 Flutter 프로젝트에 원활하게 통합되며 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼을 지원합니다. 복잡한 수동 계산 없이 애니메이션 다이나믹스를 정밀하게 제어하고자 하는 개발자를 위해 설계되었습니다.

사용 사례

  • 인터랙티브 버튼 피드백
  • 부드러운 슬라이딩 패널
  • 애니메이션 UI 전환
  • 반응형 폼 요소
  • 동적 위젯 스케일링
  • 자연스러운 스크롤 동작

주요 기능

  • 물리 기반 스프링 곡선
  • 세 가지 감쇠 곡선 옵션
  • 현실적인 운동 시뮬레이션
  • 크로스 플랫폼 지원
  • 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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

순위