Skip to content
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

[Chip] Make sure InkResponse is in the foreground on delete for chips with background color #41463

Merged
merged 12 commits into from
Oct 24, 2019

Conversation

perclasson
Copy link
Contributor

@perclasson perclasson commented Sep 27, 2019

Description

For chips with background color set the ripple is not in the foreground, but behind the chip.
Reason for this bug is described here:
https://api.flutter.dev/flutter/material/InkResponse-class.html#the-ink-splashes-arent-visible

Screenshot before:
before the ink response was behind the chip

Screenshot after:
after the ink response is now shown

Related Issues

#41461 [Chip] Delete icon ripple not visible for Chip when background color is set

Tests

I added the following tests:
packages/flutter/test/material/chip_test.dart
'Chips should use Ink instead of Container for delete icon ripple'

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@perclasson perclasson self-assigned this Sep 27, 2019
@fluttergithubbot fluttergithubbot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Sep 27, 2019
@@ -1808,6 +1808,28 @@ void main() {
expect(find.byType(InkWell), findsOneWidget);
});

testWidgets('Chips should use Ink instead of Container for delete icon ripple', (WidgetTester tester) async {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to test that the ink renders in the foreground without testing the implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a test for this now.

Copy link
Member

@rami-a rami-a left a comment

Choose a reason for hiding this comment

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

LGTM

@perclasson perclasson requested review from HansMuller and removed request for jmagman and Piinks October 11, 2019 16:17
@Piinks Piinks added the a: fidelity Matching the OEM platforms better label Oct 17, 2019
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM with a few small suggestions.

packages/flutter/lib/src/material/chip.dart Show resolved Hide resolved
packages/flutter/test/material/chip_test.dart Outdated Show resolved Hide resolved
packages/flutter/test/material/chip_test.dart Show resolved Hide resolved
@perclasson perclasson merged commit 588275e into flutter:master Oct 24, 2019
jonahwilliams added a commit that referenced this pull request Oct 24, 2019
…or chips with background color (#41463)"

This reverts commit 588275e.
jonahwilliams added a commit that referenced this pull request Oct 24, 2019
…or chips with background color (#41463)" (#43391)

This reverts commit 588275e.
@perclasson
Copy link
Contributor Author

This PR was conflicting with the following PR and thus a test for this branch failed on master:
#42779

Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
… with background color (flutter#41463)

* Make sure InkResponse is visible on delete for chips with background color set

* Override computeDistanceToActualBaseline in layout builder
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: fidelity Matching the OEM platforms better 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.

None yet

7 participants