Skip to content

Conversation

@Piinks
Copy link
Contributor

@Piinks Piinks commented May 4, 2022

This adds an assertion to ScaffoldMessenger.showSnackBar that makes sure the user will actually see the SnackBar. :)

Fixes #103004

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 this 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 f: material design flutter/packages/flutter/material repository. a: quality A truly polished experience a: error message Error messages from the Flutter framework labels May 4, 2022
@Piinks Piinks requested a review from craiglabenz May 4, 2022 00:26
@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label May 4, 2022
Copy link
Contributor

@craiglabenz craiglabenz left a comment

Choose a reason for hiding this comment

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

Very nice!

home: Center(),
));

final ScaffoldMessengerState scaffoldMessengerState = tester.state<ScaffoldMessengerState>(
Copy link
Contributor

Choose a reason for hiding this comment

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

I've never seen tester.state before!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: error message Error messages from the Flutter framework a: quality A truly polished experience f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ScaffoldMessenger.showSnackBar doesn't check if there are any Scaffolds to present in

3 participants