Repository navigation
TabBar labelStyle.color and unselectedLabelStyle.color does not take effect #109484
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Aug 15, 2022 Hi @dayveedaniel, Thanks for filing the issue. I am able to reproduce the issue on the latest stable and the master channel. Looks like
labelStyle.colorandunselectedLabelStyle.colorare not taking effect while other properties seem to work.Screen.Recording.2022-08-15.at.1.55.24.PM.mov
code sample
import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', home: MyHomePage(), ); } } class MyHomePage extends StatefulWidget { _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateMixin { late final TabController _controller; @override void initState() { super.initState(); _controller = TabController(length: 2, vsync: this); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: Column( children: [ Container( decoration: BoxDecoration( color: Colors.cyan, borderRadius: BorderRadius.circular(12), ), child: TabBar( controller: _controller, labelStyle: TextStyle( fontWeight: FontWeight.w700, fontSize: 14, color: Colors.red), unselectedLabelStyle: TextStyle( fontWeight: FontWeight.bold, fontSize: 20, color: Colors.red), indicator: BoxDecoration( color: Colors.teal, borderRadius: BorderRadius.circular(8)), tabs: [ Tab(text: 'Tab 1'), Tab(text: 'Tab 2'), ], ), ), Expanded( child: TabBarView(controller: _controller, children: [ Text('tab 1'), Text('tab 2'), ]), ) ], )); } }
flutter doctor -v (mac)
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-IN) • Flutter version 3.0.5 at /Users/mahesh/Documents/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (5 days ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4) • Android SDK at /Users/mahesh/Library/Android/sdk • Platform android-32, build-tools 33.0.0-rc4 • ANDROID_HOME = /Users/mahesh/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [✓] IntelliJ IDEA Community Edition (version 2021.2.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 61.2.4 • Dart plugin version 212.5080.8 [✓] VS Code (version 1.67.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.44.0 [✓] Connected device (3 available) • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64 • Android 11 (API 30) (emulator) • macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.114 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found![✓] Flutter (Channel master, 3.1.0-0.0.pre.2009, on macOS 12.4 21F79 darwin-arm, locale en-IN) • Flutter version 3.1.0-0.0.pre.2009 on channel master at /Users/mahesh/Documents/flutter_master • Upstream repository https://github.com/flutter/flutter.git • Framework revision 9d96c7b8be (3 days ago), 2022-08-01 00:39:06 -0400 • Engine revision cf0db3e546 • Dart version 2.19.0 (build 2.19.0-49.0.dev) • DevTools version 2.16.0 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4) • Android SDK at /Users/mahesh/Library/Android/sdk • Platform android-32, build-tools 33.0.0-rc4 • ANDROID_HOME = /Users/mahesh/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 13C100 • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [✓] IntelliJ IDEA Community Edition (version 2021.2.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 61.2.4 • Dart plugin version 212.5080.8 [✓] VS Code (version 1.69.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.46.0 [✓] Connected device (3 available) • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64 • Android 11 (API 30) (emulator) • macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.79 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found!- addedframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packageshas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onfound in release: 3.0Found to occur in 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1Found to occur in 3.1and removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Aug 15, 2022 - changed the title
[-]unselectedLabelStyle of TabBar is not applied [/-][+]TabBar labelStyle.color and unselectedLabelStyle.color does not take effect[/+]on Aug 15, 2022 looks like this is a breaking change (ref: #109541 (comment)). we'd want to wait until there was strong demand for the feature before we can make the change.
- addedteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamand removedtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
on Jul 8, 2023 8 remaining items
@TahaTesser - is this issue still unresolved?
Yes. this seems to be a breaking change. When @werainkhatri tried to fix this it broke the internal tests per your comment .
I can work on a fix with a breaking change migration guide to fix this issue if you want.
A fix would be good thing to work on, yes.
Reacted by Taha Tesser, lan2000 and Sergei Neronov- added a commit that references this issue
on Aug 30, 2023 - added a commit that references this issue
on Sep 7, 2023 - addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Sep 7, 2023 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Sep 21, 2023
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone (PR merged)
Steps to Reproduce
1.(similar issue #67342 but on tab bar) Execute
flutter runon the code sampleExpected results: unselected tab text color should be black
Actual results: unselected tab text color is same as selected tab
Logs