animated_stickers 1.0.0
animated_stickers: ^1.0.0 copied to clipboard
Plays animated stickers inline on Android and iOS: VP9/VP8 WebM with alpha, animated WebP and GIF, decoded natively and drawn into Flutter Textures.
1.0.0 - 2026-11-18 #
First release.
Stickerwidget: plays VP9/VP8 WebM with alpha, animated WebP and GIF through platformTextures on Android (API 24+) and iOS (15+). Decoding runs in a shared C++ core on native worker threads.- Sources:
StickerSource.asset,.file,.bytesand.network, the last through an app-providedStickerFetcher(Stickers.fetcher). - Playback:
autoplay,loop,StickerController(play,pause,seekToFrame),placeholderanderrorBuilder, which gets the error and its stack trace like Flutter'sImageErrorWidgetBuilder(null for a status the native core reported). Stickers advance only while on screen, under an enabledTickerModeand in the foreground, and widgets showing the same content at the same size share one animation. StickerAtlasScope: draws many stickers through a few shared atlas textures, presented at the content's frame rate.- Device tiers (
StickerTier:auto,high,mid,low) that follow the device class, Low Power Mode and thermal state, withStickerConfig.maxFpsandmaxConcurrentoverrides. - On-disk frame cache with an LRU budget (
StickerConfig.diskBudgetBytes, 200 MiB by default,cacheDirectory),Stickers.cacheStats()(StickerCacheStats) andclearCache(). EachStickers.configurecall applies the wholeStickerConfig. Stickers.probereads a sticker's metadata (StickerInfo) without decoding pixels.- Hard limits on untrusted input (2 MiB, 1024 px, 10 s, 600 frames);
violations surface as
StickerException.Stickers.probecan check a file against otherStickerLimits; playback always uses the defaults. StickerControlleris abaseclass.StickerInfo,StickerLimits,StickerConfig,StickerCacheStatsandStickerExceptionarefinal, so fields can be added in minor releases; the first four compare by value.StickerCodec,StickerFormatandStickerTiermay gain values in minor releases, so give aswitchover them a default case.- A short runnable example (
example/lib/main.dart) with three small stickers.