File tree Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -900,8 +900,8 @@ class _RenderRangeSlider extends RenderBox with RelayoutWhenSystemFontsChangeMix
900
900
late TapGestureRecognizer _tap;
901
901
bool _active = false ;
902
902
late RangeValues _newValues;
903
- late Offset _startThumbCenter;
904
- late Offset _endThumbCenter;
903
+ Offset _startThumbCenter = Offset .zero ;
904
+ Offset _endThumbCenter = Offset .zero ;
905
905
Rect ? overlayStartRect;
906
906
Rect ? overlayEndRect;
907
907
Original file line number Diff line number Diff line change @@ -2541,7 +2541,7 @@ void main() {
2541
2541
);
2542
2542
});
2543
2543
2544
- testWidgetsWithLeakTracking ('RangeSlider onChangeStart and onChangeEnd fire once' , (WidgetTester tester) async {
2544
+ testWidgetsWithLeakTracking ('RangeSlider onChangeStart and onChangeEnd fire once' , (WidgetTester tester) async {
2545
2545
// Regression test for https://github.com/flutter/flutter/issues/128433
2546
2546
2547
2547
int startFired = 0 ;
@@ -2581,4 +2581,34 @@ void main() {
2581
2581
expect (startFired, equals (1 ));
2582
2582
expect (endFired, equals (1 ));
2583
2583
});
2584
+
2585
+ testWidgetsWithLeakTracking ('RangeSlider in a ListView does not throw an exception' , (WidgetTester tester) async {
2586
+ // Regression test for https://github.com/flutter/flutter/issues/126648
2587
+
2588
+ await tester.pumpWidget (
2589
+ MaterialApp (
2590
+ home: Directionality (
2591
+ textDirection: TextDirection .ltr,
2592
+ child: Material (
2593
+ child: ListView (
2594
+ children: < Widget > [
2595
+ const SizedBox (
2596
+ height: 600 ,
2597
+ child: Placeholder (),
2598
+ ),
2599
+ RangeSlider (
2600
+ values: const RangeValues (40 , 80 ),
2601
+ max: 100 ,
2602
+ onChanged: (RangeValues newValue) { },
2603
+ ),
2604
+ ],
2605
+ ),
2606
+ ),
2607
+ ),
2608
+ ),
2609
+ );
2610
+
2611
+ // No exception should be thrown.
2612
+ expect (tester.takeException (), null );
2613
+ });
2584
2614
}
You can’t perform that action at this time.
0 commit comments