Skip to content

Add loadingWidget support for backgroundImage #2349

Description

@usmanvrtx

The Image widget supports loadingWidget, but backgroundImage does not support it consistently across all rendering paths. The decoration-based rendering path ignores loadingWidget, so no shimmer/placeholder can be shown while a remote background image loads. This behavior is also undocumented.

Describe the solution you'd like

Support loadingWidget on backgroundImage consistently across all rendering paths:

styles:
  backgroundImage:
    source: ${imageUrl}
    fit: cover
    loadingWidget:
      Shape:
        type: rectangle
        styles:
          backgroundColor: 0xff333333

Also document the supported properties for backgroundImage.loadingWidget.

Describe alternatives you've considered

Replacing backgroundImage with a separate Image widget or a manual Stack — both work but require extra layout logic and duplicate framework functionality.

Additional context

Image.loadingWidget is already supported and used for shimmer placeholders. The framework's getImageAsWidget() path handles backgroundImage.loadingWidget, but getImageAsDecorated() does not. The behavior should be consistent or explicitly documented as limited to specific rendering paths.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions