Fix Scaffold having status bar when primary is false#175156
Fix Scaffold having status bar when primary is false#175156auto-submit[bot] merged 10 commits intoflutter:masterfrom
Scaffold having status bar when primary is false#175156Conversation
There was a problem hiding this comment.
Code Review
This pull request correctly addresses the issue where a Scaffold with primary: false would incorrectly include a status bar gesture detector. The change is simple and effective, wrapping the status bar logic in a condition that checks widget.primary. The accompanying tests are well-written, covering both the intended behavior and preventing potential regressions. I have one minor suggestion to fix a typo in a test description.
| removeRightPadding: false, | ||
| removeBottomPadding: true, | ||
| ); | ||
| if (widget.primary) { |
There was a problem hiding this comment.
Drive-by nit: This can use an early return instead, to reduce the diff / indent?
if (!widget.primary) {
break;
}
_addIfNonNull(...);There was a problem hiding this comment.
Good idea! Thanks for the suggestion
| switch (themeData.platform) { | ||
| case TargetPlatform.iOS: | ||
| case TargetPlatform.macOS: | ||
| if (!widget.primary) { |
There was a problem hiding this comment.
Can you also add a paragraph explaining this to the document of [primary]?
Piinks
left a comment
There was a problem hiding this comment.
LGTM with a couple of doc nits, thanks for the contribution!
| /// If true then the height of the [appBar] will be extended by the height | ||
| /// of the screen's status bar, i.e. the top padding for [MediaQuery]. | ||
| /// | ||
| /// If ture, on iOS and macOS, tapping the status bar scrolls the app's |
There was a problem hiding this comment.
| /// If ture, on iOS and macOS, tapping the status bar scrolls the app's | |
| /// If true, on iOS and macOS, tapping the status bar scrolls the app's |
|
|
||
| // On iOS, tapping the status bar scrolls the app's primary scrollable to the | ||
| // top. We implement this by looking up the primary scroll controller and | ||
| // On iOS and macOS, tapping the status bar scrolls the app's primary scrollable |
There was a problem hiding this comment.
| // On iOS and macOS, tapping the status bar scrolls the app's primary scrollable | |
| // On iOS and macOS, if `primary` is true, tapping the status bar scrolls the app's primary scrollable |
|
autosubmit label was removed for flutter/flutter/175156, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.
|
When primary is false, `Scaffold` is not at the top of screen, so it should not have a status bar. fixes flutter#175062 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
When primary is false,
Scaffoldis not at the top of screen, so it should not have a status bar.fixes #175062
Pre-launch Checklist
///).Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.