Skip to content

fix DefaultTextStyle not notifying updates for some changes #9416

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

Merged
merged 1 commit into from
Apr 17, 2017

Conversation

ds84182
Copy link
Contributor

@ds84182 ds84182 commented Apr 16, 2017

See #9415.

Works for me locally, so lgtm 👍

@abarth
Copy link
Contributor

abarth commented Apr 17, 2017

Looks pretty good. Two issues:

  1. Our style guide says to use { / } for functions that are more than one textual line.

  2. We need a test to make sure we don't regress. The test can be pretty simple. If you look in the packages/flutter/test/widgets directory, you'll see lots of examples of tests. Basically, I would use tester.pumpWidget to build a DefaultTextStyle with a pre-built Text child (i.e., one that you keep in a local variable outside the pumpWidget call) and then use find.byType(RichText) to see what values actually get used in the underlying RichText widget. Then, you can use tester.pumpWidget to make a new DefaultTextStyle with the exact same prebuilt Text child, and then again verify that one of the properties on the RichText that we failed to update before now gets updated.

@ds84182 ds84182 force-pushed the default-text-style-notify branch from 1bd0ff6 to 2181dfc Compare April 17, 2017 00:41
@ds84182
Copy link
Contributor Author

ds84182 commented Apr 17, 2017

Updated, fixed style and added test

@abarth
Copy link
Contributor

abarth commented Apr 17, 2017

LGTM

Travis would like you use one more const constructor:

[lint] Prefer const with constant constructors. (packages/flutter/test/widgets/default_text_style_test.dart, line 26, col 29)

@ds84182 ds84182 force-pushed the default-text-style-notify branch from 2181dfc to d052b67 Compare April 17, 2017 01:51
@abarth
Copy link
Contributor

abarth commented Apr 17, 2017

Thanks so much! Once the bots go green, I'll merge your patch.

@abarth abarth merged commit 0d152a6 into flutter:master Apr 17, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants