Member-only story
Reduce Flutter App Size: Asset Management Technique
4 min readNov 17, 2024
Flutter app size are generally larger. The size of a Flutter app depends on several factors, such as platform (Android/iOS), app complexity, assets, and third-party libraries.
Reason for larger app size in Flutter
- Flutter Engine: Flutter includes its rendering engine, which adds to the base size.
- Dart Runtime: Includes a Just-In-Time (JIT) and Ahead-Of-Time (AOT) compiled runtime.
- Assets: Images, fonts, and other resources can quickly increase size.
- Libraries/Plugins: Adding third-party libraries increases app size.
- Overhead from App Bundling
. On Android, the APK or AAB format includes a manifest, resources, and native libraries, which contribute to the overall size.
. On iOS, app thinning is less effective because all assets for all device types are bundled.
Several ways to reduce Flutter app size.
1.Use flutter build
Commands for Optimization
For Android
flutter build apk --release
flutter build appbundle --release
For iOS
flutter build ios --release
2. Optimize Assets
- Compress images using tools like TinyPNG or ImageOptim.