Add ToggleButtons.textStyle property#38813
Merged
shihaohong merged 7 commits intoflutter:masterfrom Aug 20, 2019
shihaohong:toggle-button-text-style
Merged
Add ToggleButtons.textStyle property#38813shihaohong merged 7 commits intoflutter:masterfrom shihaohong:toggle-button-text-style
shihaohong merged 7 commits intoflutter:masterfrom
shihaohong:toggle-button-text-style
Conversation
HansMuller
reviewed
Aug 19, 2019
| this.borderWidth, | ||
| }); | ||
|
|
||
| /// The [TextStyle] to apply to any text that appears in this button. |
Contributor
There was a problem hiding this comment.
This is really the default text style for the ToggleButtons' [children], since a ToggleButtons' child like Text('foo', style: bar), still wins the text style.
| ); | ||
|
|
||
| TextStyle textStyle; | ||
| textStyle = tester.firstWidget<DefaultTextStyle>( |
Contributor
There was a problem hiding this comment.
Is "firstWidget" really needed here (and elsewhere)?
Contributor
Author
There was a problem hiding this comment.
Yes -- There are two Material widgets in this test -- The one explicitly instantiated and another one by RawMaterialButton, which is used to create each toggle button.
Contributor
Author
There was a problem hiding this comment.
Discussed offline and updated these finders to be more specific and easier to read
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Allows developers to apply a
TextStyleto theToggleButtonsthrough theToggleButtons.textStyleor theToggleButtonsTheme.textStyleproperties.TextStyle.coloris ignored to preserve the active/selected/disabled color states.cc/ @lisa-liao
Code snippet (note that color is specified)
Result (note that color is ignored)
Related Issues
Fixes #38661
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?