Did you know?
Unused assets will increase your app bundle size, which is undesired.
To prevent this, you can install the "Find Unused Dart Files" extension for VSCode.
Then, simply run it from the command palette and review all the unused assets, files, and dependencies. 👌
You can download the extension here:
Removing unused code via static analysis
Note: the extension works by finding references to the asset file names in your Dart code, and as such, it can produce false positives. So it's always best to check that they're actually unused before removing them.
If you want to reliably remove unused code and Dart files, consider using a static analysis tool like DCM, which can detect and remove any unused code via dcm fix
or from the IDE.
Happy coding!