Skip to content

Conversation

@shihaohong
Copy link
Contributor

@shihaohong shihaohong commented Jul 24, 2019

Description

Re-attempt #36030, fixing misunderstanding of debugLabel and updating accordingly.

Updates from previous attempt are as follows:

Note: Screenshot sizes differ because of how I took the screenshots, all tooltips are the same size in these images.

  1. Implements a TooltipTheme widget that allows all existing properties to be themeable.

Screen Shot 2019-07-19 at 1 25 50 PM

Screen Shot 2019-07-19 at 1 25 40 PM

  1. Introduces the textStyle property, granting more fine-grained control to developers to update the tooltip's text message.

Screen Shot 2019-07-19 at 1 31 22 PM

Screen Shot 2019-07-19 at 1 31 06 PM

  1. Breaking change: Updating default tooltip decoration to the following:
  • Brightness.light
BoxDecoration(
  color: Colors.grey[700].withOpacity(0.9),
  borderRadius: const BorderRadius.all(Radius.circular(4)),
);
  • Brightness.dark
BoxDecoration(
  color: Colors.white.withOpacity(0.9), // new
  borderRadius: const BorderRadius.all(Radius.circular(4)),
);
  1. Breaking change: Updating default textStyle to the following:
  • Brightness.light
theme.textTheme.body1.copyWith(
  color: Colors.white, // new
  debugLabel: theme.textTheme.body1.debugLabel.replaceAll('white', 'black'), // fixes debugLabel
);
  • Brightness.dark
theme.textTheme.body1.copyWith(
  color: Colors.black, // new
  debugLabel: theme.textTheme.body1.debugLabel.replaceAll('white', 'black'), // fixes debugLabel
);

Tooltip Before Breaking change:
Screen Shot 2019-07-19 at 3 21 15 PM
Screen Shot 2019-07-19 at 3 21 26 PM

Tooltip After Breaking change:
Screen Shot 2019-07-19 at 3 19 39 PM
Screen Shot 2019-07-19 at 3 20 08 PM

Related Issues

Fixes #35513
Related to #33654
Related to #25844

Tests

I added the following tests:

Several tests verifying passing down of TooltipTheme properties (color, location, height, decoration, semantics, show and wait durations to reveal and hide tooltip)
Tests for textStyle implementation
Test to verify debugLabel for light and dark theme

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.

shihaohong and others added 30 commits July 10, 2019 15:58
…property

Not documented yet, still needs tests for TooltipTheme.
@shihaohong shihaohong added c: new feature Nothing broken; request for a new capability framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. c: API break Backwards-incompatible API changes labels Jul 24, 2019
@shihaohong shihaohong requested a review from HansMuller July 24, 2019 16:59
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

@shihaohong shihaohong merged commit dee8e42 into flutter:master Jul 25, 2019
johnsonmh pushed a commit to johnsonmh/flutter that referenced this pull request Jul 30, 2019
…ip defaults (flutter#36856)

* Implement TooltipThemeData and TooltipTheme

* Add text style property 

* Updated tooltip default colors for light and dark theme to match Material specification
@tapizquent
Copy link

tapizquent commented Aug 20, 2019

Has tooltip textStyle disappeared in new Flutter versions? I don't seem to find this available in v1.7.8

@tapizquent
Copy link

Disregard my previous comment, just realized 1.7.8 was not the last version. Updated to 1.9.2 and it works fine now. Thanks!

@shihaohong shihaohong deleted the tooltip-theme branch September 10, 2019 16:20
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: API break Backwards-incompatible API changes c: new feature Nothing broken; request for a new capability 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.

Global configuration for Tooltip

4 participants