-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
found in release: 3.30Found to occur in 3.30Found to occur in 3.30frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework team
Description
Steps to reproduce
- Create a
Sliderwith zerosecondaryTrackValueand any button. - Schedule updating the value of
secondaryTrackValueand don't touch the screen until updating fires.
Expected results
- The slider repaints.
Actual results
- The slider doesn't show the new
secondaryTrackValue. - Hover the button and see repainting of the slider.
The setter _RenderSlider.secondaryTrackValue should call markNeedsPaint instead of markNeedsSemanticsUpdate.
Code sample
Code sample
import 'package:flutter/material.dart';
/// Flutter code sample for [Slider].
void main() => runApp(const SliderApp());
class SliderApp extends StatelessWidget {
const SliderApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(home: SliderExample());
}
}
class SliderExample extends StatefulWidget {
const SliderExample({super.key});
@override
State<SliderExample> createState() => _SliderExampleState();
}
class _SliderExampleState extends State<SliderExample> {
double _currentSliderPrimaryValue = 0.0;
double _currentSliderSecondaryValue = 0.0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Slider')),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Slider(
value: _currentSliderPrimaryValue,
secondaryTrackValue: _currentSliderSecondaryValue,
label: _currentSliderPrimaryValue.round().toString(),
onChanged: (double value) {
setState(() {
_currentSliderPrimaryValue = value;
});
},
),
ElevatedButton(
onPressed: () {
Future.delayed(const Duration(seconds: 1), () {
setState(() => _currentSliderSecondaryValue = 0.2);
});
},
child: Text('Update secondary value'),
),
],
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
2025-02-23.23.59.39.mov
Logs
No response
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.4, on macOS 14.6.1 23G93 darwin-x64, locale ru-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.94.2)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!antoniosb8891
Metadata
Metadata
Assignees
Labels
found in release: 3.30Found to occur in 3.30Found to occur in 3.30frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework team