From 9d86ae8d06b3844de500c687335f694040bd9899 Mon Sep 17 00:00:00 2001 From: Bill Foote Date: Thu, 18 Jul 2024 07:11:37 -0700 Subject: [PATCH] Add sample usage to cache documentation. --- lib/src/widget.dart | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/src/widget.dart b/lib/src/widget.dart index f045219..b545d0e 100644 --- a/lib/src/widget.dart +++ b/lib/src/widget.dart @@ -1154,6 +1154,25 @@ class _CacheEntry { /// private members. See also the `demo_hive` application to see how /// [ScalableImageSource] can be extended to load from a persistent cache. /// +/// Sample usage (see `example/lib/cache.dart` for the full program): +/// +/// ``` +/// class _HomePageState extends State { +/// ScalableImageCache _svgCache = ScalableImageCache(size: 70); +/// ... +/// @override +/// Widget build(BuildContext context) { +/// return ... +/// ScalableImageWidget.fromSISource( +/// cache: _svgCache, +/// scale: 1000, +/// si: ScalableImageSource.fromSvgHttpUrl(widget.svgs[index]), +/// ...), +/// ...; +/// } +/// } +/// ``` +/// /// {@category Widget} /// class ScalableImageCache {