-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Rename onPressed to nextArticleCallback in ArticlePage and Fixing Unbounded Height Exception #13013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…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.
Summary of ChangesHello @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 Highlights
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
/gcbrun |
|
Visit the preview URL for this PR (updated for commit ec98702): |
|
/gcbrun |
|
@PTMakes, can you make the change recommended by the bot? |
Description of what this PR is changing or adding, and why:
Changing 3 mentions of
onPressedtonextArticleCallback.ArticlePage
onPressedchanges tonextArticleCallbackinStep 8 Add article content and buttonwithout any mention of why.nextArticleCallbackis 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.minto ArticlePage ColumnThe
SingleChildScrollViewunder ArticlePage passes an infinite height to theColumn, which then passes an infinite height to theFlexiblewidget, which causes an exception: "RenderFlex children have non-zero flex but incoming height constraints are unbounded.".mainAxisSize: MainAxisSize.minensures theColumnadds 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 breaksof 80 characters or fewer.