diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index e79bed79bd..3e7c93b84b 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -78,6 +78,8 @@ abstract class ChipAttributes { /// The style to be applied to the chip's label. /// + /// If null, the value of the [ChipTheme]'s [ChipThemeData.labelStyle] is used. + // /// This only has an effect on widgets that respect the [DefaultTextStyle], /// such as [Text]. /// @@ -2935,4 +2937,3 @@ bool _tapIsOnDeleteIcon({ } return tapIsOnDeleteIcon; } - diff --git a/packages/flutter/lib/src/material/range_slider.dart b/packages/flutter/lib/src/material/range_slider.dart index 65fa9a29bf..af65f33a10 100644 --- a/packages/flutter/lib/src/material/range_slider.dart +++ b/packages/flutter/lib/src/material/range_slider.dart @@ -273,8 +273,9 @@ class RangeSlider extends StatefulWidget { /// There are two labels: one for the start thumb and one for the end thumb. /// /// Each label is rendered using the active [ThemeData]'s - /// [ThemeData.accentTextTheme.body2] text style, and can be overridden - /// by changing the [SliderThemeData.valueIndicatorTextStyle]. + /// [ThemeData.textTheme.body2] text style, with the + /// theme data's [ThemeData.colorScheme.onPrimaryColor]. The label's text + /// style can be overridden with [SliderThemeData.valueIndicatorTextStyle]. /// /// If null, then the value indicator will not be displayed. /// diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index 9c65b89494..1a805f86b9 100644 --- a/packages/flutter/lib/src/material/slider.dart +++ b/packages/flutter/lib/src/material/slider.dart @@ -302,7 +302,9 @@ class Slider extends StatefulWidget { /// as part of the value indicator shape. /// /// The label is rendered using the active [ThemeData]'s - /// [ThemeData.accentTextTheme.body2] text style. + /// [ThemeData.textTheme.body2] text style, with the + /// theme data's [ThemeData.colorScheme.onPrimaryColor]. The label's text style + /// can be overridden with [SliderThemeData.valueIndicatorTextStyle]. /// /// If null, then the value indicator will not be displayed. /// diff --git a/packages/flutter/lib/src/material/slider_theme.dart b/packages/flutter/lib/src/material/slider_theme.dart index 5a838a33a0..3c573aae83 100644 --- a/packages/flutter/lib/src/material/slider_theme.dart +++ b/packages/flutter/lib/src/material/slider_theme.dart @@ -615,8 +615,6 @@ class SliderThemeData extends Diagnosticable { final ShowValueIndicator showValueIndicator; /// The text style for the text on the value indicator. - /// - /// By default this is the [ThemeData.accentTextTheme.body2] text theme. final TextStyle valueIndicatorTextStyle; /// Limits the thumb's separation distance. diff --git a/packages/flutter/test/material/chip_theme_test.dart b/packages/flutter/test/material/chip_theme_test.dart index 5e97fbfaa2..6c25700f65 100644 --- a/packages/flutter/test/material/chip_theme_test.dart +++ b/packages/flutter/test/material/chip_theme_test.dart @@ -169,7 +169,7 @@ void main() { testWidgets('ChipThemeData generates correct opacities for defaults', (WidgetTester tester) async { const Color customColor1 = Color(0xcafefeed); const Color customColor2 = Color(0xdeadbeef); - final TextStyle customStyle = ThemeData.fallback().accentTextTheme.body2.copyWith(color: customColor2); + final TextStyle customStyle = ThemeData.fallback().textTheme.body2.copyWith(color: customColor2); final ChipThemeData lightTheme = ChipThemeData.fromDefaults( secondaryColor: customColor1, @@ -230,7 +230,7 @@ void main() { final ChipThemeData chipThemeBlack = ChipThemeData.fromDefaults( secondaryColor: Colors.black, brightness: Brightness.dark, - labelStyle: ThemeData.fallback().accentTextTheme.body2.copyWith(color: Colors.black), + labelStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.black), ).copyWith( elevation: 1.0, pressElevation: 4.0, @@ -241,7 +241,7 @@ void main() { final ChipThemeData chipThemeWhite = ChipThemeData.fromDefaults( secondaryColor: Colors.white, brightness: Brightness.light, - labelStyle: ThemeData.fallback().accentTextTheme.body2.copyWith(color: Colors.white), + labelStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.white), ).copyWith( padding: const EdgeInsets.all(2.0), labelPadding: const EdgeInsets.only(top: 8.0, bottom: 8.0), diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index 19e6475ab6..d706057401 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -144,7 +144,7 @@ void main() { primaryColor: customColor1, primaryColorDark: customColor2, primaryColorLight: customColor3, - valueIndicatorTextStyle: ThemeData.fallback().accentTextTheme.body2.copyWith(color: customColor4), + valueIndicatorTextStyle: ThemeData.fallback().textTheme.body2.copyWith(color: customColor4), ); expect(sliderTheme.activeTrackColor, equals(customColor1.withAlpha(0xff))); @@ -172,7 +172,7 @@ void main() { primaryColor: customColor1, primaryColorDark: customColor2, primaryColorLight: customColor3, - valueIndicatorTextStyle: ThemeData.fallback().accentTextTheme.body2.copyWith(color: customColor4), + valueIndicatorTextStyle: ThemeData.fallback().textTheme.body2.copyWith(color: customColor4), ); expect(sliderTheme.overlayShape, const RoundSliderOverlayShape()); @@ -191,13 +191,13 @@ void main() { primaryColor: Colors.black, primaryColorDark: Colors.black, primaryColorLight: Colors.black, - valueIndicatorTextStyle: ThemeData.fallback().accentTextTheme.body2.copyWith(color: Colors.black), + valueIndicatorTextStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.black), ).copyWith(trackHeight: 2.0); final SliderThemeData sliderThemeWhite = SliderThemeData.fromPrimaryColors( primaryColor: Colors.white, primaryColorDark: Colors.white, primaryColorLight: Colors.white, - valueIndicatorTextStyle: ThemeData.fallback().accentTextTheme.body2.copyWith(color: Colors.white), + valueIndicatorTextStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.white), ).copyWith(trackHeight: 6.0); final SliderThemeData lerp = SliderThemeData.lerp(sliderThemeBlack, sliderThemeWhite, 0.5); const Color middleGrey = Color(0xff7f7f7f);