Skip to content

Slider.label documentation should be clearer about behavior with continuous sliders #74098

Closed
flutter/packages
#13121

Description

@jamesderlin

The documentation for Slider.label says:

A label to show above the slider when the slider is active.

It is used to display the value of a discrete slider, and it is displayed as part of the value indicator shape.

While it says that the label is used with discrete sliders, it doesn't actually say anything about continuous sliders. The implication from omission is that labels won't be shown for continuous sliders (which I verified is the case), but it would be much clearer to explicitly say so, in the same way that the documentation later says:

Ignored if this slider is created with Slider.adaptive.

Also, why is the label limited only to discrete sliders anyway?

Activity

  1. added
    d: api docsIssues with https://api.flutter.dev/
    on Jan 16, 2021
  2. jamesderlin commented on Jan 16, 2021

    @jamesderlin
    ContributorAuthor

    Okay, looking at the code, I see that by default, the label is shown only for discrete sliders, but labels can be enabled for continuous sliders by setting SliderThemeData.showValueIndicator in a parent SliderTheme widget.

    Showing labels only for discrete sliders still seems like a weird default, and the documentation still should be updated to mention SliderThemeData.showValueIndicator.

  3. HansMuller commented on Jan 19, 2021

    @HansMuller
    Contributor
  4. self-assigned this
    on May 4, 2023
  5. removed their assignment
    on Jun 19, 2023
  6. added
    P2Important issues not at the top of the work list
    on Apr 22, 2025
  7. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  8. added a commit that references this issue on Oct 13, 2026
    a1ed23c
  9. github-actions commented on Oct 27, 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/p: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions