Skip to content

Add useDeleteButtonTooltip property for Chip#68237

Merged
fluttergithubbot merged 7 commits into
flutter:masterfrom
royarg02:usedeletetooltipchip
Oct 28, 2020
Merged

Add useDeleteButtonTooltip property for Chip#68237
fluttergithubbot merged 7 commits into
flutter:masterfrom
royarg02:usedeletetooltipchip

Conversation

@royarg02

@royarg02 royarg02 commented Oct 15, 2020

Copy link
Copy Markdown
Contributor

Description

This PR adds a new property for Chips which have a "delete" button, i.e., extend DeletableChipAttributes (Chip, InputChip, and RawChip) named useDeleteButtonTooltip, which enables the user to optionally disable the tooltip for the chip's delete button by useDeleteButtonTooltip: false.

When unspecified, the default value of useDeleteButtonTooltip is true.

Related Issues

Fixes #67944.

Tests

I added the following tests:

  • Test for checking whether the tooltip for the delete button of the chip can be disabled.

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 read the Tree Hygiene wiki page, which explains my responsibilities.
  • 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

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.

@flutter-dashboard flutter-dashboard Bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. work in progress; do not review labels Oct 15, 2020
@google-cla google-cla Bot added the cla: yes label Oct 15, 2020
@royarg02 royarg02 marked this pull request as ready for review October 16, 2020 05:55
/// [deleteButtonTooltipMessage].
///
/// If null, defaults to `true`.
bool? get useDeleteButtonTooltip;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this allowed to be null? Seems like it should just be non-nullable, and available on all the subclasses, like autofocus is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should I add an assert in that case?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you remove the ?, it will then be non-nullable. You can add an assert: it will be useful while we are still in "hybrid" mode non-nullability support, but the assert will eventually be removed, because the compiler will just prevent it from happening, and it won't be needed anymore.

@royarg02 royarg02 requested a review from gspencergoog October 27, 2020 08:58

@gspencergoog gspencergoog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@gspencergoog

Copy link
Copy Markdown
Contributor

@royarg02 I've removed the "work in progress" label, since it looks like this PR is done, but I won't commit it until you give the go-ahead.

@royarg02

royarg02 commented Oct 28, 2020

Copy link
Copy Markdown
Contributor Author

@gspencergoog sure, I'm all done from my side.

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

Labels

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.

Allow Chip tooltips to be turned off

3 participants