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

image_fade 표지
패키지 상세v0.6.2

image_fade

이미지가 로드되는 동안 자리 표시자와 선택적 진행률 표시기를 표시한 후 로드된 이미지로 크로스페이드하는 위젯입니다. FadeInImage를 개선했습니다. CachedNetworkImageProvider와 호환됩니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
8천
좋아요
87
Pub 점수
150

패키지 설치

flutter pub add image_fade

패키지 개요

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

ImageFade는 이미지가 완전히 로드될 때까지 자리 표시자와 선택적 진행률 표시기를 표시함으로써 이미지 로딩 경험을 향상시키는 Flutter 위젯입니다. 이미지가 완전히 로드되면 부드럽게 크로스페이드하여 최종 이미지로 전환되며, 정교한 시각적 전환을 제공합니다. FadeInImage의 개선된 버전으로, CachedNetworkImageProvider를 지원하며 Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼에서 작동합니다. 이미지 로딩 중 시각적 피드백이 중요한 애플리케이션에 적합합니다.

사용 사례

  • 시각적 피드백과 함께 이미지 로딩
  • 이미지 렌더링 중 UI 전환 개선
  • 네트워크 이미지 로딩 중 플레이스홀더 표시
  • 이미지가 많은 앱에서 인식된 성능 향상
  • 캐시된 네트워크 이미지와 함께 사용
  • 부드러운 이미지 페이드 효과 만들기

주요 기능

  • 이미지 로드 시 크로스페이드 애니메이션
  • 플레이스홀더 위젯 지원
  • 선택적 진행률 표시기
  • CachedNetworkImageProvider와의 호환성
  • 다양한 플랫폼 간의 부드러운 전환
  • 경량이며 통합이 쉬움

적합한 대상

  • 자주 이미지를 로드하는 앱
  • 더 나은 이미지 로딩 사용자 경험을 원하는 개발자
  • CachedNetworkImage를 사용하는 프로젝트
  • UI 중심의 플러터 애플리케이션
  • 시각적 완성도를 우선시하는 팀

고려 사항

  • 진행률 표시기용 추가 설정 필요
  • 플레이스홀더에 맞춤 스타일이 필요할 수 있습니다
  • 정적 또는 비동적 이미지에 적합하지 않습니다
  • 외부 이미지 캐싱 솔루션에 의존합니다
  • 기본 페이드 동작 외의 사용자 정의가 제한적

원본 README

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

ImageFade

A widget for Flutter that displays a placeholder widget while a specified image loads, then cross-fades to the loaded image. Also handles progress and errors. It uses Image.opacity when appropriate for improved performance.

If image is changed, it will cross-fade to the new image once it is finished loading. Setting image to null will cross-fade back to the placeholder.

example image

You can set duration and curve, as well as most Image properties: width, height, fit, alignment, repeat, matchTextDirection, excludeFromSemantics and semanticLabel.

Use loadingBuilder and errorBuilder to display load progress or error states. Optionally specify syncDuration to use a different (usually faster) duration for fading in a synchronously loaded image, error, or placeholder.

ImageFade(
  // whenever the image changes, it will be loaded, and then faded in: 
  image: NetworkImage(url),

  // slow fade for newly loaded images:
  duration: const Duration(milliseconds: 900),

  // if the image is loaded synchronously (ex. from memory), fade in faster:
  syncDuration: const Duration(milliseconds: 150),

  // supports most properties of Image:
  alignment: Alignment.center,
  fit: BoxFit.cover,
  
  // shown behind everything:
  placeholder: Container(
    color: const Color(0xFFCFCDCA),
    alignment: Alignment.center,
    child: const Icon(Icons.photo, color: Colors.white30, size: 128.0),
  ),
  
  // shows progress while loading an image:
  loadingBuilder: (context, progress, chunkEvent) =>
    Center(child: CircularProgressIndicator(value: progress)),

  // displayed when an error occurs:
  errorBuilder: (context, error) => Container(
    color: const Color(0xFF6F6D6A),
    alignment: Alignment.center,
    child: const Icon(Icons.warning, color: Colors.black26, size: 128.0),
  ),
)

Image Caching

ImageFade is compatible with CachedNetworkImageProvider.

Installing

The published version of this package is availble on pub.dev.

Example

See the example directory for a simple example.

카테고리

소스 저장소

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