Skip to content

Conversation

wosika
Copy link

@wosika wosika commented Aug 1, 2025

Summary

  • Added animate parameter to control animation playback for animated images (like GIFs)
  • When animate is set to false, only the first frame is displayed

Implementation details

  • Added animate boolean parameter to all ExtendedImage constructors (default: true)
  • Modified _handleImageFrame method to ignore subsequent frames when animate is false
  • This allows developers to display animated images as static images when needed
 void _handleImageFrame(ImageInfo imageInfo, bool synchronousCall) {
  // If animation is disabled and we already have the first frame, ignore subsequent frames
  if (!widget.animate && _frameNumber != null && _frameNumber! >= 0) {
    return;
  }
  ...
}

Usage

  ExtendedImage.network(
    'your_gif_url.gif',
    animate: false,  // Freezes the GIF at first frame
  )

@wosika wosika requested a review from zmtzawqlp as a code owner August 1, 2025 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant