Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
187c89b6
Unverified
Commit
187c89b6
authored
Dec 12, 2019
by
Hans Muller
Committed by
GitHub
Dec 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove accentTextTheme from sliders and chips, tests and docs (#46801)
parent
23b7853d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
13 deletions
+15
-13
chip.dart
packages/flutter/lib/src/material/chip.dart
+2
-1
range_slider.dart
packages/flutter/lib/src/material/range_slider.dart
+3
-2
slider.dart
packages/flutter/lib/src/material/slider.dart
+3
-1
slider_theme.dart
packages/flutter/lib/src/material/slider_theme.dart
+0
-2
chip_theme_test.dart
packages/flutter/test/material/chip_theme_test.dart
+3
-3
slider_theme_test.dart
packages/flutter/test/material/slider_theme_test.dart
+4
-4
No files found.
packages/flutter/lib/src/material/chip.dart
View file @
187c89b6
...
@@ -78,6 +78,8 @@ abstract class ChipAttributes {
...
@@ -78,6 +78,8 @@ abstract class ChipAttributes {
/// The style to be applied to the chip's label.
/// 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],
/// This only has an effect on widgets that respect the [DefaultTextStyle],
/// such as [Text].
/// such as [Text].
///
///
...
@@ -2935,4 +2937,3 @@ bool _tapIsOnDeleteIcon({
...
@@ -2935,4 +2937,3 @@ bool _tapIsOnDeleteIcon({
}
}
return
tapIsOnDeleteIcon
;
return
tapIsOnDeleteIcon
;
}
}
packages/flutter/lib/src/material/range_slider.dart
View file @
187c89b6
...
@@ -273,8 +273,9 @@ class RangeSlider extends StatefulWidget {
...
@@ -273,8 +273,9 @@ class RangeSlider extends StatefulWidget {
/// There are two labels: one for the start thumb and one for the end thumb.
/// There are two labels: one for the start thumb and one for the end thumb.
///
///
/// Each label is rendered using the active [ThemeData]'s
/// Each label is rendered using the active [ThemeData]'s
/// [ThemeData.accentTextTheme.body2] text style, and can be overridden
/// [ThemeData.textTheme.body2] text style, with the
/// by changing the [SliderThemeData.valueIndicatorTextStyle].
/// 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.
/// If null, then the value indicator will not be displayed.
///
///
...
...
packages/flutter/lib/src/material/slider.dart
View file @
187c89b6
...
@@ -302,7 +302,9 @@ class Slider extends StatefulWidget {
...
@@ -302,7 +302,9 @@ class Slider extends StatefulWidget {
/// as part of the value indicator shape.
/// as part of the value indicator shape.
///
///
/// The label is rendered using the active [ThemeData]'s
/// 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.
/// If null, then the value indicator will not be displayed.
///
///
...
...
packages/flutter/lib/src/material/slider_theme.dart
View file @
187c89b6
...
@@ -615,8 +615,6 @@ class SliderThemeData extends Diagnosticable {
...
@@ -615,8 +615,6 @@ class SliderThemeData extends Diagnosticable {
final
ShowValueIndicator
showValueIndicator
;
final
ShowValueIndicator
showValueIndicator
;
/// The text style for the text on the value indicator.
/// The text style for the text on the value indicator.
///
/// By default this is the [ThemeData.accentTextTheme.body2] text theme.
final
TextStyle
valueIndicatorTextStyle
;
final
TextStyle
valueIndicatorTextStyle
;
/// Limits the thumb's separation distance.
/// Limits the thumb's separation distance.
...
...
packages/flutter/test/material/chip_theme_test.dart
View file @
187c89b6
...
@@ -169,7 +169,7 @@ void main() {
...
@@ -169,7 +169,7 @@ void main() {
testWidgets
(
'ChipThemeData generates correct opacities for defaults'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'ChipThemeData generates correct opacities for defaults'
,
(
WidgetTester
tester
)
async
{
const
Color
customColor1
=
Color
(
0xcafefeed
);
const
Color
customColor1
=
Color
(
0xcafefeed
);
const
Color
customColor2
=
Color
(
0xdeadbeef
);
const
Color
customColor2
=
Color
(
0xdeadbeef
);
final
TextStyle
customStyle
=
ThemeData
.
fallback
().
accentT
extTheme
.
body2
.
copyWith
(
color:
customColor2
);
final
TextStyle
customStyle
=
ThemeData
.
fallback
().
t
extTheme
.
body2
.
copyWith
(
color:
customColor2
);
final
ChipThemeData
lightTheme
=
ChipThemeData
.
fromDefaults
(
final
ChipThemeData
lightTheme
=
ChipThemeData
.
fromDefaults
(
secondaryColor:
customColor1
,
secondaryColor:
customColor1
,
...
@@ -230,7 +230,7 @@ void main() {
...
@@ -230,7 +230,7 @@ void main() {
final
ChipThemeData
chipThemeBlack
=
ChipThemeData
.
fromDefaults
(
final
ChipThemeData
chipThemeBlack
=
ChipThemeData
.
fromDefaults
(
secondaryColor:
Colors
.
black
,
secondaryColor:
Colors
.
black
,
brightness:
Brightness
.
dark
,
brightness:
Brightness
.
dark
,
labelStyle:
ThemeData
.
fallback
().
accentT
extTheme
.
body2
.
copyWith
(
color:
Colors
.
black
),
labelStyle:
ThemeData
.
fallback
().
t
extTheme
.
body2
.
copyWith
(
color:
Colors
.
black
),
).
copyWith
(
).
copyWith
(
elevation:
1.0
,
elevation:
1.0
,
pressElevation:
4.0
,
pressElevation:
4.0
,
...
@@ -241,7 +241,7 @@ void main() {
...
@@ -241,7 +241,7 @@ void main() {
final
ChipThemeData
chipThemeWhite
=
ChipThemeData
.
fromDefaults
(
final
ChipThemeData
chipThemeWhite
=
ChipThemeData
.
fromDefaults
(
secondaryColor:
Colors
.
white
,
secondaryColor:
Colors
.
white
,
brightness:
Brightness
.
light
,
brightness:
Brightness
.
light
,
labelStyle:
ThemeData
.
fallback
().
accentT
extTheme
.
body2
.
copyWith
(
color:
Colors
.
white
),
labelStyle:
ThemeData
.
fallback
().
t
extTheme
.
body2
.
copyWith
(
color:
Colors
.
white
),
).
copyWith
(
).
copyWith
(
padding:
const
EdgeInsets
.
all
(
2.0
),
padding:
const
EdgeInsets
.
all
(
2.0
),
labelPadding:
const
EdgeInsets
.
only
(
top:
8.0
,
bottom:
8.0
),
labelPadding:
const
EdgeInsets
.
only
(
top:
8.0
,
bottom:
8.0
),
...
...
packages/flutter/test/material/slider_theme_test.dart
View file @
187c89b6
...
@@ -144,7 +144,7 @@ void main() {
...
@@ -144,7 +144,7 @@ void main() {
primaryColor:
customColor1
,
primaryColor:
customColor1
,
primaryColorDark:
customColor2
,
primaryColorDark:
customColor2
,
primaryColorLight:
customColor3
,
primaryColorLight:
customColor3
,
valueIndicatorTextStyle:
ThemeData
.
fallback
().
accentT
extTheme
.
body2
.
copyWith
(
color:
customColor4
),
valueIndicatorTextStyle:
ThemeData
.
fallback
().
t
extTheme
.
body2
.
copyWith
(
color:
customColor4
),
);
);
expect
(
sliderTheme
.
activeTrackColor
,
equals
(
customColor1
.
withAlpha
(
0xff
)));
expect
(
sliderTheme
.
activeTrackColor
,
equals
(
customColor1
.
withAlpha
(
0xff
)));
...
@@ -172,7 +172,7 @@ void main() {
...
@@ -172,7 +172,7 @@ void main() {
primaryColor:
customColor1
,
primaryColor:
customColor1
,
primaryColorDark:
customColor2
,
primaryColorDark:
customColor2
,
primaryColorLight:
customColor3
,
primaryColorLight:
customColor3
,
valueIndicatorTextStyle:
ThemeData
.
fallback
().
accentT
extTheme
.
body2
.
copyWith
(
color:
customColor4
),
valueIndicatorTextStyle:
ThemeData
.
fallback
().
t
extTheme
.
body2
.
copyWith
(
color:
customColor4
),
);
);
expect
(
sliderTheme
.
overlayShape
,
const
RoundSliderOverlayShape
());
expect
(
sliderTheme
.
overlayShape
,
const
RoundSliderOverlayShape
());
...
@@ -191,13 +191,13 @@ void main() {
...
@@ -191,13 +191,13 @@ void main() {
primaryColor:
Colors
.
black
,
primaryColor:
Colors
.
black
,
primaryColorDark:
Colors
.
black
,
primaryColorDark:
Colors
.
black
,
primaryColorLight:
Colors
.
black
,
primaryColorLight:
Colors
.
black
,
valueIndicatorTextStyle:
ThemeData
.
fallback
().
accentT
extTheme
.
body2
.
copyWith
(
color:
Colors
.
black
),
valueIndicatorTextStyle:
ThemeData
.
fallback
().
t
extTheme
.
body2
.
copyWith
(
color:
Colors
.
black
),
).
copyWith
(
trackHeight:
2.0
);
).
copyWith
(
trackHeight:
2.0
);
final
SliderThemeData
sliderThemeWhite
=
SliderThemeData
.
fromPrimaryColors
(
final
SliderThemeData
sliderThemeWhite
=
SliderThemeData
.
fromPrimaryColors
(
primaryColor:
Colors
.
white
,
primaryColor:
Colors
.
white
,
primaryColorDark:
Colors
.
white
,
primaryColorDark:
Colors
.
white
,
primaryColorLight:
Colors
.
white
,
primaryColorLight:
Colors
.
white
,
valueIndicatorTextStyle:
ThemeData
.
fallback
().
accentT
extTheme
.
body2
.
copyWith
(
color:
Colors
.
white
),
valueIndicatorTextStyle:
ThemeData
.
fallback
().
t
extTheme
.
body2
.
copyWith
(
color:
Colors
.
white
),
).
copyWith
(
trackHeight:
6.0
);
).
copyWith
(
trackHeight:
6.0
);
final
SliderThemeData
lerp
=
SliderThemeData
.
lerp
(
sliderThemeBlack
,
sliderThemeWhite
,
0.5
);
final
SliderThemeData
lerp
=
SliderThemeData
.
lerp
(
sliderThemeBlack
,
sliderThemeWhite
,
0.5
);
const
Color
middleGrey
=
Color
(
0xff7f7f7f
);
const
Color
middleGrey
=
Color
(
0xff7f7f7f
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment