Skip to content

Fix missing root Scaffold check in ScaffoldMessenger #77410

Merged
fluttergithubbot merged 2 commits into
flutter:masterfrom
Piinks:b77251
Mar 5, 2021
Merged

Fix missing root Scaffold check in ScaffoldMessenger #77410
fluttergithubbot merged 2 commits into
flutter:masterfrom
Piinks:b77251

Conversation

@Piinks

@Piinks Piinks commented Mar 5, 2021

Copy link
Copy Markdown
Contributor

Fixes #77251

This fixes a missed call site where we are not checking for nested Scaffolds in the ScaffoldMessenger. In #74093 we added handling for nested Scaffolds by finding the root Scaffold and only displaying there. Anywhere Scaffold._updateSnackBar is called should be preceded by checking the _isRoot method. There was one that was missing this check when Scaffolds are registering with the ScaffoldMessenger and a SnackBar is currently active.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@Piinks Piinks added c: crash Stack traces logged to the console framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. labels Mar 5, 2021
@Piinks Piinks requested a review from goderbauer March 5, 2021 20:41
@google-cla google-cla Bot added the cla: yes label Mar 5, 2021
@Piinks Piinks changed the title B77251 Fix missing root Scaffold check in ScaffoldMessenger Mar 5, 2021

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@fluttergithubbot fluttergithubbot merged commit d75c278 into flutter:master Mar 5, 2021
christopherfujino pushed a commit to chris-forks/flutter that referenced this pull request Mar 10, 2021
christopherfujino added a commit that referenced this pull request Mar 11, 2021
* Reject unaccepted pointers in Drag recognizer (#75943)
* Delete unzipped FlutterMacOS.framework before replacing artifact (#77316)
* Fix missing root Scaffold check in ScaffoldMessenger  (#77410)
* Roll engine cherrypicks

Co-authored-by: Michael Goderbauer <goderbauer@google.com>
Co-authored-by: Jenn Magder <magder@google.com>
Co-authored-by: Kate Lovett <katelovett@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: crash Stack traces logged to the console f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with ScaffoldManager and double scaffold

3 participants