Skip to content

Conversation

@gspencergoog
Copy link
Collaborator

Description

Switches the name of the hint property to be usageHint, which describes it in less generic terms.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly refactors the hint property to usageHint across multiple files, improving clarity. The changes are consistent and cover code, tests, and schema definitions. I've added a few suggestions to further improve code maintainability and documentation by addressing magic numbers and enhancing doc comments.

Comment on lines +66 to +67
/// - `usageHint`: A usage hint for the image size and style. One of 'icon',
/// 'avatar', 'smallFeature', 'mediumFeature', 'largeFeature', 'header'.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The description for usageHint in the schema provides useful details about what each hint value means. It would be beneficial to include this information in the documentation comment here as well to improve discoverability for developers reading the code.

Suggestion:

/// - `usageHint`: A usage hint for the image size and style. One of:
///   - `icon`: Small square icon.
///   - `avatar`: Circular avatar image.
///   - `smallFeature`: Small feature image.
///   - `mediumFeature`: Medium feature image.
///   - `largeFeature`: Large feature image.
///   - `header`: Full-width, full bleed, header image.

Comment on lines +31 to +32
/// - `usageHint`: A usage hint for the text size and style. One of 'h1', 'h2',
/// 'h3', 'h4', 'h5', 'caption', 'body'.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The documentation for usageHint could be more descriptive. Providing details for each hint value, similar to what's in packages/flutter_genui_a2ui/server_to_client.json, would be helpful for developers.

Suggestion:

/// - `usageHint`: A usage hint for the text size and style. One of:
///   - `h1`: Largest heading.
///   - `h2`: Second largest heading.
///   - `h3`: Third largest heading.
///   - `h4`: Fourth largest heading.
///   - `h5`: Fifth largest heading.
///   - `caption`: Small text for captions.
///   - `body`: Standard body text.

@gspencergoog gspencergoog merged commit 688ec56 into flutter:main Nov 12, 2025
22 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