zeba_academy_asset_optimizer

๐Ÿš€ A powerful Flutter package to optimize your app assets with compression, unused detection, lazy loading, and size analysis.


โœจ Features

  • ๐Ÿ–ผ๏ธ Image Compression (reduce asset size efficiently)
  • ๐Ÿ” Detect Unused Assets (clean your project)
  • โšก Lazy Loading (load assets only when needed)
  • ๐Ÿ“Š Asset Size Analysis (understand size distribution)

๐Ÿ“ฆ Installation

Add this to your pubspec.yaml:

dependencies:
  zeba_academy_asset_optimizer: ^0.0.1

Then run:

flutter pub get

๐Ÿš€ Usage

๐Ÿ–ผ๏ธ Image Compression

await ImageCompressor.compressImage(
  inputPath: 'assets/image.png',
  outputPath: 'assets/image_compressed.jpg',
  quality: 70,
);

๐Ÿ” Detect Unused Assets

final unused = await UnusedAssetDetector.findUnusedAssets(
  projectPath: './',
  assetPaths: [
    'assets/image.png',
    'assets/logo.png',
  ],
);

โšก Lazy Loading

LazyAssetImage(
  assetPath: 'assets/image.png',
);

๐Ÿ“Š Asset Size Analysis

final assets = await AssetSizeAnalyzer.analyze('assets/');
final total = AssetSizeAnalyzer.totalSize(assets);

๐Ÿงช Testing

Run tests using:

flutter test

โš ๏ธ Limitations

  • Unused asset detection is string-based (may not be 100% accurate)
  • Lazy loading is basic (not viewport-aware yet)

๐Ÿ›ฃ๏ธ Roadmap

  • WebP & advanced compression
  • CLI support (dart run optimize)
  • Build runner integration
  • Viewport-aware lazy loading
  • Advanced asset graph analysis

๐Ÿ“„ License

This project is licensed under the GNU General Public License v3.0.


๐Ÿ‘จโ€๐Ÿ’ป About Me

โœจ Iโ€™m Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin


๐ŸŒ Your all-in-one no-bloat hub!

๐Ÿš€ Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! ๐Ÿ’ปโœจ

Zeba Academy is a learning platform dedicated to coding, technology, and development. โžก Visit our main site: zeba.academy
โžก Explore hands-on courses and resources at: code.zeba.academy
โžก Check out our YouTube for more tutorials: zeba.academy
โžก Follow us on Instagram: zeba.academy


โญ Contributing

Contributions are welcome! Feel free to open issues and pull requests.


โค๏ธ Support

If you like this project, give it a โญ on GitHub and share it with others!