From da0a3a275aaf30becb0c74a2375c4532d685dbe4 Mon Sep 17 00:00:00 2001 From: MH Johnson <johnsonmh@users.noreply.github.com> Date: Wed, 15 May 2019 10:30:41 -0400 Subject: [PATCH] [Material] Remove inherit: false on default TextStyle in bottom navigation bar (#32727) --- packages/flutter/lib/src/material/bottom_navigation_bar.dart | 2 +- .../flutter/test/material/bottom_navigation_bar_test.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index 5046fa34aa..7ab9acdff9 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -778,7 +778,7 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr // If the given [TextStyle] has a non-null `fontSize`, it should be used. // Otherwise, the [selectedFontSize] parameter should be used. static TextStyle _effectiveTextStyle(TextStyle textStyle, double fontSize) { - textStyle ??= const TextStyle(inherit: false); + textStyle ??= const TextStyle(); // Prefer the font size on textStyle if present. return textStyle.fontSize == null ? textStyle.copyWith(fontSize: fontSize) : textStyle; } diff --git a/packages/flutter/test/material/bottom_navigation_bar_test.dart b/packages/flutter/test/material/bottom_navigation_bar_test.dart index a17635c317..1f256cd68d 100644 --- a/packages/flutter/test/material/bottom_navigation_bar_test.dart +++ b/packages/flutter/test/material/bottom_navigation_bar_test.dart @@ -106,10 +106,10 @@ void main() { final TextStyle unselectedIcon = _iconStyle(tester, Icons.access_alarm); expect(selectedFontStyle.color, equals(primaryColor)); expect(selectedFontStyle.fontSize, selectedFontSize); - expect(selectedFontStyle.fontWeight, isNull); + expect(selectedFontStyle.fontWeight, equals(FontWeight.w400)); expect(selectedFontStyle.height, isNull); expect(unselectedFontStyle.color, equals(captionColor)); - expect(unselectedFontStyle.fontWeight, isNull); + expect(unselectedFontStyle.fontWeight, equals(FontWeight.w400)); expect(unselectedFontStyle.height, isNull); // Unselected label has a font size of 14 but is scaled down to be font size 12. expect( -- 2.21.0