flutter-reducing-app-size

Installation
Summary

Measure and optimize Flutter app bundle size across platforms with analysis tools and reduction strategies.

  • Generates detailed size analysis JSON files via --analyze-size flag to identify large packages, libraries, and assets contributing to bloat
  • Visualize and compare builds using DevTools app size tool with treemap inspection and diff functionality to track optimization progress
  • Supports Android (APK/AAB), iOS, and desktop platforms with platform-specific workflows, including iOS app thinning size estimation via Xcode
  • Implements four core reduction strategies: debug symbol splitting, unused resource removal, library resource minimization, and media compression
SKILL.md

Reducing Flutter App Size

Contents

Core Concepts

  • Debug vs. Release: Never use debug builds to measure app size. Debug builds include VM overhead and lack Ahead-Of-Time (AOT) compilation and tree-shaking.
  • Upload vs. Download Size: The size of an upload package (APK, AAB, IPA) does not represent the end-user download size. App stores filter redundant native library architectures and asset densities based on the target device.
  • AOT Tree-Shaking: The Dart AOT compiler automatically removes unused or unreachable code in profile and release modes.
  • Size Analysis JSON: The --analyze-size flag generates a *-code-size-analysis_*.json file detailing the byte size of packages, libraries, classes, and functions.

Workflow: Generating Size Analysis Files

Use this workflow to generate the raw data required for size analysis.

Related skills
Installs
8.6K
Repository
flutter/skills
GitHub Stars
1.9K
First Seen
Mar 13, 2026