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

패키지 상세v2.3.0

gif

flutter 애니메이션 컨트롤러를 사용하여 GIF를 제어합니다. 고정된 지속 시간을 지정하거나 재생 프레임 속도를 설정할 수 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
4.1만
좋아요
80
Pub 점수
150

패키지 설치

flutter pub add gif

패키지 개요

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

gif 패키지는 AnimationController를 사용하여 Flutter에서 GIF 애니메이션을 정밀하게 제어할 수 있게 해줍니다. 고정된 지속시간 재생과 사용자 정의 프레임 속도를 지원하며, 개발자가 GIF를 애니메이션 또는 사용자 상호작용과 동기화할 수 있도록 합니다. 이 패키지는 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼에서 호환되며, 애니메이션 콘텐츠가 필요한 동적 UI 요소에 적합합니다. 네이티브 플랫폼 코드 없이도 Flutter 앱에 GIF를 쉽게 통합할 수 있습니다.

사용 사례

  • 애니메이션 타임라인과 GIF를 동기화하는 방법
  • 상호작용 가능한 애니메이션 UI 컴포넌트 만들기
  • 애니메이션 배너 또는 로딩 표시기 표시
  • 크로스 플랫폼 애플리케이션에 GIF 통합
  • 재생 속도를 동적으로 제어하기

주요 기능

  • AnimationController 통합
  • 고정 지속 시간 또는 프레임 레이트 지원
  • 크로스 플랫폼 호환성
  • 재생 제어를 위한 간단한 API
  • 모든 플랫폼에서의 효율적인 렌더링

적합한 대상

  • 애니메이션 UI를 구축하는 개발자
  • 동적 GIF 재생을 필요로 하는 앱
  • 다중미디어 요구 사항을 가진 크로스플랫폼 프로젝트
  • 시각적 피드백이 있는 인터랙티브 앱 컴포넌트

고려 사항

  • 큰 GIF와 함께 성능에 영향을 줄 수 있습니다
  • 장시간 실행되는 애니메이션을 위해 신중한 메모리 관리가 필요합니다
  • 정적 GIF에만 제한됨(복잡한 전환 효과가 있는 애니메이션 GIF는 지원하지 않음)
  • 경량 애니메이션에 가장 적합
  • 고프레임 레이트 또는 비디오 유사 콘텐츠에 최적화되지 않음

원본 README

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

gif

Overview

We should know that in order to achieve Gif in flutter, we can use Image, but we have no way to manipulate Gif, for example: change its speed, control it has been playing in a frame, in which frame range loop. These problems can be solved by this widget, it also help you contain gif cache, avoid load frame every time.

Example

Load a gif asynchronously and display a text placeholder during loading.
When the gif is loaded reset the controller and run the gif to the end.

GifController _controller = GifController(vsync: this);

Gif(
    image: AssetImage("images/animate.gif"),
    controller: _controller, // if duration and fps is null, original gif fps will be used.
    //fps: 30,               
    //duration: const Duration(seconds: 3),
    autostart: Autostart.no,
    placeholder: (context) => const Text('Loading...'),
    onFetchCompleted: () {
         _controller.reset();
         _controller.forward();
    },
),

Thanks

License

MIT License

Copyright (c) 2019 Jpeng

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

카테고리

의존성

의존성 목록 1 개

소스 저장소

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

아직 데이터가 없습니다.