Skip to content

Conversation

@gspencergoog
Copy link
Collaborator

Description

This implements the weight attribute for components as an Expanded with a flex factor for components that have weight set.

gemini-code-assist[bot]

This comment was marked as resolved.

final weight = component?.weight;
final childWidget = buildChild(id, dataContext);
if (weight != null) {
return Expanded(flex: weight, child: childWidget);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Neat! Previously, I had assumed that introducing these interactions between child/parent widgets would add too much complexity to the rendering engine to make sense, but I guess it's not actually that bad. Now I see how we could implement the "hero image" pattern that Paul is after for full bleed images at the top of cards.

@gspencergoog gspencergoog merged commit 6a86aef into flutter:main Oct 31, 2025
30 checks passed
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