website icon indicating copy to clipboard operation
website copied to clipboard

Explanation of 'const' optimization is missing

Open dalanicolai opened this issue 2 months ago • 1 comments

Page URL

https://docs.flutter.dev/get-started/fundamentals/widgets

Page source

No response

Describe the problem

I am completely new to flutter, and I noticed that widgets are mostly passed including a 'const'. I find it kind of weird that there is no explanation provided for why the 'const' is included (why it is 'preferred/required').

Expected fix

No response

Additional context

No response

I would like to fix this problem.

  • [ ] I will try and fix this problem on docs.flutter.dev.

dalanicolai avatar Oct 28 '25 13:10 dalanicolai

Not a bad idea, @dalanicolai. Meanwhile, here's a very good answer generated by AI. (Short answer: for performance.)

sfshaza2 avatar Oct 30 '25 17:10 sfshaza2