Skip to content

RangeSlider dragged cursor is not visible if onChangeStart and onChangeEnd are not set. #179987

Closed

Description

@ksokolovskyi

Steps to reproduce

  1. Run the sample app from this issue
  2. Try to drag any handle and observe that the dragged cursor is not visible
  3. Uncomment onChangeStart and onChangeEnd callbacks
  4. Try to drag any handle again. The dragged cursor is now visible

Expected results

The dragged cursor appears no matter whether onChangeStart and onChangeEnd are set to be consistent with the Slider implementation.

after.mov

Actual results

The dragged cursor does not appear if onChangeStart and onChangeEnd are not set.

before.mov

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: _Slider(),
        ),
      ),
    );
  }
}

class _Slider extends StatefulWidget {
  const _Slider();

  @override
  State<_Slider> createState() => __SliderState();
}

class __SliderState extends State<_Slider> {
  var _values = RangeValues(0.25, 0.75);

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 500,
      height: 100,
      child: Center(
        child: SliderTheme(
          data: SliderThemeData(
            valueIndicatorColor: Colors.red,
            showValueIndicator: ShowValueIndicator.alwaysVisible,
          ),
          child: RangeSlider(
            values: _values,
            onChanged: (values) {
              print('Slider values changed: $values');
              setState(() {
                _values = values;
              });
            },
            // Uncomment those two callbacks to make the dragged cursor visible.
            // onChangeStart: (_) {},
            // onChangeEnd: (_) {},
            mouseCursor: WidgetStateMouseCursor.resolveWith((states) {
              if (states.contains(WidgetState.dragged)) {
                return SystemMouseCursors.grabbing;
              }
              return SystemMouseCursors.click;
            }),
          ),
        ),
      ),
    );
  }
}

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.40.0-1.0.pre-225, on macOS 15.6.1 24G90 darwin-arm64, locale en-US) [2.2s]
    • Flutter version 3.40.0-1.0.pre-225 on channel master at /Users/ksokolovskyi/development/flutter_master
    • Upstream repository [email protected]:ksokolovskyi/flutter.git
    • FLUTTER_GIT_URL = [email protected]:ksokolovskyi/flutter.git
    • Framework revision 109b65f0b8 (3 hours ago), 2025-12-17 02:36:19 -0500
    • Engine revision 109b65f0b8
    • Dart version 3.11.0 (build 3.11.0-253.0.dev)
    • DevTools version 2.53.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
      enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [2.1s]
    • Android SDK at /Users/ksokolovskyi/Library/Android/sdk
    • Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • ANDROID_HOME = /Users/ksokolovskyi/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [990ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [7ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (2 available) [9.0s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 15.6.1 24G90 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 143.0.7499.110

[✓] Network resources [1,560ms]
    • All expected network resources are available.

• No issues found!

Activity

  1. self-assigned this
    on Dec 17, 2025
  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-designOwned by Design Languages team
    on Dec 17, 2025
  3. moved this from To do to In progress in Nevercodeon Dec 17, 2025
  4. moved this from In progress to PR submitted in Nevercodeon Dec 17, 2025
  5. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    on Dec 17, 2025
  6. moved this from PR submitted to Done (PR merged) in Nevercodeon Jan 14, 2026
  7. added a commit that references this issue on Jan 14, 2026
    5e417dc
  8. added
    r: fixedIssue is closed as already fixed in a newer version
    on Jan 14, 2026
  9. added a commit that references this issue on Jan 15, 2026
    dc154ac
  10. github-actions commented on Jan 28, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listfound in release: 3.38Found to occur in 3.38found in release: 3.40Found to occur in 3.40frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions