[Material] Remove inherit: false on default TextStyle in bottom navigation bar (#32727)
This commit is contained in:
parent
30fed3a05d
commit
da0a3a275a
@ -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;
|
||||
}
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user