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

[Material] TabBarTheme text style parameters #26533

Merged
merged 7 commits into from
Jan 16, 2019

Conversation

johnsonmh
Copy link
Contributor

Add labelStyle and unselectedLabelStyle parameters to the TabBarTheme. This will allow users to specify text themes for all the tab bars in their apps.

Both of these fields already existed on the TabBar class itself.

@zoechi zoechi added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jan 14, 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.

Looks good. Just asking for a few tweaks.

packages/flutter/lib/src/material/tab_bar_theme.dart Outdated Show resolved Hide resolved
packages/flutter/lib/src/material/tabs.dart Outdated Show resolved Hide resolved
@@ -20,9 +20,9 @@ const List<Tab> _tabs = <Tab>[
Tab(text: _tab3Text, icon: Icon(Icons.looks_3)),
];

Widget _buildTabBar({ List<Tab> tabs = _tabs }) {
final TabController _tabController = TabController(length: 3, vsync: const TestVSync());
final TabController _tabController = TabController(length: 3, vsync: const TestVSync());
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is subtly different. Now all of the tab test share the same tab controller which reduces isolation. I don't think that's what we want...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, changed this to a getter, that way every caller gets a new instance of TabController

packages/flutter/test/material/tab_bar_theme_test.dart Outdated Show resolved Hide resolved
packages/flutter/test/material/tab_bar_theme_test.dart Outdated Show resolved Hide resolved
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 some trivial tweaks.

packages/flutter/test/material/tab_bar_theme_test.dart Outdated Show resolved Hide resolved
packages/flutter/test/material/tab_bar_theme_test.dart Outdated Show resolved Hide resolved
@johnsonmh johnsonmh merged commit 5e8e397 into flutter:master Jan 16, 2019
@johnsonmh johnsonmh deleted the feature-tabTextStyles branch January 16, 2019 18:30
kangwang1988 pushed a commit to XianyuTech/flutter that referenced this pull request Feb 12, 2019
* Add labelStyle + unselectedLabelStyle to TabBarTheme
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

4 participants