Unverified Commit d14a301e authored by Jose Alba's avatar Jose Alba Committed by GitHub

Revert "[Slider] Rebase. (#52663)" (#53698)

This reverts commit e71cf1cd.
parent ad07c404
...@@ -69,7 +69,6 @@ class _CustomRangeThumbShape extends RangeSliderThumbShape { ...@@ -69,7 +69,6 @@ class _CustomRangeThumbShape extends RangeSliderThumbShape {
@required SliderThemeData sliderTheme, @required SliderThemeData sliderTheme,
TextDirection textDirection, TextDirection textDirection,
Thumb thumb, Thumb thumb,
bool isPressed,
}) { }) {
final Canvas canvas = context.canvas; final Canvas canvas = context.canvas;
final ColorTween colorTween = ColorTween( final ColorTween colorTween = ColorTween(
...@@ -131,8 +130,6 @@ class _CustomThumbShape extends SliderComponentShape { ...@@ -131,8 +130,6 @@ class _CustomThumbShape extends SliderComponentShape {
SliderThemeData sliderTheme, SliderThemeData sliderTheme,
TextDirection textDirection, TextDirection textDirection,
double value, double value,
double textScaleFactor,
Size sizeWithOverflow,
}) { }) {
final Canvas canvas = context.canvas; final Canvas canvas = context.canvas;
final ColorTween colorTween = ColorTween( final ColorTween colorTween = ColorTween(
...@@ -172,8 +169,6 @@ class _CustomValueIndicatorShape extends SliderComponentShape { ...@@ -172,8 +169,6 @@ class _CustomValueIndicatorShape extends SliderComponentShape {
SliderThemeData sliderTheme, SliderThemeData sliderTheme,
TextDirection textDirection, TextDirection textDirection,
double value, double value,
double textScaleFactor,
Size sizeWithOverflow,
}) { }) {
final Canvas canvas = context.canvas; final Canvas canvas = context.canvas;
final ColorTween enableColor = ColorTween( final ColorTween enableColor = ColorTween(
...@@ -273,21 +268,15 @@ class _SlidersState extends State<_Sliders> { ...@@ -273,21 +268,15 @@ class _SlidersState extends State<_Sliders> {
), ),
), ),
), ),
SliderTheme( Slider.adaptive(
data: const SliderThemeData( value: _continuousValue,
showValueIndicator: ShowValueIndicator.always, min: 0.0,
), max: 100.0,
child: Slider.adaptive( onChanged: (double value) {
label: _continuousValue.toStringAsFixed(6).toString(), setState(() {
value: _continuousValue, _continuousValue = value;
min: 0.0, });
max: 100.0, },
onChanged: (double value) {
setState(() {
_continuousValue = value;
});
},
),
), ),
const Text('Continuous with Editable Numerical Value'), const Text('Continuous with Editable Numerical Value'),
], ],
...@@ -325,7 +314,7 @@ class _SlidersState extends State<_Sliders> { ...@@ -325,7 +314,7 @@ class _SlidersState extends State<_Sliders> {
activeTrackColor: Colors.deepPurple, activeTrackColor: Colors.deepPurple,
inactiveTrackColor: theme.colorScheme.onSurface.withOpacity(0.5), inactiveTrackColor: theme.colorScheme.onSurface.withOpacity(0.5),
activeTickMarkColor: theme.colorScheme.onSurface.withOpacity(0.7), activeTickMarkColor: theme.colorScheme.onSurface.withOpacity(0.7),
inactiveTickMarkColor: theme.colorScheme.surface.withOpacity(0.7), inactiveTickMarkColor: theme.colorScheme.surface.withOpacity(0.7),
overlayColor: theme.colorScheme.onSurface.withOpacity(0.12), overlayColor: theme.colorScheme.onSurface.withOpacity(0.12),
thumbColor: Colors.deepPurple, thumbColor: Colors.deepPurple,
valueIndicatorColor: Colors.deepPurpleAccent, valueIndicatorColor: Colors.deepPurpleAccent,
......
...@@ -21,12 +21,10 @@ ThemeData _buildDarkTheme() { ...@@ -21,12 +21,10 @@ ThemeData _buildDarkTheme() {
final ColorScheme colorScheme = const ColorScheme.dark().copyWith( final ColorScheme colorScheme = const ColorScheme.dark().copyWith(
primary: primaryColor, primary: primaryColor,
secondary: secondaryColor, secondary: secondaryColor,
onPrimary: secondaryColor,
); );
final ThemeData base = ThemeData( final ThemeData base = ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
accentColorBrightness: Brightness.dark, accentColorBrightness: Brightness.dark,
colorScheme: colorScheme,
primaryColor: primaryColor, primaryColor: primaryColor,
primaryColorDark: const Color(0xFF0050a0), primaryColorDark: const Color(0xFF0050a0),
primaryColorLight: secondaryColor, primaryColorLight: secondaryColor,
......
...@@ -169,10 +169,7 @@ void main() { ...@@ -169,10 +169,7 @@ void main() {
(ByteData data) { }, (ByteData data) { },
); );
final RenderObject renderObject = tester.renderObject(find.byType(RangeSlider)); final RenderObject renderObject = tester.renderObject(find.byType(RangeSlider));
expect(renderObject.debugNeedsLayout, isTrue);
bool sliderBoxNeedsLayout;
renderObject.visitChildren((RenderObject child) {sliderBoxNeedsLayout = child.debugNeedsLayout;});
expect(sliderBoxNeedsLayout, isTrue);
}); });
testWidgets('Slider relayout upon system fonts changes', (WidgetTester tester) async { testWidgets('Slider relayout upon system fonts changes', (WidgetTester tester) async {
...@@ -194,11 +191,8 @@ void main() { ...@@ -194,11 +191,8 @@ void main() {
SystemChannels.system.codec.encodeMessage(data), SystemChannels.system.codec.encodeMessage(data),
(ByteData data) { }, (ByteData data) { },
); );
final RenderObject renderObject = tester.renderObject(find.byType(Slider)); final RenderObject renderObject = tester.renderObject(find.byType(Slider));
expect(renderObject.debugNeedsLayout, isTrue);
bool sliderBoxNeedsLayout;
renderObject.visitChildren((RenderObject child) {sliderBoxNeedsLayout = child.debugNeedsLayout;});
expect(sliderBoxNeedsLayout, isTrue);
}); });
testWidgets('TimePicker relayout upon system fonts changes', (WidgetTester tester) async { testWidgets('TimePicker relayout upon system fonts changes', (WidgetTester tester) async {
......
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