From de33608bc323a319177d642f2331006a38d1f177 Mon Sep 17 00:00:00 2001 From: Jess Kuras Date: Tue, 13 Oct 2026 20:31:00 +0000 Subject: [PATCH] Remove recommendation to always use const for performance optimization --- sites/docs/src/content/perf/best-practices.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sites/docs/src/content/perf/best-practices.md b/sites/docs/src/content/perf/best-practices.md index fdd056ec8a..fd60fc533d 100644 --- a/sites/docs/src/content/perf/best-practices.md +++ b/sites/docs/src/content/perf/best-practices.md @@ -74,13 +74,6 @@ Here are some things to keep in mind when designing your UI: ("Same instance" is evaluated using `operator ==`, but see the pitfalls section at the end of this page for advice on when to avoid overriding `operator ==`.) - * Use `const` constructors on widgets as much as possible, - since they allow Flutter to short-circuit most - of the rebuild work. To be automatically reminded - to use `const` when possible, enable the - recommended lints from the [`flutter_lints`][] package. - For more information, check out the - [`flutter_lints` migration guide][]. * To create reusable pieces of UIs, prefer using a [`StatelessWidget`][] rather than a function. @@ -92,11 +85,8 @@ For more information, check out: * [Widgets vs helper methods][], a video from the official Flutter YouTube channel that explains why widgets - (especially widgets with `const` constructors) are more performant than functions. -[`flutter_lints`]: {{site.pub-pkg}}/flutter_lints -[`flutter_lints` migration guide]: /release/breaking-changes/flutter-lints-package#migration-guide [Performance considerations]: {{site.api}}/flutter/widgets/StatefulWidget-class.html#performance-considerations [source code for `SlideTransition`]: {{site.repo.flutter}}/blob/main/packages/flutter/lib/src/widgets/transitions.dart#L168 [`StatefulWidget`]: {{site.api}}/flutter/widgets/StatefulWidget-class.html