Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2f15554
Add useLogicalPixels to ResizeImage for logical pixel cache sizing
koji-1009 Apr 2, 2026
00a4e2f
Add dartdoc
koji-1009 Apr 3, 2026
683426a
Always scale by devicePixelRatio in ResizeImage
koji-1009 Apr 26, 2026
d5a26bb
Merge branch 'main' into feat/image_device_pixel_ratio_cache
koji-1009 Apr 26, 2026
4ebb86f
Merge branch 'master' into feat/image_device_pixel_ratio_cache
justinmc Apr 29, 2026
7c19dfe
Revert "Always scale by devicePixelRatio in ResizeImage"
koji-1009 Apr 30, 2026
332dab8
Refactor ResizeImage and update FadeInImage
koji-1009 Apr 30, 2026
a6c4457
Drop unrelated cacheWidth doc reflow
koji-1009 May 1, 2026
33d73e2
Add use-case comment
koji-1009 May 1, 2026
c3b34d1
Refactor ResizeImageKey
koji-1009 May 1, 2026
bca9e56
Add test
koji-1009 May 6, 2026
0068006
dart format
koji-1009 May 6, 2026
4290474
Merge branch 'master' into feat/image_device_pixel_ratio_cache
victorsanni May 8, 2026
70921da
Add ignore comment
koji-1009 May 10, 2026
f5c76da
Rename useLogicalPixels to useLogicalSize and document pixel type
koji-1009 May 14, 2026
feae619
Merge branch 'master' into feat/image_device_pixel_ratio_cache
koji-1009 May 14, 2026
8f891e1
Merge branch 'master' into feat/image_device_pixel_ratio_cache
koji-1009 May 15, 2026
ad9d840
dart format
koji-1009 May 15, 2026
735b911
Expand useLogicalSize dartdoc and share via @macro
koji-1009 May 30, 2026
8951079
Merge branch 'main' into feat/image_device_pixel_ratio_cache
koji-1009 May 30, 2026
8d67b19
Merge branch 'master' into feat/image_device_pixel_ratio_cache
koji-1009 Aug 12, 2026
cb98425
Merge branch 'master' into feat/image_device_pixel_ratio_cache
victorsanni Aug 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Expand useLogicalSize dartdoc and share via @macro
  • Loading branch information
koji-1009 committed May 30, 2026
commit 735b911d72cc11bdaf1487c0c3e85e9f38bbc948
19 changes: 14 additions & 5 deletions packages/flutter/lib/src/painting/image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1264,7 +1264,7 @@ class ResizeImage extends ImageProvider<ResizeImageKey> {
///
/// At least one of `width` and `height` must be non-null.
Comment on lines 1259 to 1265

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should we mention useLogicalPixels here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a reference to useLogicalSize in f5c76da.

///
/// Set [useLogicalSize] to specify `width` and `height` in logical pixels.
/// {@macro flutter.painting.ResizeImage.useLogicalSize}
const ResizeImage(
this.imageProvider, {
this.width,
Expand Down Expand Up @@ -1303,11 +1303,20 @@ class ResizeImage extends ImageProvider<ResizeImageKey> {
/// to use an appropriate [Image.fit].
final bool allowUpscaling;

/// Whether [width] and [height] are interpreted as logical pixels rather
/// than physical pixels.
/// {@template flutter.painting.ResizeImage.useLogicalSize}
/// Whether [width] and [height] are interpreted as logical pixels.
///
/// Set this to true when [width] and [height] describe the image's on-screen
/// size in logical pixels.
/// When `false` (the default), [width] and [height] are treated as physical
/// pixels. On high-density displays, this can result in images being decoded
/// at fewer pixels than the screen can render, producing lower-quality output.
/// When `true`, [width] and [height] are multiplied by the device pixel ratio
/// from the current [ImageConfiguration], so the image is decoded at the
/// resolution that matches the rendered display.
///
/// Typically in the framework, pixel dimensions are interpreted as logical
/// rather than physical. However, this defaults to physical for backwards
/// compatibility.
/// {@endtemplate}
final bool useLogicalSize;

/// Composes the `provider` in a [ResizeImage] only when `cacheWidth` and
Expand Down