appcraft_unused_assets 0.0.1
appcraft_unused_assets: ^0.0.1 copied to clipboard
Finds assets that nothing references, by the accessors generated by flutter_gen rather than by string literals of their paths.
0.0.1 #
- Search for unused assets through the accessors generated by flutter_gen rather than through the string literals of their paths.
- Usages are read from property reads, from a
valuesread on the class holding an asset, from path literals and from every*.yamlof the project root — so a precached directory, the launcher icon and the splash image are not reported as unused. report,checkfor CI andcleanwith--dry-run.- Resolution variants are deleted along with the asset they belong to.
- The report says how many assets it could not examine because the
valuesof their class is read, instead of passing them off as referenced. ignorefor the directories addressed by a path built at runtime.- The output of flutter_gen is read from the options of its builder in
build.yaml— under every key build_runner accepts, withglobal_optionsanddev_optionstaking precedence — as well as from theflutter_gensection of the pubspec. - In an app, the code of a file under
libthat no file declaringmainreaches through imports, exports and parts does not count;entry_pointsfor the apps that start elsewhere. When a reached import or an entry point is missing, no file is taken for dead and the report says which file is missing.