Size Reduction Strategies

In almost any app, assets are always the primary size contributors. To reduce their impact on app size, you can follow some size reduction strategies such as:

  1. Removing unused assets.
  2. Optimizing (compressing) PNG / JPG images.
  3. Using modern animation file formats (lottie, rive) compared to GIFs.
  4. Not pre-bundling font files and using packages like google_fonts which fetches a specified font over the internet when the app runs for the first time. This font is subsequently cached in the device.

In case the size footprint of code-base is large, you should:

  1. Remove unused code.
  2. Split large classes that are difficult to optimize into smaller classes that will make it easier to identify and remove unnecessary code.
  3. Obfuscate your app to dramatically reduce code size.
  4. Choose efficient 3rd party packages that have a low size footprint. We will explore this point further in Scenario #2.