📜  flutter const advantag - Dart 代码示例

📅  最后修改于: 2022-03-11 14:48:04.994000             🧑  作者: Mango

代码示例1
When we use setState() Flutter calls the build method and rebuilds every widget tree inside it. The best way to avoid this is by using const costructors.

Use const constructors whenever possible when building your own widgets or using Flutter widgets. This helps Flutter to rebuild only widgets that should be updated.