Skip to content

Add showValueIndicator to Slider widget. #179660

@ksokolovskyi

Description

@ksokolovskyi

Use case

It is possible to set the conditions under which the value indicator on a Slider will be shown by setting showValueIndicator in SliderTheme. However, Slider itself is lacking the showValueIndicator property.

When a user wants to override the showValueIndicator for a specific Slider, they have to wrap it into SliderTheme to achieve the desired behavior.

SliderTheme(
  data: SliderThemeData(
    showValueIndicator: ShowValueIndicator.alwaysVisible,
  ),
  child: Slider(
    value: 0.5,
    label: '0.5',
    onChanged: (double value) {},
  ),
),

Proposal

Add Slider.showValueIndicator property to allow user to set the conditions under which the value indicator will be shown for a specific Slider.

Slider(
  value: 0.5,
  label: '0.5',
  onChanged: (double value) {},
  mouseCursor: SystemMouseCursors.click,
  showValueIndicator: ShowValueIndicator.alwaysVisible,
)

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: solvedIssue is closed as solvedteam-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