Make CupertinoNavigationBarBackButton correctly return an assert error#30815
Merged
xster merged 3 commits intoflutter:masterfrom Apr 15, 2019
Merged
Make CupertinoNavigationBarBackButton correctly return an assert error#30815xster merged 3 commits intoflutter:masterfrom
xster merged 3 commits intoflutter:masterfrom
Conversation
| expect(SystemChrome.latestStyle, SystemUiOverlayStyle.dark); | ||
| }); | ||
|
|
||
| testWidgets('Back button shows an error when manually added outside a route', (WidgetTester tester) async { |
Contributor
There was a problem hiding this comment.
I think it would be helpful to explicitly refer to CupertinoNavigationBarBackButton in the test title to make it clear that we're talking about the use of a specific widget, rather than an incidental scenario where some kind of back button appears in the wrong place. E.g., "Exception thrown when CupertinoNavigationBarBackButton is declared outside of a Route."
Contributor
There was a problem hiding this comment.
Also, given the cause of this issue, should there also be a test where the back button widget is used in a route, but it's a route that can't be popped?
|
|
||
| final dynamic exception = tester.takeException(); | ||
| expect(exception, isAssertionError); | ||
| expect(exception.toString(), contains('can be popped')); |
Contributor
There was a problem hiding this comment.
Would you mind matching the exact text of the error?
matthew-carroll
approved these changes
Apr 12, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes an the error that failed to show correctly in https://stackoverflow.com/questions/55486698/in-cupertinonavigationbar-how-do-i-show-a-button-besides-back-button-in-leading
Tests
I added the following tests:
Replace this with a list of the tests that you added as part of this PR. A change in behaviour with no test covering it
will likely get reverted accidentally sooner or later. PRs must include tests for all changed/updated/fixed behaviors. See Test Coverage.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?