분류, 패키지 및 저장소 검색

패키지 상세v0.0.3

phased

애니메이션에 중점을 둔 간단한 상태 관리

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
991
좋아요
6
Pub 점수
150

패키지 설치

flutter pub add phased

패키지 개요

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

Phased는 애니메이션에 초점을 맞춰 상태 관리를 단순화하는 Flutter 패키지입니다. 개발자가 선언적이고 직관적인 방식으로 상태 전환을 관리할 수 있게 하며, 특히 애니메이션 변화에 크게 의존하는 UI에 적합합니다. 상태 업데이트를 단계로 조직함으로써 위젯 간에 부드럽고 조율된 애니메이션을 보장합니다. 이 패키지는 Flutter의 애니메이션 시스템과 원활하게 통합되며, 복잡한 상태 기반 애니메이션을 위한 깔끔하고 가독성 높은 코드를 촉진합니다.

사용 사례

  • UI 상태 전환 애니메이션
  • 다단계 사용자 흐름 관리
  • 인터랙티브 온보딩 화면 만들기
  • 동적 업데이트를 사용하여 반응형 대시보드 구축
  • 여러 위젯 간에 애니메이션 동기화

주요 기능

  • 단계 기반 상태 관리
  • 내장 애니메이션 조정
  • 상태 변경을 위한 선언적 구문
  • 경량이며 최소한의 뼈대
  • Flutter 애니메이션 프레임워크와의 원활한 통합

적합한 대상

  • 애니메이션 품질을 우선시하는 개발자
  • 복잡한 상태 기반 애니메이션을 가진 프로젝트
  • 간단한 상태 관리를 원하는 팀
  • UI 중심 애플리케이션, 예를 들어 온보딩 또는 대시보드
  • Flutter 초보자가 애니메이션 패턴을 배우고 있습니다

고려 사항

  • 애니메이션 중심 앱에 가장 적합
  • 상태 처리를 위한 새로운 패러다임을 배워야 할 수 있습니다
  • 대규모 데이터 중심 애플리케이션에 적합하지 않음
  • 기본 예제 외에 문서가 제한적
  • Flutter의 애니메이션 개념에 대한 이해가 필요합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Phased

style: very good analysis License: MIT

Simplified state management focused on animations

Installation 💻

❗ In order to start using Phased you must have the Flutter SDK installed on your machine.

Add phased to your pubspec.yaml:

dependencies:
  phased:

Install it:

flutter packages get

Description

Phased is a simple state management meant to be used to build animations, its objective is to provide an easy, boilerplateless way to create and manage the state of an animation, so developers can focus on building the animations themselves.

The package consists of two classes: PhasedState, which describes the state and offers control methods for an animation, and Phased, an abstract Widget that will build the animation itself.

Example

To build a simple animation that blinks a child using opacity, the following code can be used:

class BlinkState extends PhasedState<bool> {
  BlinkState() : super(values: [true, false]);
}

class Blink extends Phased<bool> {
  const Blink({
    super.key,
    required super.state,
    required this.child,
  });

  final Widget child;

  @override
  Widget build(BuildContext context) {
    return AnimatedOpacity(
      opacity: state.phaseValue(
        values: const {true: 1},
        defaultValue: 0,
      ),
      onEnd: state.next,
      duration: const Duration(milliseconds: 250),
      child: child,
    );
  }
}

Then to use it:

Blink(
  state: BlinkState(),
  child: Container(
    width: 100,
    height: 100,
    color: Colors.blue,
  ),
);

For more complex examples, check the example folder.


카테고리

소스 저장소

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