flutter_gif_plus 0.0.5

SDKflutter
Platformandroidioswindowslinuxmacos

GIF widget that helps to control progress, speed, repeat and frames.

flutter_gif_plus

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

  • add in pubspec
flutter pub add flutter_gif_plus
  • simple usage
FlutterGifController controller= FlutterGifController(vsync: this);
const GifImage image = 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 third frame (index from 0)
controller.value = 0;

// from current frame to 26 frame
controller.animateTo(26);
  • if you need to preCache gif, try this
fetchGif(AssetImage('images/animate.gif'));

Thanks