From 7ee7fff2100ff68d93ea5ba06deb6945eed9b963 Mon Sep 17 00:00:00 2001 From: Nate Wilson Date: Tue, 29 Oct 2024 18:46:11 -0600 Subject: [PATCH] Fix `ResizeImage` documentation (#157619) Whoever reviewed the documentation changes in #154212 neglected to double-check that the information was accurate (it was me who did this). Fixes #136508 --- .../flutter/lib/src/painting/image_provider.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart index ae9d833d81..3c0698e942 100644 --- a/packages/flutter/lib/src/painting/image_provider.dart +++ b/packages/flutter/lib/src/painting/image_provider.dart @@ -1194,19 +1194,16 @@ enum ResizeImagePolicy { /// Instructs Flutter to decode the image at the specified dimensions /// instead of at its native size. /// -/// The [width] and [height] parameters refer to logical pixels. -/// -/// Logical pixels have roughly the same visual size across devices, whereas -/// physical pixels correspond to actual device hardware. -/// The number of physical pixels per logical pixel is described by the -/// [ui.FlutterView.devicePixelRatio]. -/// /// This allows finer control of the size of the image in [ImageCache] and is /// generally used to reduce the memory footprint of [ImageCache]. /// /// The decoded image may still be displayed at sizes other than the /// cached size provided here. /// +/// The [width] and [height] parameters determine the image resolution. +/// These values also set the image's width & height in logical pixels +/// if it is unconstrained. +/// /// {@tool snippet} /// This example shows how to size the image to half of the screen's width. /// @@ -1219,6 +1216,11 @@ enum ResizeImagePolicy { /// ); /// ``` /// {@end-tool} +/// +/// See also: +/// +/// * [ui.FlutterView.devicePixelRatio], used to convert between physical and +/// logical pixels. class ResizeImage extends ImageProvider { /// Creates an ImageProvider that decodes the image to the specified size. ///