flutter_gen icon indicating copy to clipboard operation
flutter_gen copied to clipboard

Add support for deferred components

Open ianmaciel opened this issue 1 year ago • 4 comments

What does this change?

This PR include support for Flutter Deferred Components.

Deferred components allow developers to the app into multiple apk to reduce its size. This can be used to optimize the initial download and download components only on necessary but it is also mandatory for apk with more than 200MB.

This library initially looks for assets listed on flutter.assets of pubspec.yaml, with this change the library will continue looking for the assets lists under flutter.assets but will merge with the list of assets included on flutter.deferred-components.$. This will be merged in a single list.

Ideally in the future assets should have different classname, so users will easily know when dealing with deferred components. This wasn't implemented at this moment because it would requeire a significative changes.

Fixes #577 🎯

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update

Checklist:

Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • [x] Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
    • [ ] Ensure the tests (melos run test)
    • [ ] Ensure the analyzer and formatter pass (melos run format to automatically apply formatting)
  • [ ] Appropriate docs were updated (if necessary)

ianmaciel avatar Sep 17 '24 00:09 ianmaciel