Gif image widget help to controll gif progress,speed,repeat frames

Overview

flutter_gif

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.

Screenshots

Usage(Simple)

add in pubspec

     flutter_gif: any // or the latest version on Pub

simple usage

    FlutterGifController controller= FlutterGifController(vsync: this);


    GifImage(
         controller: controller,
         image: AssetImage("images/animate.gif"),
    )

list the most common operate in FlutterGifController:

// loop from 0 frame to 29 frame
controller.repeat(min:0, max:29, period:const Duration(millseconds:300));

// jumpTo thrid frame(index from 0)
controller.value = 0;

// from current frame to 26 frame
controller.animateTo(26);

If you need to preCache gif,try this

// put imageProvider
fetchGif(AssetImage("images/animate.gif"));

Support the package (optional)

If you find this package useful, you can support it for free by giving it a thumbs up at the top of this page. Here's another option to support the package:

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.

You might also like...

Speed Share is a highly available file sharing terminal on LAN(local area network) developed by flutter framework.

Speed Share is a highly available file sharing terminal on LAN(local area network) developed by flutter framework.

速享 Language: 中文简体 | English 这是一款完全基于局域网的文件互传终端,速享不使用任何服务器,不使用您的移动流量,不收集任何用户数据,完全的点对点传输。 可以快速共享文本消息,图片或其他文件,文件夹。 适用于局域网中的文件互传,解决 QQ,微信等上传文件会经过服务器的问题,或者

Dec 31, 2022

Doctor booking app - Flutter Ui Challenge Speed Code

Doctor booking app - Flutter Ui Challenge Speed Code

Installation flutter pub get Usage flutter run Live Demo : Flutter Doctor Booking App Web Demo Try Android APK : Download From Google Drive Dotor Bo

Jan 3, 2023

A mobile game using Flutter to test your reaction speed in various ways

A mobile game using Flutter to test your reaction speed in various ways

FLX Test your Reflexes! A simple mobile game built with Flutter, Provider and BLoC pattern Key Features Three different play modes! Visual mode: tap w

May 11, 2021

Flutter plugin to implement a Material Design Speed Dial

Flutter plugin to implement a Material Design Speed Dial

Flutter Speed Dial Flutter package to render a Material Design Speed Dial. Usage The SpeedDial widget is built to be placed in the Scaffold.floatingAc

Jan 2, 2023

Flutter micro app - A package to speed up the creation of micro frontend(or independent features) structure in Flutter applications

Flutter micro app - A package to speed up the creation of micro frontend(or independent features) structure in Flutter applications

A package to speed up the creation of micro frontend(or independent features) st

Dec 22, 2022

Flutter package to render a Material Design Speed Dial.

Flutter package to render a Material Design Speed Dial.

Flutter Speed Dial Flutter package to render a Material Design Speed Dial. Usage The SpeedDial widget is built to be placed in the Scaffold.floatingAc

May 20, 2022

Dart library for decoding/encoding image formats, and image processing.

image Overview A Dart library providing the ability to load, save and manipulate images in a variety of different file formats. The library is written

Dec 27, 2022

Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Image Zoom and Cropping plugin for Flutter A simple and easy used flutter plugin to crop image on iOS and Android. Installation Add simple_image_crop

Dec 14, 2021
Comments
  • Upgrade analysis options and remove warnings

    Upgrade analysis options and remove warnings

    This adds analysis options and also removes several warnings that come along with flutter v3.

    Here's an example of a warning on current stable flutter:

    ../../_tool/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_gif-0.0.4/lib/flutter_gif.dart:235:42: Warning: Operand of null-aware operation '!' has type 'PaintingBinding' which excludes null.
     - 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart' ('../../_tool/flutter/packages/flutter/lib/src/painting/binding.dart').
      ui.Codec codec = await PaintingBinding.instance!
    
    
    opened by Nolence 0
  • refactor: add frame info duration loop that checks the number of image info to add

    refactor: add frame info duration loop that checks the number of image info to add

    I noticed that if the current frame contains the same image info, they are only considered as one frame which makes the actual gif unable to play the complete gif frame/duration.

    To make things clear, here's an example gif: rendered_preview_15

    The first( image with #1) frame's duration is 4 seconds but when played, it only shows 1 frame since they're all the same. Then the rest is fine since they're all playing at 1 sec, meaning 1 frame.

    So to fix that, I added a validator that loop and checks whether the actual duration/frame was added to the list of ImageInfos.

        for (int sec = 1; sec <= duration; sec++) {
          infos.add(ImageInfo(image: frameInfo.image));
        }
    

    Another thing, I replaced this deprecated method:

    ui.Codec codec = await PaintingBinding.instance.instantiateImageCodec(bytes);
    

    'instantiateImageCodec' is deprecated and shouldn't be used. Use instantiateImageCodecFromBuffer with an ImmutableBuffer instance instead. This feature was deprecated after v2.13.0-1.0.pre..

    by using the suggested:

      final buffer = await ImmutableBuffer.fromUint8List(bytes);
      ui.Codec codec =
          await PaintingBinding.instance.instantiateImageCodecFromBuffer(buffer);
    
    opened by fernan542 0
Releases(v0.0.4)
Owner
Samuel Annin Yeboah
Loves Music
Samuel Annin Yeboah
Wave progress - A custom wave progress widget

wave_progress_widget A customable wave progress widget Preview How to use Add this to your package's pubspec.yaml file: dependencies: wave_progress_

idan ben shimon 41 Jul 18, 2022
A simple modal progress HUD (heads-up display, or progress indicator) for flutter

modal_progress_hud A simple widget wrapper to enable modal progress HUD (a modal progress indicator, HUD = Heads Up Display) Inspired by this article.

Maurice McCabe 157 Nov 22, 2022
Flutter video compress - Generate a new file by compressed video, and provide metadata. Get video thumbnail from a video path, supports JPEG/GIF. To reduce app size not using FFmpeg in IOS.

flutter_video_compress Generate a new path by compressed video, Choose to keep the source video or delete it by a parameter. Get video thumbnail from

天海るり 179 Dec 8, 2022
IntervalProgressBar - An interval progress widget for Flutter

IntervalProgressBar An interval progress widget for Flutter. Preview v1 v2 Depend on it https://pub.dev/packages/intervalprogressbar Add this to your

Yang Ji 7 Aug 16, 2022
A flutter widget to indicate loading progress. Easy to use, easy to extend

?? ?? ?? A flutter widget to indicate loading progress. Easy to use, easy to extend

Manuel Duarte 2 May 30, 2022
A super effective dart library delivering performance & ensuring greater build speed.

A super effective Dart and Flutter library for delivering performante app ?? & ensuring greater build speed ?? . The package has some cook utilizes wh

Rexford Asamoah 2 Nov 22, 2021
Flutter Events App Ui Challenge Speed Code

Flutter Events app made with Flutter, Hosted on Codemagic. Don't forget to star ⭐ the repo it motivates me to share more open source Design Credits Uv

Sanskar Tiwari 402 Dec 29, 2022
Speed Coded on Youtube

Installation flutter pub get Usage flutter run Live Demo : Flutter Book App Web Demo Try Android APK : Download From Google Drive Book App UI made w

Sanskar Tiwari 276 Dec 2, 2022
Flutter Ui Challenge Speed Code

Live Demo : http://bit.ly/flutterecomapp Design Credits : https://gumroad.com/l/kamartaj Youtube Video : https://youtu.be/OQ-6Zo0vbAk Created & Mainta

Sanskar Tiwari 65 Aug 15, 2022