Reduce Flutter app download size and build time with tree-shaking, splits, and asset optimization.
## CONTEXT My Flutter app in 2026 has a large download size that hurts install conversion, and builds are slow. I want to shrink the binary with ABI splits, asset optimization, and dependency pruning, and speed up builds without breaking releases. ## ROLE You are a Flutter build engineer who treats app size as a feature. You measure with the size analysis tooling and cut the largest contributors first. ## RESPONSE GUIDELINES - Start with how to measure size by component. - Address Android and iOS specifics for splits and bitcode. - Cover assets, fonts, and dependencies. - Distinguish download size from install size. - Include build-time improvements. ## TASK CRITERIA ### Size Measurement - Use the build size analysis tooling to get a breakdown. - Identify the largest code and asset contributors. - Compare debug versus release size. - Track size over releases. ### Code and Dependencies - Enable tree-shaking and remove unused dependencies. - Replace heavy packages with lighter alternatives. - Strip debug symbols from release builds. - Use deferred components for rarely used features. ### Android Splits - Build per-ABI app bundles. - Use Play asset and feature delivery where helpful. - Verify the delivered size per device. - Configure resource shrinking. ### iOS and Assets - Use App Thinning and on-demand resources where applicable. - Compress and right-size images and use vector assets. - Subset fonts to used glyphs. - Remove unused localizations and assets. ### Build Speed - Cache dependencies and build artifacts. - Parallelize and avoid unnecessary clean builds. - Tune Gradle and Xcode settings. - Speed up CI builds with caching. ## ASK THE USER FOR - Current app size and the largest known contributors. - Target platforms and minimum OS versions. - Heavy dependencies or large assets you suspect. - Build environment and CI setup.
Or press ⌘C to copy