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

animated_size_and_fade 표지
패키지 상세v5.1.3

animated_size_and_fade

다른 높이를 가진 위젯 간에 페이드 및 크기 전환을 수행합니다. 또한 위젯의 표시/숨김에도 사용됩니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.7만
좋아요
245
Pub 점수
160

패키지 설치

flutter pub add animated_size_and_fade

패키지 개요

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

다른 높이를 가진 위젯 간의 전환을 페이드 및 크기 변경을 사용하여 부드럽게 애니메이션하는 플러터 패키지입니다. 섹션 확장/접기 또는 UI 요소 표시/숨기기와 같은 동적으로 콘텐츠를 보여주거나 숨길 때 이상적입니다. 애니메이션은 불투명도와 차원을 보간함으로써 시각적 연속성을 보장합니다. 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼을 지원합니다. 패키지는 가볍고 기존 플러터 앱에 쉽게 통합할 수 있습니다.

사용 사례

  • 접을 수 있는 콘텐츠 표시/숨기기
  • 동적 목록 항목 애니메이션
  • 부드러운 UI 전환 만들기
  • 숨겨진 패널 드러내기
  • 변경 가능한 높이의 위젯 교체 처리
  • 반응형 레이아웃에서 사용자 경험 개선

주요 기능

  • 부드러운 페이드 및 크기 전환
  • 변경 가능한 높이의 위젯을 지원합니다
  • 표시/숨기기 로직을 위한 간단한 API
  • 크로스 플랫폼 호환성
  • 경량이고 성능이 뛰어남
  • 내장 애니메이션 제어

적합한 대상

  • 유연한 UI 전환을 필요로 하는 개발자
  • 동적 콘텐츠 표시를 갖춘 앱
  • 인터랙티브 폼 또는 아코디언
  • 애니메이션을 필요로 하는 반응형 디자인
  • 정결하고 유지보수 가능한 코드를 우선시하는 팀

고려 사항

  • 매우 복잡한 애니메이션에는 적합하지 않을 수 있습니다
  • 성능은 위젯의 복잡도에 따라 달라집니다
  • 고주기 업데이트에 적합하지 않음
  • 레이아웃 제약 조건을 신중하게 처리해야 합니다
  • 기본 페이드/크기 외의 사용자 정의는 제한적
  • 예측 가능한 높이 변화와 함께 사용하는 것이 가장 좋습니다

원본 README

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

Pub popularity Pub Version GitHub stars Code Climate issues GitHub closed issues GitHub repo size GitHub forks PRs Welcome Developed by Marcelo Glasberg Glasberg.dev on pub.dev Platforms

Sponsor

animated_size_and_fade

The AnimatedSizeAndFade widget allows you to:

  1. Do a fade and size transition between two widgets.
  2. Show and hide a widget, by resizing it vertically while fading.
Size and Fade

To do a fade and size transition when you change the child widget, the "old" and the "new" child must have the same width, but can have different heights, and you don't need to know their sizes in advance.

You can also define a duration and curve for both the fade and the size, separately.

Important: If the "new" child is the same widget type as the "old" child, but with different parameters, then AnimatedSizeAndFade will NOT do a transition between them, since as far as the framework is concerned, they are the same widget, and the existing widget can be updated with the new parameters. To force the transition to occur, set a Key (typically a ValueKey taking any widget data that would change the visual appearance of the widget) on each child widget that you wish to be considered unique.

Example:

bool toggle=true;
Widget widget1 = ...;
Widget widget2 = ...;

AnimatedSizeAndFade(
   child: toggle ? widget1 : widget2
);
Show and Hide

The AnimatedSizeAndFade.showHide constructor may be used to show/hide a widget, by resizing it vertically while fading.

Example:

bool toggle=true;
Widget widget = ...;    

AnimatedSizeAndFade.showHide(
   show: toggle,
   child: widget,
);

How does it compare to other similar widgets?

  • With AnimatedCrossFade you must provide both the firstChild and secondChild at the same time, but with AnimatedSizeAndFade you may simply change its child.

  • With AnimatedSwitcher you may simply change its child, but then it only animates the fade, not the size.

  • AnimatedContainer only works if you know the size of the children in advance.


Note: See the StackOverflow question that prompted this widget development.


By Marcelo Glasberg

glasberg.dev
github.com/marcglasberg
linkedin.com/in/marcglasberg/
twitter.com/glasbergmarcelo
stackoverflow.com/users/3411681/marcg
medium.com/@marcglasberg

My article in the official Flutter documentation:

The Flutter packages I've authored:

My Medium Articles:

카테고리

소스 저장소

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