From cb5918f626b821d68e3d60a1511a06fd65e3854f Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Thu, 16 Jan 2020 17:18:02 -0800 Subject: [PATCH] Doc fixes in Image related docs (#48994) --- packages/flutter/lib/src/painting/image_cache.dart | 12 ++++++------ packages/flutter/lib/src/painting/image_stream.dart | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/flutter/lib/src/painting/image_cache.dart b/packages/flutter/lib/src/painting/image_cache.dart index 75e8d05184..7a296ae4a2 100644 --- a/packages/flutter/lib/src/painting/image_cache.dart +++ b/packages/flutter/lib/src/painting/image_cache.dart @@ -32,7 +32,7 @@ const int _kDefaultSizeBytes = 100 << 20; // 100 MiB /// {@tool snippet} /// /// This sample shows how to supply your own caching logic and replace the -/// global [imageCache] varible. +/// global [imageCache] variable. /// /// ```dart /// /// This is the custom implementation of [ImageCache] where we can override @@ -64,7 +64,6 @@ const int _kDefaultSizeBytes = 100 << 20; // 100 MiB /// } /// ``` /// {@end-tool} - class ImageCache { final Map _pendingImages = {}; final Map _cache = {}; @@ -141,12 +140,13 @@ class ImageCache { } /// Evicts a single entry from the cache, returning true if successful. - /// Pending images waiting for completion are removed as well, returning true if successful. + /// Pending images waiting for completion are removed as well, returning true + /// if successful. /// - /// When a pending image is removed the listener on it is removed as well to prevent - /// it from adding itself to the cache if it eventually completes. + /// When a pending image is removed the listener on it is removed as well to + /// prevent it from adding itself to the cache if it eventually completes. /// - /// The [key] must be equal to an object used to cache an image in + /// The `key` must be equal to an object used to cache an image in /// [ImageCache.putIfAbsent]. /// /// If the key is not immediately available, as is common, consider using diff --git a/packages/flutter/lib/src/painting/image_stream.dart b/packages/flutter/lib/src/painting/image_stream.dart index 79d257dd0e..9fefe9665b 100644 --- a/packages/flutter/lib/src/painting/image_stream.dart +++ b/packages/flutter/lib/src/painting/image_stream.dart @@ -15,7 +15,7 @@ import 'package:flutter/scheduler.dart'; /// actual data of the image once it has been obtained. @immutable class ImageInfo { - /// Creates an [ImageInfo] object for the given image and scale. + /// Creates an [ImageInfo] object for the given [image] and [scale]. /// /// Both the image and the scale must not be null. const ImageInfo({ @required this.image, this.scale = 1.0 }) @@ -35,9 +35,9 @@ class ImageInfo { /// /// For example, if this is 2.0 it means that there are four image pixels for /// every one logical pixel, and the image's actual width and height (as given - /// by the [dart:ui.Image.width] and [dart:ui.Image.height] properties) are double the - /// height and width that should be used when painting the image (e.g. in the - /// arguments given to [Canvas.drawImage]). + /// by the [dart:ui.Image.width] and [dart:ui.Image.height] properties) are + /// double the height and width that should be used when painting the image + /// (e.g. in the arguments given to [Canvas.drawImage]). final double scale; @override @@ -58,11 +58,11 @@ class ImageInfo { /// Interface for receiving notifications about the loading of an image. /// -/// This class overrides `operator ==` and `hashCode` to compare the individual +/// This class overrides [operator ==] and [hashCode] to compare the individual /// callbacks in the listener, meaning that if you add an instance of this class /// as a listener (e.g. via [ImageStream.addListener]), you can instantiate a /// _different_ instance of this class when you remove the listener, and the -/// listener will be properly removed as long all associated callbacks are +/// listener will be properly removed as long as all associated callbacks are /// equal. /// /// Used by [ImageStream] and [ImageStreamCompleter].