-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fix chip ripple bug — No longer two ripples #42779
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
Fix chip ripple bug — No longer two ripples #42779
Conversation
| TextDirection textDirection = TextDirection.ltr, | ||
| }){ | ||
| return _wrapForChip( | ||
| child: Wrap( |
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.
What is the need for the Wrap widget? Can you remove it?
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.
@rami-a @HansMuller @gspencergoog
I used a Wrap because some existing tests also used it, even when it has only one child.
It seems that in other tests of chip_test.dart, the Chip widget is always wrapped in some other widget, such as Wrap, Column, Row, or Center.
Does anyone know the reason behind this practice?
The ripple behaves differently when not wrapped in a Wrap widget (but it always makes exactly one ripple).
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.
One use case for the Chip is to be inside of a Wrap field that also allows entering text. Think of the "To:" field in GMail: you type addresses, and they convert to wrapped chips.
That's why I used initially Wrap in tests so that we can be sure that the Chip behaves properly in that context.
rami-a
left a 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.
██╗ ██████╗ ████████╗███╗ ███╗
██║ ██╔════╝ ╚══██╔══╝████╗ ████║
██║ ██║ ███╗ ██║ ██╔████╔██║
██║ ██║ ██║ ██║ ██║╚██╔╝██║
███████╗╚██████╔╝ ██║ ██║ ╚═╝ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
johnsonmh
left a 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.
██╗ ██████╗ ████████╗███╗ ███╗
██║ ██╔════╝ ╚══██╔══╝████╗ ████║
██║ ██║ ███╗ ██║ ██╔████╔██║
██║ ██║ ██║ ██║ ██║╚██╔╝██║
███████╗╚██████╔╝ ██║ ██║ ╚═╝ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
HansMuller
left a 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
gspencergoog
left a 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.
* Fixed chip ripple. * Fixed chip ripple. All tests passed. * Fix one minor detail. * Fixed reference box. * Playing around 2. * Added tests for chip ripple. * Reverting print-debugging statements * Remove extra blank line. * Fixed chip ripple. * Remove commented code. * Reconciles with upstream/master. * Remove print-debugging statement. * Remove empty line. * Edit comments. * Edit style and comments. * Edit style. * Fix style and capitalization. * Return bool. * Edit style. * Use getMaterialBox instead of Material.of(...). * Experiment 3. * Revert. * Using tester.pump instead of pumpFrames * Delete pumpFrames. * Edit comments.

Description
This PR fixes the "Chip Ripple" bug:
Related Issues
b/140930220
Tests
I added the following tests:
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?