Skip to content

Conversation

@remax21
Copy link
Contributor

@remax21 remax21 commented May 6, 2025

📝 Description

This pull request improves the image precaching mechanism in widget tests by adding support for ShapeDecoration.

Previously, only BoxDecoration was checked when attempting to extract and precache background images in decorated widgets. However, ShapeDecoration can also contain images through its image property.


✅ Changes

Affected file : await_images.dart

  • Replaced the if (decoration is BoxDecoration) check with a switch expression to handle multiple decoration types.
  • Added support for extracting images from ShapeDecoration.
  • Defaulted to null when the decoration type is not handled or contains no image.

🧪 Motivation

Some widgets use ShapeDecoration instead of BoxDecoration to apply background images. Without this change, those images were not detected and precached during widget tests, potentially leading to rendering issues or test flakiness.

By extending support to ShapeDecoration, this PR ensures that all relevant images are properly precached, improving the reliability and coverage of widget tests.

@T-moz
Copy link
Member

T-moz commented Aug 29, 2025

@remax21 Thanks for the contribution !

Sorry for the delay, I din't saw your pull request

@T-moz T-moz merged commit f376755 into bamlab:main Aug 29, 2025
3 checks passed
@T-moz
Copy link
Member

T-moz commented Aug 29, 2025

@remax21 It's now available in the 0.9.1 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants