Skip to content

Conversation

@PTMakes
Copy link
Contributor

@PTMakes PTMakes commented Jan 31, 2026

Description of what this PR is changing or adding, and why:

Changing 3 mentions of onPressed to nextArticleCallback.

ArticlePage onPressed changes to nextArticleCallback in Step 8 Add article content and button without any mention of why. nextArticleCallback is indicated as the intended name in step 6's text: "this widget takes summary data and a callback function".

Fixing Unbounded Height Exception by adding mainAxisSize: MainAxisSize.min to ArticlePage Column

The SingleChildScrollView under ArticlePage passes an infinite height to the Column, which then passes an infinite height to the Flexible widget, which causes an exception: "RenderFlex children have non-zero flex but incoming height constraints are unbounded.". mainAxisSize: MainAxisSize.min ensures the Column adds a height constraint now.

Note: There are other ways to fix both of these. I'm not sure what is preferred, I'm just proposing what makes the most sense to me.

Issues fixed by this PR (if any):

N/A

PRs or commits this PR depends on (if any):

N/A

Presubmit checklist

  •  If you are unwilling, or unable, to sign the CLA, even for a tiny, one-word PR, please file an issue instead of a PR.
  •  If this PR is not meant to land until a future stable release, mark it as draft with an explanation.
  •  This PR follows the Google Developer Documentation Style Guidelines—for example, it doesn't use i.e. or e.g., and it avoids I and we (first-person pronouns).
  •  This PR uses semantic line breaks
    of 80 characters or fewer.

…ption

ArticlePage `onPressed` changes to `nextArticleCallback` in `Step 8 Add article content and button`... In step 6 "this widget takes summary data and a callback function" makes me assume `nextArticleCallback` is the intended name, so that is what I have changed the `onPressed` back to.


And the exception: The `SingleChildScrollView` under `ArticlePage` passes an infinite height to the column, which then passes an infinite height to the Flexible widget, which causes an exception: "RenderFlex children have non-zero flex but incoming height constraints are unbounded.". I added mainAxisSize: MainAxisSize.min, so the column adds a height constraint now. Obviously there are other ways to fix this though. I'm not sure what is preferred.
@PTMakes PTMakes requested review from a team and sfshaza2 as code owners January 31, 2026 07:17
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @PTMakes, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the ArticlePage widget by renaming a key callback parameter and its corresponding field to improve code readability and align with tutorial instructions. Additionally, it addresses a critical UI rendering issue by constraining the height of a Column widget, preventing an Unbounded Height Exception and ensuring the layout behaves as expected.

Highlights

  • Refactor Callback Name: The onPressed callback in ArticlePage has been renamed to nextArticleCallback for clarity and consistency with the intended naming convention mentioned in the tutorial steps.
  • Fix Unbounded Height Exception: An Unbounded Height Exception occurring in ArticlePage has been resolved by adding mainAxisSize: MainAxisSize.min to the Column widget, ensuring proper height constraints are applied.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 addresses two issues: it renames onPressed to the more descriptive nextArticleCallback for better clarity, and it fixes an unbounded height exception by adding mainAxisSize: MainAxisSize.min to a Column. The changes are sound and improve the code in the tutorial. I've added one suggestion to further simplify the widget tree by removing a now-redundant Flexible widget.

Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This is a good fix for the unbounded height exception. As a follow-up, since the Column now has mainAxisSize: MainAxisSize.min and shrinks to fit its children, the Flexible widget wrapping ArticleWidget on lines 259-263 is no longer necessary and can be removed to simplify the widget tree.

@parlough
Copy link
Member

parlough commented Feb 2, 2026

/gcbrun

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Feb 2, 2026

Visit the preview URL for this PR (updated for commit ec98702):

https://flutter-docs-prod--pr13013-patch-2-j2zjm2ib.web.app

@parlough
Copy link
Member

parlough commented Feb 4, 2026

/gcbrun

@sfshaza2
Copy link
Contributor

sfshaza2 commented Feb 4, 2026

@PTMakes, can you make the change recommended by the bot?

@sfshaza2 sfshaza2 added the act.wait-for-customer Needs response from customer label Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act.wait-for-customer Needs response from customer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants