[Material] Unit test for skipping Slider tick mark due to overdensity#28013
[Material] Unit test for skipping Slider tick mark due to overdensity#28013clocksmith merged 16 commits intoflutter:masterfrom
Conversation
HansMuller
left a comment
There was a problem hiding this comment.
Looks good, just some small stuff
|
|
||
| Widget buildSlider({ | ||
| int divisions, | ||
| TextDirection textDirection, |
There was a problem hiding this comment.
This parameter isn't needed
| max: 100.0, | ||
| divisions: divisions, | ||
| value: value, | ||
| onChanged: (double newValue) { |
There was a problem hiding this comment.
Simplify for this test, since we're not moving the slider:
onChanged: (double value) { },
| }); | ||
|
|
||
| testWidgets('Tick marks are skipped when they are too dense', (WidgetTester tester) async { | ||
| double value = 25.0; |
There was a problem hiding this comment.
Not needed for this test
| ), | ||
| ); | ||
|
|
||
| // No tick marks because they are too dense, just a thumb. |
There was a problem hiding this comment.
The failure mode we've seen has divisions = max - min (100). Would be best to duplicate that here to make sure we're not regressing a case that we've seen fail. We can assume that if 100 is too dense 500 will be too :-)
There was a problem hiding this comment.
Done and added comment
| }) { | ||
| return Directionality( | ||
| textDirection: textDirection, | ||
| child: StatefulBuilder( |
There was a problem hiding this comment.
Don't need a StatefulBuilder, since we don't actually need to maintain the slider's value.
…er-tick-density-fix
…th/flutter into slider-tick-density-fix
…th/flutter into slider-tick-density-fix
Adding a unit test for skipping over dense tick marks and updating the previous hot fix with better style.