flutter-app-size
Installation
SKILL.md
flutter-app-size-optimization
Goal
Analyzes and optimizes Flutter application size by measuring build artifacts, generating size analysis reports, utilizing Dart DevTools for component breakdown, and implementing specific size reduction strategies such as debug info splitting, resource compression, and platform-specific tree-shaking. Assumes a configured Flutter environment and target platform availability.
Decision Logic
Use the following decision tree to determine the correct measurement and optimization path:
- Is the user measuring Android or Desktop (Linux/macOS/Windows)?
- Yes: Run
flutter build <platform> --analyze-size. Proceed to DevTools analysis. - No: Proceed to step 2.
- Yes: Run
- Is the user measuring iOS?
- Yes: Run
flutter build ipa --export-method developmentand generate an Xcode App Thinning Size Report for accurate download estimates.
- Yes: Run
- Is the user analyzing the breakdown of components?
- Yes: Launch
dart devtools, open the App Size Tool, and upload the generated*-code-size-analysis_*.jsonfile.
- Yes: Launch
- Is the user applying size reduction strategies?
- Yes: Apply
--split-debug-info, compress assets, and implementPlatformchecks for aggressive tree-shaking.
- Yes: Apply