-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Helpful assertion for isAlwaysShown error #58258
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
Helpful assertion for isAlwaysShown error #58258
Conversation
@onatcipli Does this look good to you? I wanted to make sure people understand they need to pass a controller to avoid confusion like in #53771 (comment). |
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.
LGTM!
} | ||
|
||
expect(() async { | ||
await tester.pumpWidget(viewWithScroll()); |
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.
Will this test pass prior to the change? Before this change the assert should still trigger at the end of the frame right?
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.
I just tried it and it fails prior to the change (so does the corresponding material test).
It does still throw an error though, but I guess it's happening in the post frame callback and so it's not caught by this.
Description
When a scrollbar's isAlwaysShown is true, it must have a controller that's attached to a scrollview. Previously, an assertion deeper in the framework would get triggered if this wasn't the case, with an error message that's not so informative. This PR adds an assertion directly in the constructor with a more helpful error message.
Related Issues
Closes #53771
Tests
I added the following tests: