Repository navigation
Fix stale ignore: prefer_const_constructors from flutter/packages #128141
Description
Activity
- addedc: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.packageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.c: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.
on Jun 2, 2023 We have some ignores in flutter/packages related to making classes const which can now be cleaned up. They can be found by searching for:
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.(In some cases we may need to update minimum Flutter versions in packages while changing this.)
Hey, I have searched for the specific comment mentioned in the issue description,
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later, but I couldn't locate it in the codebase.However I managed to find many instances of :
// ignore: prefer_const_constructorsand// ignore: prefer_const_constructors_in_immutablesin flutter/packages and I think these statements are stale and can be cleaned up right, can you verify ?Hey, I have searched for the specific comment mentioned in the issue description,
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later, but I couldn't locate it in the codebase.There are many occurrences.
However I managed to find many instances of :
// ignore: prefer_const_constructorsand// ignore: prefer_const_constructors_in_immutablesin flutter/packages and I think these statements are stale and can be cleaned up right, can you verify ?It depends on when and why they were added. You're welcome to investigate them on a case by case basis if you want to, but that's not what this issue is about. This is about the specific case described here.
Hey, I have searched for the specific comment mentioned in the issue description,
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later, but I couldn't locate it in the codebase.There are many occurrences.
However I managed to find many instances of :
// ignore: prefer_const_constructorsand// ignore: prefer_const_constructors_in_immutablesin flutter/packages and I think these statements are stale and can be cleaned up right, can you verify ?It depends on when and why they were added. You're welcome to investigate them on a case by case basis if you want to, but that's not what this issue is about. This is about the specific case described here.
Now I get it , I was searching for it in the wrong place got confused , now I have found all of the instances of
ignore: prefer_const_constructorsin the packages repository, Thank you for clarifying!!We have some ignores in flutter/packages related to making classes const which can now be cleaned up. They can be found by searching for:
// TODO(goderbauer): Make this const when this package requires Flutter 3.8 or later.so just
ignore: prefer_const_constructorsneeds to be removed or//Todo's also ?(In some cases we may need to update minimum Flutter versions in packages while changing this.)
can you elaborate regarding updating Flutter versions?
Like the comment mentions, do we add the const to the widget the
ignore: prefer_const_constructoris on?- changed the title
[-]Remove stale `ignore: prefer_const_constructors` from flutter/packages[/-][+]Fix stale `ignore: prefer_const_constructors` from flutter/packages[/+]on Jun 6, 2023 I have updated the issue description to clarify what this involves.
A PR that removes the
ignores without addressing the TODO won't pass analysis, and thus won't pass our CI.Thanks for the clarification
- addedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Jun 6, 2023 - added a commit that references this issue
on Jun 8, 2023 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 -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Jun 22, 2023 - added a commit that references this issue
on May 24, 2025 - added a commit that references this issue
on Jun 10, 2026 - added a commit that references this issue
on Jun 19, 2026
We have some TODOs related to ignores in flutter/packages related to making classes const which can now be cleaned up by addressing the TODO (adding
const, and removing theignore). They can be found by searching for:Any package we make this change in will need to be updated to have a minimum Flutter version of 3.10 (the first stable after 3.8, where the constructors became const).