Skip to content

Commit

Permalink
Add sample usage to cache documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
zathras committed Jul 18, 2024
1 parent 73c2b35 commit 9d86ae8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/src/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<HomePage> {
/// 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 {
Expand Down

0 comments on commit 9d86ae8

Please sign in to comment.