Flutterはデフォルトでパフォーマンスが高いですが、パフォーマンスの最適化には、不要な再ビルドの最小化、効率的なリスト描画、constの適切な使用、buildでの処理が重い計算の回避、およびプロファイリングが含まれます。これらを理解することにより、アプリは滑らかに動作します(60/120 fps)。
不要な再ビルドを最小化する
✓ Use CONST constructors where possible → const widgets aren't rebuilt (huge win)
const Text('Static') // not rebuilt unnecessarily
✓ Keep setState/rebuild scope SMALL → rebuild only what changed (extract widgets so
state changes rebuild a small subtree, not the whole screen)
✓ Use targeted state management (rebuild only widgets that depend on changed state)
✓ Don't rebuild large trees for small changes
