flutter / flutter/flutter

[material_ui] Default `year2023` to `false` for Slider, RangeSlider and the progress indicators

Open
#192,729 1 comment 0 reactions 0 assignees View on GitHub
c: proposal p: material_ui package team-design
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Use case

Every `year2023` flag in `material_ui` is deprecated with the same promise:

> Set this flag to false to opt into the 2024 … appearance. Defaults to true. **In the future, this flag will default to false.**

The flags were introduced in late 2024 (#159720, #159721, with the visual updates in #154817, #152237, #158104 and #163736) and deprecated after `v3.27.0-0.1.pre` (`RangeSlider`: `v3.30.0-0.1.pre`). `material_ui` 1.2.0 still carries all of them with the original default:

| file (`material_ui` 1.2.0) | line | code |
|---|---|---|
| `slider.dart` | 862 | `widget.year2023 ?? sliderTheme.year2023 ?? true` |
| `range_slider.dart` | 709 | `widget.year2023 ?? sliderTheme.year2023 ?? true` |
| `progress_indicator.dart` (`LinearProgressIndicator`) | 607 | `widget.year2023 ?? indicatorTheme.year2023 ?? true` |
| `progress_indicator.dart` (`CircularProgressIndicator`) | 1160 | `widget.year2023 ?? indicatorTheme.year2023 ?? true` |
| `progress_indicator.dart` (`_CircularProgressIndicatorPainter`) | 690 | `this.year2023 = true` |

Now that the in-SDK Material library is [frozen to contributions](https://github.com/flutter/flutter/issues/184093), `material_ui` is the only place the promised flip can still happen — and until it does, the flags can never complete their deprecation: removing them while the default is `true` would lock in the 2023 appearance the deprecation is steering away from.

In the meantime, every app that wants the current Material 3 appearance has to set a deprecated flag to get it. We set `year2023: false` in the themes of three apps for exactly that reason, and the line can only be deleted once the default changes.

The 2024 appearance looks ready to be the default. The one crash reported for `year2023: false` with an indeterminate `CircularProgressIndicator` (#163253) was fixed in #163356, and that fix is present in `material_ui` 1.2.0 (`progress_indicator.dart:743`, where every `value!` in the track-gap path sits behind a null check).

### Proposal

1. Change the five defaults above from `true` to `false`.
2. Ship it as a breaking change in the next major version of `material_ui`, with a migration note: apps that want to keep the 2023 appearance set `year2023: true` on the widget or its theme (`SliderThemeData` / `ProgressIndicatorThemeData`) until they have migrated.
3. After that release, the flags can go through normal deprecation removal like any other deprecated API.

Flipping the default is a visual change, not an API removal, which is presumably why the deprecation period alone never resolved it — a major version of the new package seems like the natural boundary to do it at.

Contributor guide

Open the contributing guide

Research direction

Review slider.dart, range_slider.dart, and progress_indicator.dart at the listed default expressions and painter initializer. Change the five year2023 defaults to false, add the proposed migration note for retaining the 2023 appearance, and verify that all listed defaults are updated for the next major release.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.