-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lint] prefer_final_locals quick-fix #51721
Comments
Thanks for filing an issue, can you provide a small reproduction of code for which you wish to have the quick fix, but it isn't offered? Thanks! |
Hi @srawlins, ...everywhere ? It was working fine, I've been adding final everywhere it was recommended thanks to this quick-fix. example: @override
Widget build(BuildContext context) {
List<Widget> modalTiles = [];
Job job = state.lstJobs!.elementAt(index);
Size screenSize = MediaQuery.of(context).size;-
MyColors myColors = Theme.of(context).extension<MyColors>()!;
//...
|
Thanks for the bug report and the repro! |
Do you expect to keep type annotations, but append void f() {
int v = 0;
print(v);
} into void f() {
final int v = 0;
print(v);
} |
…notations. Bug: #51721 Change-Id: If99fa9e84eabe4099dcfa674540e27f323eddd65 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290261 Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Hi , I was on another project (not Dart/Flutter related) so I did not had the time to check if it was fix. But right now, the quick-fix is not working @scheglov. Am I suppose to not keep type annotations ? |
@Punt13140 if you are not using the latest Dart/Flutter on the beta or master channel, you won't have this fix yet. |
Hi,
Since a few days, my IDE (IntelliJ) does not provide a quick-fix (which is just adding the
final
keyword) forprefer_final_locals
rule.I've tried with Visual Code, and I'm having the same problem.
The text was updated successfully, but these errors were encountered: