Skip to content

genui-v0.10.4

@diegolopezrm diegolopezrm tagged this 28 Sep 17:48
`Image` here declares only `url`, `fit` and `variant`, so the `description` the published basic catalog defines for it ("Accessibility text for the image") is validated, accepted and then dropped. The image ends up with no accessible name, while the same value becomes the `img` `alt` in web_core, React and Angular, and `accessibilityLabel` in Swift.

This adds `description` to the schema as a string reference and wraps the built image in `Semantics(label: ..., image: true)`. The label goes through `BoundString`, so it can come from the data model like any other string on this component, and an empty or absent value leaves the widget exactly as it was.

The wrapper sits at the single return point rather than on `Image.network` / `Image.asset`, so the two construction paths and the `broken_image` fallback all get the same name without repeating it three times.

Tests: three new cases in `test/image_test.dart`, for the label being announced, the label coming from the data model, and nothing being announced when the field is absent. Package suite is green and `flutter analyze lib test` is clean.

Fixes a2ui-project/a2ui#2740
Assets 2
Loading