Unverified Commit 5929f4f7 authored by Amit Patil's avatar Amit Patil Committed by GitHub

updated defualt value of unselectedItemColor textTheme.caption.color to...

updated defualt value of unselectedItemColor textTheme.caption.color to unselectedWidgetColor (#71314)
parent 0aec2c3d
...@@ -15,7 +15,6 @@ import 'debug.dart'; ...@@ -15,7 +15,6 @@ import 'debug.dart';
import 'ink_well.dart'; import 'ink_well.dart';
import 'material.dart'; import 'material.dart';
import 'material_localizations.dart'; import 'material_localizations.dart';
import 'text_theme.dart';
import 'theme.dart'; import 'theme.dart';
import 'tooltip.dart'; import 'tooltip.dart';
...@@ -267,7 +266,7 @@ class BottomNavigationBar extends StatefulWidget { ...@@ -267,7 +266,7 @@ class BottomNavigationBar extends StatefulWidget {
/// The color of the unselected [BottomNavigationBarItem.icon] and /// The color of the unselected [BottomNavigationBarItem.icon] and
/// [BottomNavigationBarItem.title]s. /// [BottomNavigationBarItem.title]s.
/// ///
/// If null then the [TextTheme.caption]'s color is used. /// If null then the [ThemeData.unselectedWidgetColor]'s color is used.
final Color? unselectedItemColor; final Color? unselectedItemColor;
/// The size, opacity, and color of the icon in the currently selected /// The size, opacity, and color of the icon in the currently selected
...@@ -853,7 +852,7 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr ...@@ -853,7 +852,7 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
colorTween = ColorTween( colorTween = ColorTween(
begin: widget.unselectedItemColor begin: widget.unselectedItemColor
?? bottomTheme.unselectedItemColor ?? bottomTheme.unselectedItemColor
?? themeData.textTheme.caption!.color, ?? themeData.unselectedWidgetColor,
end: widget.selectedItemColor end: widget.selectedItemColor
?? bottomTheme.selectedItemColor ?? bottomTheme.selectedItemColor
?? widget.fixedColor ?? widget.fixedColor
......
...@@ -70,13 +70,13 @@ void main() { ...@@ -70,13 +70,13 @@ void main() {
testWidgets('Fixed BottomNavigationBar defaults', (WidgetTester tester) async { testWidgets('Fixed BottomNavigationBar defaults', (WidgetTester tester) async {
const Color primaryColor = Color(0xFF000001); const Color primaryColor = Color(0xFF000001);
const Color captionColor = Color(0xFF000002); const Color unselectedWidgetColor = Color(0xFF000002);
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData( theme: ThemeData(
primaryColor: primaryColor, primaryColor: primaryColor,
textTheme: const TextTheme(caption: TextStyle(color: captionColor)), unselectedWidgetColor: unselectedWidgetColor,
), ),
home: Scaffold( home: Scaffold(
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
...@@ -106,7 +106,7 @@ void main() { ...@@ -106,7 +106,7 @@ void main() {
expect(selectedFontStyle.fontSize, selectedFontSize); expect(selectedFontStyle.fontSize, selectedFontSize);
expect(selectedFontStyle.fontWeight, equals(FontWeight.w400)); expect(selectedFontStyle.fontWeight, equals(FontWeight.w400));
expect(selectedFontStyle.height, isNull); expect(selectedFontStyle.height, isNull);
expect(unselectedFontStyle.color, equals(captionColor)); expect(unselectedFontStyle.color, equals(unselectedWidgetColor));
expect(unselectedFontStyle.fontWeight, equals(FontWeight.w400)); expect(unselectedFontStyle.fontWeight, equals(FontWeight.w400));
expect(unselectedFontStyle.height, isNull); expect(unselectedFontStyle.height, isNull);
// Unselected label has a font size of 14 but is scaled down to be font size 12. // Unselected label has a font size of 14 but is scaled down to be font size 12.
...@@ -116,7 +116,7 @@ void main() { ...@@ -116,7 +116,7 @@ void main() {
); );
expect(selectedIcon.color, equals(primaryColor)); expect(selectedIcon.color, equals(primaryColor));
expect(selectedIcon.fontSize, equals(24.0)); expect(selectedIcon.fontSize, equals(24.0));
expect(unselectedIcon.color, equals(captionColor)); expect(unselectedIcon.color, equals(unselectedWidgetColor));
expect(unselectedIcon.fontSize, equals(24.0)); expect(unselectedIcon.fontSize, equals(24.0));
// There should not be any [Opacity] or [FadeTransition] widgets // There should not be any [Opacity] or [FadeTransition] widgets
// since showUnselectedLabels and showSelectedLabels are true. // since showUnselectedLabels and showSelectedLabels are true.
...@@ -439,7 +439,7 @@ void main() { ...@@ -439,7 +439,7 @@ void main() {
testWidgets('Fixed BottomNavigationBar custom font size, color', (WidgetTester tester) async { testWidgets('Fixed BottomNavigationBar custom font size, color', (WidgetTester tester) async {
const Color primaryColor = Colors.black; const Color primaryColor = Colors.black;
const Color captionColor = Colors.purple; const Color unselectedWidgetColor = Colors.purple;
const Color selectedColor = Colors.blue; const Color selectedColor = Colors.blue;
const Color unselectedColor = Colors.yellow; const Color unselectedColor = Colors.yellow;
const double selectedFontSize = 18.0; const double selectedFontSize = 18.0;
...@@ -449,7 +449,7 @@ void main() { ...@@ -449,7 +449,7 @@ void main() {
MaterialApp( MaterialApp(
theme: ThemeData( theme: ThemeData(
primaryColor: primaryColor, primaryColor: primaryColor,
textTheme: const TextTheme(caption: TextStyle(color: captionColor)), unselectedWidgetColor: unselectedWidgetColor,
), ),
home: Scaffold( home: Scaffold(
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
...@@ -499,7 +499,7 @@ void main() { ...@@ -499,7 +499,7 @@ void main() {
testWidgets('Shifting BottomNavigationBar custom font size, color', (WidgetTester tester) async { testWidgets('Shifting BottomNavigationBar custom font size, color', (WidgetTester tester) async {
const Color primaryColor = Colors.black; const Color primaryColor = Colors.black;
const Color captionColor = Colors.purple; const Color unselectedWidgetColor = Colors.purple;
const Color selectedColor = Colors.blue; const Color selectedColor = Colors.blue;
const Color unselectedColor = Colors.yellow; const Color unselectedColor = Colors.yellow;
const double selectedFontSize = 18.0; const double selectedFontSize = 18.0;
...@@ -509,7 +509,7 @@ void main() { ...@@ -509,7 +509,7 @@ void main() {
MaterialApp( MaterialApp(
theme: ThemeData( theme: ThemeData(
primaryColor: primaryColor, primaryColor: primaryColor,
textTheme: const TextTheme(caption: TextStyle(color: captionColor)), unselectedWidgetColor: unselectedWidgetColor,
), ),
home: Scaffold( home: Scaffold(
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: BottomNavigationBar(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment