GifView class

Inheritance

Constructors

GifView({Key? key, required ImageProvider<Object> image, GifController? controller, int? frameRate, double? height, double? width, WidgetBuilder? progressBuilder, BoxFit? fit, Color? color, BlendMode? colorBlendMode, AlignmentGeometry alignment = Alignment.center, ImageRepeat imageRepeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool invertColors = false, FilterQuality filterQuality = FilterQuality.low, bool isAntiAlias = false, bool withOpacityAnimation = true, Widget errorBuilder(BuildContext context, Object error, VoidCallback tryAgain)?, Duration? fadeDuration, void onStart()?, void onFinish()?, void onFrame(int frame)?, void onLoaded(int totalFrames)?, bool autoPlay = true, bool loop = true, bool playInverted = false})
const
GifView.asset(String asset, {Key? key, GifController? controller, int? frameRate, double? height, double? width, WidgetBuilder? progressBuilder, BoxFit? fit, Color? color, BlendMode? colorBlendMode, AlignmentGeometry alignment = Alignment.center, ImageRepeat imageRepeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool invertColors = false, FilterQuality filterQuality = FilterQuality.low, bool isAntiAlias = false, bool withOpacityAnimation = true, Widget errorBuilder(BuildContext context, Object error, VoidCallback tryAgain)?, Duration? fadeDuration, String? package, AssetBundle? bundle, void onStart()?, void onFinish()?, void onFrame(int frame)?, void onLoaded(int totalFrames)?, bool autoPlay = true, bool loop = true, bool playInverted = false})
GifView.memory(Uint8List bytes, {Key? key, GifController? controller, int? frameRate, double? height, double? width, WidgetBuilder? progressBuilder, BoxFit? fit, Color? color, BlendMode? colorBlendMode, AlignmentGeometry alignment = Alignment.center, ImageRepeat imageRepeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool invertColors = false, FilterQuality filterQuality = FilterQuality.low, bool isAntiAlias = false, bool withOpacityAnimation = true, Widget errorBuilder(BuildContext context, Object error, VoidCallback tryAgain)?, Duration? fadeDuration, double scale = 1.0, void onStart()?, void onFinish()?, void onFrame(int frame)?, void onLoaded(int totalFrames)?, bool autoPlay = true, bool loop = true, bool playInverted = false})
GifView.network(String url, {Key? key, GifController? controller, int? frameRate, double? height, double? width, WidgetBuilder? progressBuilder, BoxFit? fit, Color? color, BlendMode? colorBlendMode, AlignmentGeometry alignment = Alignment.center, ImageRepeat imageRepeat = ImageRepeat.noRepeat, Rect? centerSlice, bool matchTextDirection = false, bool invertColors = false, FilterQuality filterQuality = FilterQuality.low, bool isAntiAlias = false, bool withOpacityAnimation = true, Widget errorBuilder(BuildContext context, Object error, VoidCallback tryAgain)?, Duration? fadeDuration, double scale = 1.0, Map<String, String>? headers, void onStart()?, void onFinish()?, void onFrame(int frame)?, void onLoaded(int totalFrames)?, bool autoPlay = true, bool loop = true, bool playInverted = false})

Properties

alignment AlignmentGeometry
final
autoPlay bool
Controls whether the GIF animation should auto-start. Defaults to true.
final
centerSlice Rect?
final
color Color?
final
colorBlendMode BlendMode?
final
controller GifController?
Optional controller to manage GIF playback externally.
final
errorBuilder Widget Function(BuildContext context, Object error, VoidCallback tryAgain)?
final
fadeDuration Duration?
final
filterQuality FilterQuality
final
fit BoxFit?
How to fit the image within its bounds. Uses Flutter's BoxFit enum. Defaults to BoxFit.contain.
final
frameRate int?
Duration between frames in the GIF animation. Defaults is the fps original file
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The height of the GIF view widget. If null, the widget will use its parent's height constraints.
final
image ImageProvider<Object>
final
imageRepeat ImageRepeat
final
invertColors bool
final
isAntiAlias bool
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loop bool
Determines if the GIF should loop continuously. When false, the animation will play once and stop. Defaults to true.
final
matchTextDirection bool
final
onFinish → void Function()?
Callback function that triggers when animation completes. Only called when loop is false.
final
onFrame → void Function(int frame)?
final
onLoaded → void Function(int totalFrames)?
final
onStart → void Function()?
final
playInverted bool
final
progressBuilder WidgetBuilder?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width double?
The width of the GIF view widget. If null, the widget will use its parent's width constraints.
final
withOpacityAnimation bool
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() GifViewState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

clearCache() Future<void>
preFetchImage(ImageProvider<Object> image) Future<void>
Pre-fetches GIF images and stores them in cache for faster loading.
setCacheProvider(GifCacheProvider? provider) → void
Sets a custom cache provider for GIF image storage.