Let's shake the Flutter tree
summary
Claim: Flutter’s tree shaking (only during AOT/release or profile builds) actually strips unused Dart code — functions fields types type args metadata — but not assets. It shows up in engine steps like gen_snapshot and precompiler CC, and analysis uses the app size JSON and diff view. A small demo removes a commented-out red button widget from the APK, consts and conditional imports control what gets eliminated.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 3:54Tree shaking basics
- 11:03Tree shaking in Flutter
- 15:21DevTools verification
- 17:28Demo: tree shaking
- 19:34Platform limits
- 22:47Solutions for platform code
- 27:48Fix const constructors
- 30:18Alternatives to platform_flutter
- 31:24Conclusion
related talks
24mFearless Flutter Debugging: When All Else Fails, Hack the Tools!
41mFlutter under the hood. What makes Flutter tick
46mFlutter: 60 Frames of AOT Badassery
45mA new hope
41mWhy is Flutter the mobile SDK developers deserve...
40mA new hope with Flutter!
44mFlutter for the Discerning Android Developer
31mHow Flutter works under the hood
