移动开发

flutter-app-size

flutter/agent-plugins

Measure and reduce the size of the Flutter app bundle, APK, or IPA

  • 1007 次安装
  • 3100 星标
  • 收录于

安装命令

npx skills add https://github.com/flutter/agent-plugins --skill flutter-app-size

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:

  1. 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.
  2. Is the user measuring iOS?
    • Yes: Run flutter build ipa --export-method development and generate an Xcode App Thinning Size Report for accurate download estimates.
  3. Is the user analyzing the breakdown of components?
    • Yes: Launch dart devtools, open the App Size Tool, and upload the generated *-code-size-analysis_*.json file.
  4. Is the user applying size reduction strategies?
    • Yes: Apply --split-debug-info, compress assets, and implement Platform checks for aggressive tree-shaking.

Instructions